diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-03-19 22:43:30 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-03-19 22:43:30 +0100 |
commit | 52faa80a81a69ef2c1aca72653e688c6616d395f (patch) | |
tree | bb23566c07bcdf6293dfe00900ed679d76cd9fd6 /extensions/source/scanner | |
parent | 54fb699f0fae7c9f49d23a1b3f36bb12a3178503 (diff) |
remove fiddly casts, add few const where appropriate
Diffstat (limited to 'extensions/source/scanner')
-rw-r--r-- | extensions/source/scanner/sane.cxx | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index a26ff3caf0e5..aaefbf4837b8 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -277,8 +277,7 @@ void Sane::ReloadOptions() if( ! IsOpen() ) return; - SANE_Option_Descriptor* pZero = (SANE_Option_Descriptor*) - p_get_option_descriptor( maHandle, 0 ); + const SANE_Option_Descriptor* pZero = p_get_option_descriptor( maHandle, 0 ); SANE_Word pOptions[2]; SANE_Status nStatus = p_control_option( maHandle, 0, SANE_ACTION_GET_VALUE, (void*)pOptions, NULL ); @@ -290,8 +289,8 @@ void Sane::ReloadOptions() fprintf( stderr, "driver returned numer of options with larger size tha SANE_Word !!!\n" ); if( mppOptions ) delete [] mppOptions; - mppOptions = (const SANE_Option_Descriptor**)new SANE_Option_Descriptor*[ mnOptions ]; - mppOptions[ 0 ] = (SANE_Option_Descriptor*)pZero; + mppOptions = new const SANE_Option_Descriptor*[ mnOptions ]; + mppOptions[ 0 ] = pZero; for( int i = 1; i < mnOptions; i++ ) mppOptions[ i ] = (SANE_Option_Descriptor*) p_get_option_descriptor( maHandle, i ); @@ -535,14 +534,14 @@ static inline sal_uInt8 _ReadValue( FILE* fp, int depth ) sal_Bool Sane::CheckConsistency( const char* pMes, sal_Bool bInit ) { - static SANE_Option_Descriptor** pDescArray = NULL; - static SANE_Option_Descriptor* pZero = NULL; + static const SANE_Option_Descriptor** pDescArray = NULL; + static const SANE_Option_Descriptor* pZero = NULL; if( bInit ) { - pDescArray = (SANE_Option_Descriptor**)mppOptions; + pDescArray = mppOptions; if( mppOptions ) - pZero = (SANE_Option_Descriptor*)mppOptions[0]; + pZero = mppOptions[0]; return sal_True; } |