[Libreoffice-commits] core.git: Changes to 'refs/changes/01/9401/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/23/9423/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/23/9423/3'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/23/9423/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/00/9400/2'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'refs/changes/19/9419/1'
___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sal/osl
sal/osl/unx/profile.cxx | 377 --- sal/osl/unx/security.cxx | 19 +- 2 files changed, 46 insertions(+), 350 deletions(-) New commits: commit 4c05911b7ef25505acacbb81053a56cf428e9edc Author: Mukhiddin Yusupov ymukhid...@gmail.com Date: Wed May 21 01:46:57 2014 +0200 fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT Replaced OSL_ASSERT with SAL_WARN_IF, OSL_TRACE with SAL_INFO Change-Id: Ia2283c09ac702558fe6ad39e963b0f401ef31de0 Signed-off-by: Stephan Bergmann sberg...@redhat.com diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 15df5b5..6684662 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -47,9 +47,6 @@ #define DEFAULT_PMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) -/*#define DEBUG_OSL_PROFILE*/ -/*#define TRACE_OSL_PROFILE*/ - typedef time_t osl_TStamp; typedef enum _osl_TLockMode @@ -153,41 +150,8 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o osl_TProfileImpl* pProfile; bool bRet = false; -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(In osl_openProfile); -#endif - -#ifdef DEBUG_OSL_PROFILE -Flags=osl_Profile_FLUSHWRITE; - -OSL_TRACE(opening '%s',pszProfileName); -if ( Flags == osl_Profile_DEFAULT ) -{ -OSL_TRACE(with osl_Profile_DEFAULT); -} -if ( Flags osl_Profile_SYSTEM ) -{ -OSL_TRACE(with osl_Profile_SYSTEM); -} -if ( Flags osl_Profile_READLOCK ) -{ -OSL_TRACE(with osl_Profile_READLOCK); -} -if ( Flags osl_Profile_WRITELOCK ) -{ -OSL_TRACE(with osl_Profile_WRITELOCK); -} -if ( Flags osl_Profile_FLUSHWRITE ) -{ -OSL_TRACE(with osl_Profile_FLUSHWRITE); -} -#endif - if ( ( pFile = openFileImpl(pszProfileName, Flags ) ) == NULL ) { -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_openProfile [not opened]); -#endif return (NULL); } @@ -212,14 +176,11 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o pProfile-m_Stamp = OslProfile_getFileStamp(pFile); bRet=loadProfile(pFile, pProfile); bRet = realpath(pszProfileName, pProfile-m_FileName) != NULL; -OSL_ASSERT(bRet); +SAL_WARN_IF(!bRet, sal.osl, realpath(pszProfileName, pProfile-m_FileName) != NULL == false); if (pProfile-m_pFile == NULL) closeFileImpl(pFile,pProfile-m_Flags); -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_openProfile [ok]); -#endif return (pProfile); } @@ -228,15 +189,8 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) osl_TProfileImpl* pProfile = (osl_TProfileImpl*)Profile; osl_TProfileImpl* pTmpProfile; -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(In osl_closeProfile); -#endif - if ( Profile == 0 ) { -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_closeProfile [profile==0]); -#endif return sal_False; } @@ -244,11 +198,9 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) if ( pProfile-m_bIsValid == false ) { -OSL_ASSERT(pProfile-m_bIsValid); +SAL_WARN(sal.osl, !pProfile-m_bIsValid); pthread_mutex_unlock((pProfile-m_AccessLock)); -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_closeProfile [not valid]); -#endif + return sal_False; } @@ -261,7 +213,7 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) if ( pTmpProfile != 0 ) { bool bRet = storeProfile(pTmpProfile, true); -OSL_ASSERT(bRet); +SAL_WARN_IF(!bRet, sal.osl, storeProfile(pTmpProfile, true) == false); (void)bRet; } } @@ -273,9 +225,8 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) if ( pTmpProfile == 0 ) { pthread_mutex_unlock((pProfile-m_AccessLock)); -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_closeProfile [pProfile==0]); -#endif + +SAL_INFO(sal.osl, Out osl_closeProfile [pProfile==0]); return sal_False; } @@ -326,9 +277,6 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile) free(pProfile); -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_closeProfile [ok]); -#endif return (sal_True); } @@ -338,15 +286,8 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile) osl_TFile* pFile; bool bRet = false; -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(In osl_flushProfile()); -#endif - if ( pProfile == 0 ) { -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out osl_flushProfile() [pProfile == 0]); -#endif return sal_False; } @@ -354,11 +295,8 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile) if ( pProfile-m_bIsValid == false ) { -OSL_ASSERT(pProfile-m_bIsValid); +SAL_WARN_IF(!pProfile-m_bIsValid, sal.osl, !pProfile-m_bIsValid); pthread_mutex_unlock((pProfile-m_AccessLock)); -#ifdef TRACE_OSL_PROFILE -OSL_TRACE(Out
[Libreoffice-commits] core.git: sal/osl
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 ymukhid...@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+libreoff...@googlemail.com Tested-by: Christian Lohmaier lohmaier+libreoff...@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; __int64Value; -OSL_ASSERT(pTimeVal != 0); +SAL_WARN_IF(pTimeVal == 0, sal.osl, pTimeVal == 0); GetSystemTime(SystemTime); SystemTimeToFileTime(SystemTime, CurTime); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits