[Libreoffice-commits] core.git: sal/osl
Mukhiddin Yusupov
ymukhiddin at gmail.com
Tue May 20 06:16:41 PDT 2014
sal/osl/w32/thread.c | 16 ++++++++--------
sal/osl/w32/time.c | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 0562a17c64f4016f2d3ba01e1c19c27feadb2543
Author: Mukhiddin Yusupov <ymukhiddin at gmail.com>
Date: Mon May 19 00:17:33 2014 +0200
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 at googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index 2eeea06..ac3ddc6 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 dd30c44..95f2ec4 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);
More information about the Libreoffice-commits
mailing list