sal/inc/backtraceasstring.hxx | 25 +++++++++++++++++++++++++ sal/inc/misc.hxx | 18 ------------------ sal/osl/all/log.cxx | 7 +++---- sal/osl/unx/backtraceapi.cxx | 11 ++++------- sal/osl/w32/backtrace.cxx | 10 +++++----- 5 files changed, 37 insertions(+), 34 deletions(-)
New commits: commit da147a4e64847f62007d3d01f82c8dc59e2f4366 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Feb 7 19:24:38 2017 +0100 Clean up C-style interface nonsense Change-Id: Ie9a1e106f5270fd307d211fa334449c698acf25d Reviewed-on: https://gerrit.libreoffice.org/34010 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sal/inc/misc.hxx b/sal/inc/backtraceasstring.hxx similarity index 68% rename from sal/inc/misc.hxx rename to sal/inc/backtraceasstring.hxx index 440c00c..d15065a 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 5e4497f..7a6c307 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 d42fe67..c212184 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 6c24698..78d9e0a 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: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits