diff options
author | Philipp Riemer <ruderphilipp@gmail.com> | 2012-08-18 18:12:35 +0200 |
---|---|---|
committer | Philipp Riemer <ruderphilipp@gmail.com> | 2012-08-18 18:33:50 +0200 |
commit | 42352dff5a8dc4c89fccf399359876aea7dc7d2d (patch) | |
tree | 7747642c5ee1c7465e8a684a35713f5dbd90dc82 /tools/source/debug | |
parent | 0700d6a1f3524ab79b5114559fb2d15c7ba85112 (diff) |
removed ascii-art and blank lines in tools/source
Change-Id: I3f95d12a8c325c96c586253b5d9bb7dce24c0858
Diffstat (limited to 'tools/source/debug')
-rw-r--r-- | tools/source/debug/debug.cxx | 94 |
1 files changed, 9 insertions, 85 deletions
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index 4d12c791455e..d6e9bbc07ede 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -43,8 +43,6 @@ #include <osl/diagnose.h> -// ======================================================================= - #ifdef DBG_UTIL // --- PointerList --- @@ -156,24 +154,17 @@ struct DebugData #define DBG_TEST_XTOR_EXTRA (DBG_TEST_XTOR_THIS | DBG_TEST_XTOR_FUNC | \ DBG_TEST_XTOR_EXIT | DBG_TEST_XTOR_REPORT ) -// ------------------------------ -// - static maintenance variables - -// ------------------------------ +// static maintenance variables static DebugData aDebugData; - static sal_Char aCurPath[260]; - static int bDbgImplInMain = sal_False; -// ======================================================================= - #if defined( WNT ) static CRITICAL_SECTION aImplCritDbgSection; #endif -static sal_Bool bImplCritDbgSectionInit = sal_False; -// ----------------------------------------------------------------------- +static sal_Bool bImplCritDbgSectionInit = sal_False; void ImplDbgInitLock() { @@ -183,8 +174,6 @@ void ImplDbgInitLock() bImplCritDbgSectionInit = sal_True; } -// ----------------------------------------------------------------------- - void ImplDbgDeInitLock() { #if defined( WNT ) @@ -193,8 +182,6 @@ void ImplDbgDeInitLock() bImplCritDbgSectionInit = sal_False; } -// ----------------------------------------------------------------------- - void ImplDbgLock() { if ( !bImplCritDbgSectionInit ) @@ -205,8 +192,6 @@ void ImplDbgLock() #endif } -// ----------------------------------------------------------------------- - void ImplDbgUnlock() { if ( !bImplCritDbgSectionInit ) @@ -217,12 +202,8 @@ void ImplDbgUnlock() #endif } -// ======================================================================= - #define FILE_LINEEND "\n" -// ======================================================================= - static sal_Bool ImplActivateDebugger( const sal_Char* pMsg ) { #if defined( WNT ) @@ -238,8 +219,6 @@ static sal_Bool ImplActivateDebugger( const sal_Char* pMsg ) #endif } -// ----------------------------------------------------------------------- - static sal_Bool ImplCoreDump() { #if defined( WNT ) @@ -251,8 +230,6 @@ static sal_Bool ImplCoreDump() return sal_True; } -// ======================================================================= - static sal_uIntPtr ImplGetPerfTime() { #if defined( WNT ) @@ -275,8 +252,6 @@ static sal_uIntPtr ImplGetPerfTime() #endif } -// ----------------------------------------------------------------------- - typedef FILE* FILETYPE; #define FileOpen fopen #define FileRead fread @@ -284,8 +259,6 @@ typedef FILE* FILETYPE; #define FilePrintF fprintf #define FileClose fclose -// ======================================================================= - namespace { enum ConfigSection @@ -364,6 +337,7 @@ namespace }; lcl_writeConfigString( _pFile, _pKeyName, names[ _nValue ] ); } + bool lcl_isConfigSection( const sal_Char* _pLine, size_t _nLineLen ) { if ( _nLineLen < 2 ) @@ -373,6 +347,7 @@ namespace return true; return false; } + bool lcl_isConfigKey( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName ) { size_t nKeyLength = strlen( _pKeyName ); @@ -383,6 +358,7 @@ namespace return true; return false; } + sal_Int32 lcl_tryReadConfigString( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_Char* _pValue, size_t _nValueLen ) { if ( !lcl_isConfigKey( _pLine, _nLineLen, _pKeyName ) ) @@ -394,6 +370,7 @@ namespace _pValue[ ( _nValueLen > nValueLen ) ? nValueLen : _nValueLen - 1 ] = 0; return strlen( _pValue ); } + void lcl_tryReadConfigBoolean( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) { sal_Char aBuf[2]; @@ -401,6 +378,7 @@ namespace if ( nValueLen ) *_out_pnValue = strcmp( aBuf, "1" ) == 0 ? sal_True : sal_False; } + void lcl_matchOutputChannel( sal_Char const * i_buffer, sal_uIntPtr* o_value ) { if ( i_buffer == NULL ) @@ -418,6 +396,7 @@ namespace } } } + void lcl_tryReadOutputChannel( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnValue ) { sal_Char aBuf[20]; @@ -425,6 +404,7 @@ namespace if ( nValueLen ) lcl_matchOutputChannel( aBuf, _out_pnValue ); } + void lcl_tryReadConfigFlag( const sal_Char* _pLine, size_t _nLineLen, const sal_Char* _pKeyName, sal_uIntPtr* _out_pnAllFlags, sal_uIntPtr _nCheckFlag ) { sal_Char aBuf[2]; @@ -439,8 +419,6 @@ namespace } } -// ======================================================================= - PointerList::~PointerList() { PBlock* pBlock = pFirst; @@ -452,8 +430,6 @@ PointerList::~PointerList() } } -// ----------------------------------------------------------------------- - void PointerList::Add( const void* p ) { if ( !pFirst ) @@ -490,8 +466,6 @@ void PointerList::Add( const void* p ) nCount++; } -// ----------------------------------------------------------------------- - sal_Bool PointerList::Remove( const void* p ) { if ( !p ) @@ -533,8 +507,6 @@ sal_Bool PointerList::Remove( const void* p ) return sal_False; } -// ----------------------------------------------------------------------- - const void* PointerList::Get( sal_uIntPtr nPos ) const { if ( nCount <= nPos ) @@ -563,8 +535,6 @@ const void* PointerList::Get( sal_uIntPtr nPos ) const return NULL; } -// ----------------------------------------------------------------------- - sal_Bool PointerList::IsIn( const void* p ) const { if ( !p ) @@ -587,9 +557,6 @@ sal_Bool PointerList::IsIn( const void* p ) const return sal_False; } - -// ======================================================================= - static void DbgGetDbgFileName( sal_Char* pStr, sal_Int32 nMaxLen ) { #if defined( UNX ) @@ -609,8 +576,6 @@ static void DbgGetDbgFileName( sal_Char* pStr, sal_Int32 nMaxLen ) pStr[ nMaxLen - 1 ] = 0; } -// ----------------------------------------------------------------------- - static void DbgGetLogFileName( sal_Char* pStr ) { #if defined( UNX ) @@ -629,8 +594,6 @@ static void DbgGetLogFileName( sal_Char* pStr ) #endif } -// ----------------------------------------------------------------------- - static DebugData* GetDebugData() { if ( !aDebugData.bInit ) @@ -728,8 +691,6 @@ static DebugData* GetDebugData() return &aDebugData; } -// ----------------------------------------------------------------------- - inline DebugData* ImplGetDebugData() { if ( !aDebugData.bInit ) @@ -738,8 +699,6 @@ inline DebugData* ImplGetDebugData() return &aDebugData; } -// ----------------------------------------------------------------------- - static FILETYPE ImplDbgInitFile() { static sal_Bool bFileInit = sal_False; @@ -799,8 +758,6 @@ static FILETYPE ImplDbgInitFile() return pDebugFile; } -// ----------------------------------------------------------------------- - static void ImplDbgPrintFile( const sal_Char* pLine ) { FILETYPE pDebugFile = ImplDbgInitFile(); @@ -812,8 +769,6 @@ static void ImplDbgPrintFile( const sal_Char* pLine ) } } -// ----------------------------------------------------------------------- - static int ImplStrSearch( const sal_Char* pSearchStr, int nSearchLen, const sal_Char* pStr, int nLen ) { @@ -828,8 +783,6 @@ static int ImplStrSearch( const sal_Char* pSearchStr, int nSearchLen, return 0; } -// ----------------------------------------------------------------------- - static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg, int bEmpty ) { @@ -860,16 +813,12 @@ static int ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg, return sal_False; } -// ----------------------------------------------------------------------- - extern "C" void SAL_CALL dbg_printOslDebugMessage( const sal_Char * pszFileName, sal_Int32 nLine, const sal_Char * pszMessage ) { DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (sal_uInt16)nLine ); } -// ----------------------------------------------------------------------- - static void DebugInit() { bDbgImplInMain = sal_True; @@ -883,8 +832,6 @@ static void DebugInit() } } -// ----------------------------------------------------------------------- - static void DebugDeInit() { DebugData* pData = GetDebugData(); @@ -957,8 +904,6 @@ static void DebugDeInit() ImplDbgDeInitLock(); } -// ----------------------------------------------------------------------- - static void DebugGlobalDeInit() { DebugData* pData = GetDebugData(); @@ -1008,8 +953,6 @@ static void DebugGlobalDeInit() pData->aDbgData.nTestFlags &= ~DBG_TEST_PROFILING; } -// ----------------------------------------------------------------------- - void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... ) { va_list pList; @@ -1023,8 +966,6 @@ void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... ) strcat( pBuf, "\n" ); } -// ----------------------------------------------------------------------- - static void DebugXTorInfo( sal_Char* pBuf ) { DebugData* pData = GetDebugData(); @@ -1057,7 +998,6 @@ static void DebugXTorInfo( sal_Char* pBuf ) } } -// ----------------------------------------------------------------------- sal_Bool ImplDbgFilterMessage( const sal_Char* pMsg ) { DebugData* pData = GetDebugData(); @@ -1068,8 +1008,6 @@ sal_Bool ImplDbgFilterMessage( const sal_Char* pMsg ) return sal_False; } -// ----------------------------------------------------------------------- - void* DbgFunc( sal_uInt16 nAction, void* pParam ) { DebugData* pDebugData = ImplGetDebugData(); @@ -1206,8 +1144,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam ) } } -// ----------------------------------------------------------------------- - DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc ) { DebugData* pData = ImplGetDebugData(); @@ -1215,8 +1151,6 @@ DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc ) return (DbgChannelId)( pData->aDbgPrintUserChannels.size() - 1 + DBG_OUT_USER_CHANNEL_0 ); } -// ----------------------------------------------------------------------- - void DbgProf( sal_uInt16 nAction, DbgDataType* pDbgData ) { DebugData* pData = ImplGetDebugData(); @@ -1307,8 +1241,6 @@ void DbgProf( sal_uInt16 nAction, DbgDataType* pDbgData ) } } -// ----------------------------------------------------------------------- - void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis, DbgUsr fDbgUsr ) { @@ -1462,8 +1394,6 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis, : "Leave method from class ") << pDbgData->pName); } -// ----------------------------------------------------------------------- - void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sal_uInt16 nLine ) { static sal_Bool bIn = sal_False; @@ -1619,8 +1549,6 @@ void DbgPrintShell(char const * message) { #endif } -// ----------------------------------------------------------------------- - void DbgOutTypef( sal_uInt16 nDbgOut, const sal_Char* pFStr, ... ) { va_list pList; @@ -1633,8 +1561,6 @@ void DbgOutTypef( sal_uInt16 nDbgOut, const sal_Char* pFStr, ... ) DbgOut( aBuf, nDbgOut ); } -// ----------------------------------------------------------------------- - void DbgOutf( const sal_Char* pFStr, ... ) { va_list pList; @@ -1647,8 +1573,6 @@ void DbgOutf( const sal_Char* pFStr, ... ) DbgOut( aBuf ); } -// ======================================================================= - #else void* DbgFunc( sal_uInt16, void* ) { return NULL; } |