[Libreoffice-commits] core.git: sal/osl

Stephan Bergmann sbergman at redhat.com
Tue May 20 06:47:23 PDT 2014


 sal/osl/w32/thread.c |   16 ++++++++--------
 sal/osl/w32/time.c   |    2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 92621df9e72b9d4e44e448f92df14c4ba731d5e4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 20 15:46:31 2014 +0200

    Revert "fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT"
    
    This reverts commit 0562a17c64f4016f2d3ba01e1c19c27feadb2543,
    sal/log.hxx functionality is only available in C++.

diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index ac3ddc6..2eeea06 100644
--- a/sal/osl/w32/thread.c
+++ b/sal/osl/w32/thread.c
@@ -73,7 +73,7 @@ static oslThread oslCreateThread(oslWorkerFunction pWorker,
     /* alloc mem. for our internal data structure */
     pThreadImpl= malloc(sizeof(osl_TThreadImpl));
 
-    SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - malloc error");
+    OSL_ASSERT(pThreadImpl);
 
     if ( pThreadImpl == 0 )
     {
@@ -160,7 +160,7 @@ void SAL_CALL osl_resumeThread(oslThread Thread)
 {
     osl_TThreadImpl* pThreadImpl= (osl_TThreadImpl*)Thread;
 
-    SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - invalid ptr");        /* valid ptr? */
+    OSL_ASSERT(pThreadImpl);        /* valid ptr? */
 
     ResumeThread(pThreadImpl->m_hThread);
 }
@@ -172,7 +172,7 @@ void SAL_CALL osl_suspendThread(oslThread Thread)
 {
     osl_TThreadImpl* pThreadImpl= (osl_TThreadImpl*)Thread;
 
-    SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - invalid ptr");        /* valid ptr? */
+    OSL_ASSERT(pThreadImpl);        /* valid ptr? */
 
     SuspendThread(pThreadImpl->m_hThread);
 }
@@ -186,7 +186,7 @@ void SAL_CALL osl_setThreadPriority(oslThread Thread,
     int winPriority;
     osl_TThreadImpl* pThreadImpl= (osl_TThreadImpl*)Thread;
 
-    SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - invalid ptr");        /* valid ptr? */
+    OSL_ASSERT(pThreadImpl);        /* valid ptr? */
 
     /*  map enum to WIN32 levels
         it would be faster and more elegant to preset
@@ -216,13 +216,13 @@ void SAL_CALL osl_setThreadPriority(oslThread Thread,
         break;
 
     case osl_Thread_PriorityUnknown:
-        SAL_WARN_IF(TRUE, "sal.osl", "Unknown thread priority");      /* only fools try this...*/
+        OSL_ASSERT(FALSE);      /* only fools try this...*/
 
         /* let release-version behave friendly */
         return;
 
     default:
-        SAL_WARN_IF(TRUE, "sal.osl", "Expanded, but forgotten priority");      /* enum expanded, but forgotten here...*/
+        OSL_ASSERT(FALSE);      /* enum expanded, but forgotten here...*/
 
         /* let release-version behave friendly */
         return;
@@ -281,7 +281,7 @@ oslThreadPriority SAL_CALL osl_getThreadPriority(const oslThread Thread)
         break;
 
     default:
-        SAL_WARN_IF(TRUE, "sal.osl", "New priority-level needed");      /* WIN32 API changed, incorporate new prio-level! */
+        OSL_ASSERT(FALSE);      /* WIN32 API changed, incorporate new prio-level! */
 
         /* release-version behaves friendly */
         Priority= osl_Thread_PriorityUnknown;
@@ -442,7 +442,7 @@ static void RemoveKeyFromList( PTLS pTls )
             pTls->pPrev->pNext = pTls->pNext;
         else
         {
-            SAL_WARN_IF( pTls != g_pThreadKeyList, "sal.osl", "pTls != g_pThreadKeyList" );
+            OSL_ASSERT( pTls == g_pThreadKeyList );
             g_pThreadKeyList = pTls->pNext;
         }
 
diff --git a/sal/osl/w32/time.c b/sal/osl/w32/time.c
index 95f2ec4..dd30c44 100644
--- a/sal/osl/w32/time.c
+++ b/sal/osl/w32/time.c
@@ -35,7 +35,7 @@ sal_Bool SAL_CALL osl_getSystemTime(TimeValue* pTimeVal)
     FILETIME   CurTime, OffTime;
     __int64    Value;
 
-    SAL_WARN_IF(pTimeVal == 0, "sal.osl", "pTimeVal == 0");
+    OSL_ASSERT(pTimeVal != 0);
 
     GetSystemTime(&SystemTime);
     SystemTimeToFileTime(&SystemTime, &CurTime);


More information about the Libreoffice-commits mailing list