tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

Change-Id: If329cf8257684e7bd2936641b8f14ec3e9b9f733
Reviewed-on: https://gerrit.libreoffice.org/22647
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
This commit is contained in:
Rohan Kumar 2016-03-02 01:28:58 +05:30 committed by Eike Rathke
parent f336f63da9
commit f59136a2ed
8 changed files with 43 additions and 75 deletions

View File

@ -30,6 +30,10 @@ certain functionality.
@li @c sal.rtl - SAL RTL library
@li @c sal.rtl.xub - SAL RTL warnings related to possible String->OUString conversion issues.
@li @c sal.textenc - the textencoding SAL library
@li @c sal.w32
@li @c sal.test
@li @c sal.process
@li @c sal.doublelock
@section basctl

View File

@ -320,7 +320,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
static bool writeProfileImpl(osl_TFile* pFile)
{
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
unsigned int nLen=0;
#endif
@ -329,7 +329,7 @@ static bool writeProfileImpl(osl_TFile* pFile)
return false;
}
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
nLen=strlen(pFile->m_pWriteBuf);
SAL_WARN_IF(nLen != (pFile->m_nWriteBufLen - pFile->m_nWriteBufFree), "sal.osl", "nLen != (pFile->m_nWriteBufLen - pFile->m_nWriteBufFree)");
#endif

View File

@ -429,7 +429,7 @@ oslSocketResult SAL_CALL osl_psz_getDottedInetAddrOfSocketAddr (
void SAL_CALL osl_psz_getLastSocketErrorDescription (
oslSocket Socket, sal_Char* pBuffer, sal_uInt32 BufferSize);
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
static sal_uInt32 g_nSocketImpl = 0;
static sal_uInt32 g_nSocketAddr = 0;
@ -451,7 +451,7 @@ oslSocket __osl_createSocketImpl(int Socket)
pSocket->m_bIsAccepting = false;
#endif
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
g_nSocketImpl ++;
#endif
return pSocket;
@ -461,7 +461,7 @@ void __osl_destroySocketImpl(oslSocket Socket)
{
if ( Socket != nullptr)
free(Socket);
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
g_nSocketImpl --;
#endif
}
@ -469,7 +469,7 @@ void __osl_destroySocketImpl(oslSocket Socket)
static oslSocketAddr __osl_createSocketAddr()
{
oslSocketAddr pAddr = static_cast<oslSocketAddr>(rtl_allocateZeroMemory( sizeof( struct oslSocketAddrImpl )));
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
g_nSocketAddr ++;
#endif
return pAddr;
@ -509,7 +509,7 @@ static oslSocketAddr __osl_createSocketAddrFromSystem( struct sockaddr *pSystemS
static void __osl_destroySocketAddr( oslSocketAddr addr )
{
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
g_nSocketAddr --;
#endif
rtl_freeMemory( addr );

View File

@ -406,16 +406,14 @@ static sal_Bool __osl_attemptSocketDialupImpl()
/*****************************************************************************/
static sal_uInt32 g_nSocketImpl = 0;
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
static sal_uInt32 g_nSocketAddr = 0;
struct LeakWarning
{
~LeakWarning()
{
if( g_nSocketImpl )
OSL_TRACE( "sal_socket: %d socket instances leak" , g_nSocketImpl );
if( g_nSocketAddr )
OSL_TRACE( "sal_socket: %d socket address instances leak" , g_nSocketAddr );
SAL_WARN_IF( g_nSocketImpl, "sal.w32", "sal_socket: " << g_nSocketImpl << " socket instances leak" );
SAL_WARN_IF( g_nSocketAddr, "sal.w32", "sal_socket: " << g_nSocketAddr << " socket address instances leak" );
}
};
LeakWarning socketWarning;
@ -455,7 +453,7 @@ static oslSocketAddr __osl_createSocketAddr( )
{
oslSocketAddr pAddr = (oslSocketAddr) rtl_allocateZeroMemory( sizeof( struct oslSocketAddrImpl ));
pAddr->m_nRefCount = 1;
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
g_nSocketAddr ++;
#endif
return pAddr;
@ -493,7 +491,7 @@ static oslSocketAddr __osl_createSocketAddrFromSystem( struct sockaddr *pSystemS
static void __osl_destroySocketAddr( oslSocketAddr addr )
{
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
g_nSocketAddr --;
#endif
rtl_freeMemory( addr );

View File

@ -276,9 +276,9 @@ public:
string_container_t parent_env;
read_parent_environment(&parent_env);
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
for (string_container_t::const_iterator iter = parent_env.begin(), end = parent_env.end(); iter != end; ++iter)
std::cerr << "initially parent env: " << *iter << std::endl;
SAL_INFO("sal.process", "initially parent env: " << *iter);
#endif
//remove the environment variables that we have changed
@ -287,9 +287,9 @@ public:
std::remove_if(parent_env.begin(), parent_env.end(), exclude(different_env_vars)),
parent_env.end());
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
for (string_container_t::const_iterator iter = parent_env.begin(), end = parent_env.end(); iter != end; ++iter)
std::cerr << "stripped parent env: " << *iter << std::endl;
SAL_INFO("sal.process", "stripped parent env: " << *iter);
#endif
//read the child environment and exclude the variables that
@ -297,9 +297,9 @@ public:
string_container_t child_env;
read_child_environment(&child_env);
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
for (string_container_t::const_iterator iter = child_env.begin(), end = child_env.end(); iter != end; ++iter)
std::cerr << "initial child env: " << *iter << std::endl;
SAL_INFO("sal.process", "initial child env: " << *iter);
#endif
//partition the child environment into the variables that
//are different to the parent environment (they come first)
@ -311,22 +311,22 @@ public:
string_container_t different_child_env_vars(child_env.begin(), iter_logical_end);
child_env.erase(child_env.begin(), iter_logical_end);
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
for (string_container_t::const_iterator iter = child_env.begin(), end = child_env.end(); iter != end; ++iter)
std::cerr << "stripped child env: " << *iter << std::endl;
SAL_INFO("sal.process", "stripped child env: " << *iter);
#endif
bool common_env_size_equals = (parent_env.size() == child_env.size());
bool common_env_content_equals = std::equal(child_env.begin(), child_env.end(), parent_env.begin());
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
for (string_container_t::const_iterator iter = different_env_vars.begin(), end = different_env_vars.end(); iter != end; ++iter)
std::cerr << "different should be: " << *iter << std::endl;
SAL_INFO("sal.process", "different should be: " << *iter);
#endif
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL > 0
for (string_container_t::const_iterator iter = different_child_env_vars.begin(), end = different_child_env_vars.end(); iter != end; ++iter)
std::cerr << "different are: " << *iter << std::endl;
SAL_INFO("sal.process", "different are: " << *iter);
#endif
bool different_env_size_equals = (different_child_env_vars.size() == different_env_vars.size());

View File

@ -190,23 +190,16 @@ namespace rtl_DoubleLocking
sal_Int32 nValueOK2 = 0;
nValueOK2 = p2Thread->getOK();
#if OSL_DEBUG_LEVEL > 2
printf("Value in Thread #1 is %" SAL_PRIdINT32 "\n", nValueOK);
printf("Value in Thread #2 is %" SAL_PRIdINT32 "\n", nValueOK2);
#else
(void)nValueOK2;
#endif
SAL_INFO("sal.doublelock", "Value in Thread #1 is " << nValueOK);
SAL_INFO("sal.doublelock", "Value in Thread #2 is " << nValueOK2);
sal_Int32 nValueFails = 0;
nValueFails = pThread->getFails();
sal_Int32 nValueFails2 = 0;
nValueFails2 = p2Thread->getFails();
#if OSL_DEBUG_LEVEL > 2
printf("Fails in Thread #1 is %" SAL_PRIdINT32 "\n", nValueFails);
printf("Fails in Thread #2 is %" SAL_PRIdINT32 "\n", nValueFails2);
#endif
SAL_INFO("sal.doublelock", "Fails in Thread #1 is " << nValueFails);
SAL_INFO("sal.doublelock", "Fails in Thead #2 is " << nValueFails2);
delete pThread;
delete p2Thread;

View File

@ -348,12 +348,7 @@ Bootstrap_Impl::Bootstrap_Impl( OUString const & rIniName )
rtl_bootstrap_args_open( base_ini.pData ) );
}
}
#if OSL_DEBUG_LEVEL > 1
OString sFile = OUStringToOString(_iniName, RTL_TEXTENCODING_ASCII_US);
OSL_TRACE("Bootstrap_Impl(): sFile=%s", sFile.getStr());
#endif /* OSL_DEBUG_LEVEL > 1 */
SAL_INFO("sal.rtl", "Bootstrap_Impl(): sFile=" << _iniName);
oslFileHandle handle;
if (!_iniName.isEmpty() &&
osl_File_E_None == osl_openFile(_iniName.pData, &handle, osl_File_OpenFlag_Read))
@ -372,26 +367,17 @@ Bootstrap_Impl::Bootstrap_Impl( OUString const & rIniName )
nameValue.sValue = OStringToOUString(
line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
#if OSL_DEBUG_LEVEL > 1
OString name_tmp = OUStringToOString(nameValue.sName, RTL_TEXTENCODING_ASCII_US);
OString value_tmp = OUStringToOString(nameValue.sValue, RTL_TEXTENCODING_UTF8);
OSL_TRACE(
"pushing: name=%s value=%s",
name_tmp.getStr(), value_tmp.getStr() );
#endif /* OSL_DEBUG_LEVEL > 1 */
SAL_INFO("sal.rtl", "pushing: name=" << nameValue.sName << " value= " << nameValue.sValue);
_nameValueList.push_back(nameValue);
}
}
osl_closeFile(handle);
}
#if OSL_DEBUG_LEVEL > 1
else
{
OString file_tmp = OUStringToOString(_iniName, RTL_TEXTENCODING_ASCII_US);
OSL_TRACE( "couldn't open file: %s", file_tmp.getStr() );
SAL_WARN( "sal.rtl", "couldn't open file: " << _iniName );
}
#endif /* OSL_DEBUG_LEVEL > 1 */
}
Bootstrap_Impl::~Bootstrap_Impl()
@ -693,10 +679,8 @@ void SAL_CALL rtl_bootstrap_args_close (
{
::std::size_t nLeaking = 8; // only hold up to 8 files statically
#if OSL_DEBUG_LEVEL == 1 // nonpro
#if OSL_DEBUG_LEVEL > 0 // debug
nLeaking = 0;
#elif OSL_DEBUG_LEVEL > 1 // debug
nLeaking = 1;
#endif /* OSL_DEBUG_LEVEL */
if (p_bootstrap_map->size() > nLeaking)
@ -792,13 +776,7 @@ void SAL_CALL rtl_bootstrap_set (
}
}
#if OSL_DEBUG_LEVEL > 1
OString cstr_name( OUStringToOString( name, RTL_TEXTENCODING_ASCII_US ) );
OString cstr_value( OUStringToOString( value, RTL_TEXTENCODING_ASCII_US ) );
OSL_TRACE(
"bootstrap.cxx: explicitly setting: name=%s value=%s\n",
cstr_name.getStr(), cstr_value.getStr() );
#endif /* OSL_DEBUG_LEVEL > 1 */
SAL_INFO("sal.rtl", "explicitly getting: name=" << name << " value= " <<value);
r_rtl_bootstrap_set_list.push_back( rtl_bootstrap_NameValue( name, value ) );
}

View File

@ -32,16 +32,17 @@ int main( int argc, char *argv[] )
sal_Int32 nCount = rtl_getAppCommandArgCount();
#if OSL_DEBUG_LEVEL > 1
fprintf( stdout, "rtl-commandargs (%d) real args:%i ", nCount, argc);
#if OSL_DEBUG_LEVEL > 0
OUStringBuffer debugBuff;
debugBuff.append("rtl-commandargs (").append(nCount).append(")real args: ").append(argc);
for( sal_Int32 i = 0 ; i < nCount ; i ++ )
{
OUString data;
rtl_getAppCommandArg( i , &(data.pData) );
OString o = OUStringToOString( data, RTL_TEXTENCODING_ASCII_US );
fprintf( stdout, " %s", o.getStr() );
debugBuff.append(" ").append(o);
}
fprintf( stdout, "\n" );
SAL_INFO("sal.test", debugBuff.toString());
#endif
if( nCount == 0 )
@ -53,13 +54,7 @@ int main( int argc, char *argv[] )
OUString iniName;
Bootstrap::get(OUString("iniName"), iniName, OUString());
#if OSL_DEBUG_LEVEL > 1
if(iniName.getLength())
{
OString tmp_iniName = OUStringToOString(iniName, RTL_TEXTENCODING_ASCII_US);
fprintf(stderr, "using ini: %s\n", tmp_iniName.getStr());
}
#endif
SAL_INFO_IF(!iniName.isEmpty(), "sal.test", "using ini: " << iniName);
Bootstrap bootstrap(iniName);