summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorMukhiddin Yusupov <ymukhiddin@gmail.com>2014-05-19 00:17:33 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-05-20 08:16:19 -0500
commit0562a17c64f4016f2d3ba01e1c19c27feadb2543 (patch)
treec8bd2b9952e2f6f92dc4e76b74b101667364dc86 /sal
parentef02ced3ec5e66d5c25de52fc37355ae0f44235e (diff)
fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT
Changed OSL_ASSERT with SAL_WARN_IF Change-Id: Ie81eeb51f6978162abd372f7e9910344a2baaccd Reviewed-on: https://gerrit.libreoffice.org/9401 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/w32/thread.c16
-rw-r--r--sal/osl/w32/time.c2
2 files changed, 9 insertions, 9 deletions
diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index 2eeea0681550..ac3ddc657608 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));
- OSL_ASSERT(pThreadImpl);
+ SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - malloc error");
if ( pThreadImpl == 0 )
{
@@ -160,7 +160,7 @@ void SAL_CALL osl_resumeThread(oslThread Thread)
{
osl_TThreadImpl* pThreadImpl= (osl_TThreadImpl*)Thread;
- OSL_ASSERT(pThreadImpl); /* valid ptr? */
+ SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - invalid ptr"); /* valid ptr? */
ResumeThread(pThreadImpl->m_hThread);
}
@@ -172,7 +172,7 @@ void SAL_CALL osl_suspendThread(oslThread Thread)
{
osl_TThreadImpl* pThreadImpl= (osl_TThreadImpl*)Thread;
- OSL_ASSERT(pThreadImpl); /* valid ptr? */
+ SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - invalid ptr"); /* 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;
- OSL_ASSERT(pThreadImpl); /* valid ptr? */
+ SAL_WARN_IF(!pThreadImpl, "sal.osl", "!pThreadImpl - invalid ptr"); /* 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:
- OSL_ASSERT(FALSE); /* only fools try this...*/
+ SAL_WARN_IF(TRUE, "sal.osl", "Unknown thread priority"); /* only fools try this...*/
/* let release-version behave friendly */
return;
default:
- OSL_ASSERT(FALSE); /* enum expanded, but forgotten here...*/
+ SAL_WARN_IF(TRUE, "sal.osl", "Expanded, but forgotten priority"); /* 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:
- OSL_ASSERT(FALSE); /* WIN32 API changed, incorporate new prio-level! */
+ SAL_WARN_IF(TRUE, "sal.osl", "New priority-level needed"); /* 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
{
- OSL_ASSERT( pTls == g_pThreadKeyList );
+ SAL_WARN_IF( pTls != g_pThreadKeyList, "sal.osl", "pTls != g_pThreadKeyList" );
g_pThreadKeyList = pTls->pNext;
}
diff --git a/sal/osl/w32/time.c b/sal/osl/w32/time.c
index dd30c44da4e1..95f2ec47c486 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;
- OSL_ASSERT(pTimeVal != 0);
+ SAL_WARN_IF(pTimeVal == 0, "sal.osl", "pTimeVal == 0");
GetSystemTime(&SystemTime);
SystemTimeToFileTime(&SystemTime, &CurTime);