summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-07 19:24:38 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-07 19:23:01 +0000
commitda147a4e64847f62007d3d01f82c8dc59e2f4366 (patch)
treefa15907dac279a99da66b98a9643d752aba57425 /sal
parentremove CREATE_OSTRING macro (diff)
downloadcore-da147a4e64847f62007d3d01f82c8dc59e2f4366.tar.gz
core-da147a4e64847f62007d3d01f82c8dc59e2f4366.zip
Clean up C-style interface nonsense
Change-Id: Ie9a1e106f5270fd307d211fa334449c698acf25d Reviewed-on: https://gerrit.libreoffice.org/34010 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/backtraceasstring.hxx (renamed from sal/inc/misc.hxx)13
-rw-r--r--sal/osl/all/log.cxx7
-rw-r--r--sal/osl/unx/backtraceapi.cxx11
-rw-r--r--sal/osl/w32/backtrace.cxx10
4 files changed, 22 insertions, 19 deletions
diff --git a/sal/inc/misc.hxx b/sal/inc/backtraceasstring.hxx
index 440c00ce2548..d15065a48ce8 100644
--- a/sal/inc/misc.hxx
+++ b/sal/inc/backtraceasstring.hxx
@@ -6,13 +6,20 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef INCLUDED_SAL_INC_INTERNAL_MISC_H
-#define INCLUDED_SAL_INC_INTERNAL_MISC_H
+
+#ifndef INCLUDED_SAL_INC_BACKTRACEASSTRING_HXX
+#define INCLUDED_SAL_INC_BACKTRACEASSTRING_HXX
+
+#include <sal/config.h>
#include <rtl/ustring.hxx>
+namespace osl { namespace detail {
+
/// Build a debugging backtrace from current PC location.
-rtl_uString *osl_backtraceAsString(int maxNoStackFramesToDisplay);
+OUString backtraceAsString(int maxNoStackFramesToDisplay);
+
+} }
#endif // INCLUDED_SAL_INC_INTERNAL_MISC_H
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index 5e4497fac24b..7a6c3072b940 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -26,7 +26,7 @@
#include "sal/detail/log.h"
#include "sal/log.hxx"
#include "sal/types.h"
-#include "misc.hxx"
+#include "backtraceasstring.hxx"
#include "salusesyslog.hxx"
#if defined ANDROID
@@ -277,9 +277,8 @@ void log_backtrace(
sal_detail_LogLevel level, char const * area, char const * where,
char const * message, int maxNoStackFramesToDisplay)
{
- OUString buff = OUString::createFromAscii(message) +
- " at:\n" +
- OUString(osl_backtraceAsString(maxNoStackFramesToDisplay), SAL_NO_ACQUIRE);
+ OUString buff = OUString::createFromAscii(message) + " at:\n"
+ + osl::detail::backtraceAsString(maxNoStackFramesToDisplay);
log(level, area, where, buff.toUtf8().getStr());
}
diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
index d42fe674adb9..c212184ceb55 100644
--- a/sal/osl/unx/backtraceapi.cxx
+++ b/sal/osl/unx/backtraceapi.cxx
@@ -9,16 +9,13 @@
#include <sal/config.h>
-#include <rtl/ustrbuf.hxx>
-#include "misc.hxx"
+#include <rtl/ustring.hxx>
+#include "backtraceasstring.hxx"
// FIXME: no-op for now; it needs implementing, cf. above.
-rtl_uString *osl_backtraceAsString(int /*maxNoStackFramesToDisplay*/)
+OUString osl::detail::backtraceAsString(int /*maxNoStackFramesToDisplay*/)
{
- OUStringBuffer aBuf;
- OUString aStr = aBuf.makeStringAndClear();
- rtl_uString_acquire( aStr.pData );
- return aStr.pData;
+ return OUString();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/backtrace.cxx b/sal/osl/w32/backtrace.cxx
index 6c24698b1aa3..78d9e0aed9e5 100644
--- a/sal/osl/w32/backtrace.cxx
+++ b/sal/osl/w32/backtrace.cxx
@@ -7,7 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "misc.hxx"
+#include <sal/config.h>
+
+#include "backtraceasstring.hxx"
#include <windows.h>
#include <process.h>
@@ -18,7 +20,7 @@
#include <rtl/ustrbuf.hxx>
#include <memory>
-rtl_uString *osl_backtraceAsString(int maxNoStackFramesToDisplay)
+OUString osl::detail::backtraceAsString(int maxNoStackFramesToDisplay)
{
OUStringBuffer aBuf;
@@ -46,9 +48,7 @@ rtl_uString *osl_backtraceAsString(int maxNoStackFramesToDisplay)
free( pSymbol );
- OUString aStr = aBuf.makeStringAndClear();
- rtl_uString_acquire( aStr.pData );
- return aStr.pData;
+ return aBuf.makeStringAndClear();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */