Kaydet (Commit) 35d7ca80 authored tarafından Rohan Kumar's avatar Rohan Kumar Kaydeden (comit) Björn Michaelsen

tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals

I removed OSL_DEBUG_LEVEL > 1 conditionals by SAL_INFO(..)s
or OSL_DEBUG_LEVEL > 0 and made sure that it doesn't break the
build

Change-Id: I3eccdd769ff32e57e12209706e5fbbdd9638de54
Reviewed-on: https://gerrit.libreoffice.org/23068Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst 77ba9d7e
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <sal/macros.h> #include <sal/macros.h>
#include <memory> #include <memory>
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL #if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
#include <stdarg.h> #include <stdarg.h>
#define dump_state( a, b, c, d ) fprintf( stderr, a, b, c, d ); #define dump_state( a, b, c, d ) fprintf( stderr, a, b, c, d );
#else #else
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#endif #endif
inline void dbg_msg( const char* pString, ... ) inline void dbg_msg( const char* pString, ... )
{ {
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL #if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
va_list ap; va_list ap;
va_start( ap, pString ); va_start( ap, pString );
vfprintf( stderr, pString, ap ); vfprintf( stderr, pString, ap );
...@@ -125,7 +125,7 @@ SANE_Status Sane::ControlOption( int nOption, SANE_Action nAction, ...@@ -125,7 +125,7 @@ SANE_Status Sane::ControlOption( int nOption, SANE_Action nAction,
SANE_Status nStatus = p_control_option( maHandle, (SANE_Int)nOption, SANE_Status nStatus = p_control_option( maHandle, (SANE_Int)nOption,
nAction, pData, &nInfo ); nAction, pData, &nInfo );
DUMP_STATE( nStatus, "sane_control_option" ); DUMP_STATE( nStatus, "sane_control_option" );
#if OSL_DEBUG_LEVEL > 1 #if OSL_DEBUG_LEVEL > 0
if( nStatus != SANE_STATUS_GOOD ) if( nStatus != SANE_STATUS_GOOD )
{ {
const char* pAction = "Unknown"; const char* pAction = "Unknown";
...@@ -232,7 +232,7 @@ void Sane::Init() ...@@ -232,7 +232,7 @@ void Sane::Init()
for( nDevices = 0 ; ppDevices[ nDevices ]; nDevices++ ) ; for( nDevices = 0 ; ppDevices[ nDevices ]; nDevices++ ) ;
} }
} }
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL #if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
else else
fprintf( stderr, "libsane%s could not be opened: %s\n", SAL_DLLEXTENSION, fprintf( stderr, "libsane%s could not be opened: %s\n", SAL_DLLEXTENSION,
dlerror() ); dlerror() );
...@@ -618,7 +618,7 @@ bool Sane::Start( BitmapTransporter& rBitmap ) ...@@ -618,7 +618,7 @@ bool Sane::Start( BitmapTransporter& rBitmap )
bSuccess = false; bSuccess = false;
break; break;
} }
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL #if (OSL_DEBUG_LEVEL > 0) || defined DBG_UTIL
const char* ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB", const char* ppFormats[] = { "SANE_FRAME_GRAY", "SANE_FRAME_RGB",
"SANE_FRAME_RED", "SANE_FRAME_GREEN", "SANE_FRAME_RED", "SANE_FRAME_GREEN",
"SANE_FRAME_BLUE", "Unknown !!!" }; "SANE_FRAME_BLUE", "Unknown !!!" };
...@@ -735,9 +735,8 @@ bool Sane::Start( BitmapTransporter& rBitmap ) ...@@ -735,9 +735,8 @@ bool Sane::Start( BitmapTransporter& rBitmap )
nWidthMM = (int)(((double)nWidth / fResl) * 25.4); nWidthMM = (int)(((double)nWidth / fResl) * 25.4);
if( ! nHeightMM ) if( ! nHeightMM )
nHeightMM = (int)(((double)nHeight / fResl) * 25.4); nHeightMM = (int)(((double)nHeight / fResl) * 25.4);
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "set dimensions to(" << nWidth << ", " << nHeight << ") Pixel, (" << nWidthMM << ", " << nHeightMM <<
fprintf( stderr, "set dimensions to (%d, %d) Pixel, (%d, %d) mm, resolution is %lg\n", (int)nWidth, (int)nHeight, (int)nWidthMM, (int)nHeightMM, fResl ); ") mm, resolution is " << fResl);
#endif
aConverter.Seek( 18 ); aConverter.Seek( 18 );
aConverter.WriteUInt32( nWidth ); aConverter.WriteUInt32( nWidth );
......
...@@ -905,10 +905,8 @@ void SaneDlg::AcquirePreview() ...@@ -905,10 +905,8 @@ void SaneDlg::AcquirePreview()
} }
else else
{ {
#if OSL_DEBUG_LEVEL > 1
xTransporter->getStream().Seek( STREAM_SEEK_TO_END ); xTransporter->getStream().Seek( STREAM_SEEK_TO_END );
fprintf( stderr, "Previewbitmapstream contains %d bytes\n", (int)xTransporter->getStream().Tell() ); SAL_INFO("extensions.scanner", "Previewbitmapstream contains " << xTransporter->getStream().Tell() << "bytes");
#endif
xTransporter->getStream().Seek( STREAM_SEEK_TO_BEGIN ); xTransporter->getStream().Seek( STREAM_SEEK_TO_BEGIN );
mpPreview->SetBitmap(xTransporter->getStream()); mpPreview->SetBitmap(xTransporter->getStream());
} }
...@@ -1492,10 +1490,7 @@ bool SaneDlg::SetAdjustedNumericalValue( ...@@ -1492,10 +1490,7 @@ bool SaneDlg::SetAdjustedNumericalValue(
return false; return false;
} }
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "SaneDlg::SetAdjustedNumericalValue(\"" << pOption << "\", " << fValue << ") ");
fprintf( stderr, "SaneDlg::SetAdjustedNumericalValue( \"%s\", %lg ) ",
pOption, fValue );
#endif
if( nValues ) if( nValues )
{ {
...@@ -1520,9 +1515,7 @@ bool SaneDlg::SetAdjustedNumericalValue( ...@@ -1520,9 +1515,7 @@ bool SaneDlg::SetAdjustedNumericalValue(
} }
delete [] pValues; delete [] pValues;
mrSane.SetOptionValue( nOption, fValue, nElement ); mrSane.SetOptionValue( nOption, fValue, nElement );
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "yields " << fValue);
fprintf( stderr, "yields %lg\n", fValue );
#endif
return true; return true;
......
...@@ -23,23 +23,16 @@ ...@@ -23,23 +23,16 @@
#include <cppuhelper/queryinterface.hxx> #include <cppuhelper/queryinterface.hxx>
#include <memory> #include <memory>
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
BitmapTransporter::BitmapTransporter() BitmapTransporter::BitmapTransporter()
{ {
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "BitmapTransporter");
fprintf( stderr, "BitmapTransporter\n" );
#endif
} }
BitmapTransporter::~BitmapTransporter() BitmapTransporter::~BitmapTransporter()
{ {
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "~BitmapTransporter");
fprintf( stderr, "~BitmapTransporter\n" );
#endif
} }
...@@ -152,17 +145,13 @@ ScannerThread::ScannerThread( ...@@ -152,17 +145,13 @@ ScannerThread::ScannerThread(
ScannerManager* pManager ) ScannerManager* pManager )
: m_pHolder( pHolder ), m_xListener( listener ), m_pManager( pManager ) : m_pHolder( pHolder ), m_xListener( listener ), m_pManager( pManager )
{ {
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "ScannerThread");
fprintf( stderr, "ScannerThread\n" );
#endif
} }
ScannerThread::~ScannerThread() ScannerThread::~ScannerThread()
{ {
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "~ScannerThread");
fprintf( stderr, "~ScannerThread\n" );
#endif
} }
...@@ -259,9 +248,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex ...@@ -259,9 +248,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
osl::MutexGuard aGuard( theSaneProtector::get() ); osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes; sanevec &rSanes = theSanes::get().m_aSanes;
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "ScannerManager::configureScanner");
fprintf( stderr, "ScannerManager::configureScanner\n" );
#endif
if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
throw ScannerException( throw ScannerException(
...@@ -297,9 +284,7 @@ void ScannerManager::startScan( const ScannerContext& scanner_context, ...@@ -297,9 +284,7 @@ void ScannerManager::startScan( const ScannerContext& scanner_context,
osl::MutexGuard aGuard( theSaneProtector::get() ); osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes; sanevec &rSanes = theSanes::get().m_aSanes;
#if OSL_DEBUG_LEVEL > 1 SAL_INFO("extensions.scanner", "ScannerManager::startScan");
fprintf( stderr, "ScannerManager::startScan\n" );
#endif
if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() ) if( scanner_context.InternalData < 0 || (sal_uLong)scanner_context.InternalData >= rSanes.size() )
throw ScannerException( throw ScannerException(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment