summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-03-25 12:18:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-03-25 16:17:09 +0100
commit3c5d30c03b4b2d2c4d38d602afc839e7a922bca3 (patch)
tree87cd425456316b3a9fa599a2a197c9ae959c1382 /sal
parentff1a592a1f2c8426691bf497a67720a6a91bdaae (diff)
Adapt to sal/log.hxx
Change-Id: I9c59495977e111d94077470f07591c91fa3c1665
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/all/debugbase.cxx30
1 files changed, 7 insertions, 23 deletions
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 57238ce000f3..75cd8466f9d4 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -23,18 +23,10 @@
#include "rtl/ustring.hxx"
#include "osl/process.h"
#include "osl/diagnose.hxx"
+#include "sal/log.hxx"
#include "boost/bind.hpp"
#include <vector>
-// define own ones, independent of OSL_DEBUG_LEVEL:
-#define DEBUGBASE_ENSURE_(c, f, l, m) \
- do \
- { \
- if (!(c) && _OSL_GLOBAL osl_assertFailedLine(f, l, m)) \
- _OSL_GLOBAL osl_breakDebug(); \
- } while (false)
-#define DEBUGBASE_ENSURE(c, m) DEBUGBASE_ENSURE_(c, OSL_THIS_FILE, __LINE__, m)
-
namespace {
typedef std::vector<rtl::OString, rtl::Allocator<rtl::OString> > OStringVec;
@@ -118,16 +110,10 @@ bool SAL_CALL osl_detail_ObjectRegistry_checkObjectCount(
nSize = static_cast<std::size_t>(rData.m_nCount);
bool const bRet = (nSize == nExpected);
- if (! bRet) {
- rtl::OStringBuffer buf;
- buf.append( "unexpected number of " );
- buf.append( rData.m_pName );
- buf.append( ": " );
- buf.append( static_cast<sal_Int64>(nSize) );
- buf.append("; Expected: ");
- buf.append( static_cast<sal_Int64>(nExpected) );
- DEBUGBASE_ENSURE( false, buf.makeStringAndClear().getStr() );
- }
+ SAL_WARN_IF(
+ !bRet, "sal.osl",
+ "unexpected number of " << rData.m_pName << ": " << nSize
+ << "; Expected: " << nExpected);
return bRet;
}
@@ -139,8 +125,7 @@ void SAL_CALL osl_detail_ObjectRegistry_registerObject(
osl::MutexGuard const guard( osl_detail_ObjectRegistry_getMutex() );
std::pair<osl::detail::VoidPointerSet::iterator, bool> const insertion(
rData.m_addresses.insert(pObj) );
- DEBUGBASE_ENSURE( insertion.second, "### insertion failed!?" );
- static_cast<void>(insertion);
+ SAL_WARN_IF(!insertion.second, "sal.osl", "insertion failed!?");
}
else {
osl_atomic_increment(&rData.m_nCount);
@@ -154,8 +139,7 @@ void SAL_CALL osl_detail_ObjectRegistry_revokeObject(
if (rData.m_bStoreAddresses) {
osl::MutexGuard const guard( osl_detail_ObjectRegistry_getMutex() );
std::size_t const n = rData.m_addresses.erase(pObj);
- DEBUGBASE_ENSURE( n == 1, "erased more than 1 entry!?" );
- static_cast<void>(n);
+ SAL_WARN_IF(n != 1, "sal.osl", "erased more than 1 entry!?");
}
else {
osl_atomic_decrement(&rData.m_nCount);