summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/dbpilots/groupboxwiz.cxx5
-rw-r--r--extensions/source/scanner/sane.cxx4
-rw-r--r--extensions/source/scanner/scanunx.cxx9
3 files changed, 11 insertions, 7 deletions
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 97bf0273da38..4e723e1685e3 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -24,6 +24,7 @@
#include "optiongrouplayouter.hxx"
#include <helpids.h>
#include <comphelper/processfactory.hxx>
+#include <o3tl/safeint.hxx>
#include <osl/diagnose.h>
#define GBW_STATE_OPTIONLIST 0
@@ -361,12 +362,12 @@ namespace dbp
if (::vcl::WizardTypes::WizardState(-1) != m_nLastSelection)
{
// save the value for the last option
- DBG_ASSERT(static_cast<size_t>(m_nLastSelection) < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid previous selection index!");
+ DBG_ASSERT(o3tl::make_unsigned(m_nLastSelection) < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid previous selection index!");
m_aUncommittedValues[m_nLastSelection] = m_xValue->get_text();
}
m_nLastSelection = m_xOptions->get_selected_index();
- DBG_ASSERT(static_cast<size_t>(m_nLastSelection) < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid new selection index!");
+ DBG_ASSERT(o3tl::make_unsigned(m_nLastSelection) < m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid new selection index!");
m_xValue->set_text(m_aUncommittedValues[m_nLastSelection]);
}
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 67889ce00416..c58cf1e15c7c 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -20,6 +20,8 @@
#include <cstdarg>
#include <type_traits>
#include <math.h>
+
+#include <o3tl/safeint.hxx>
#include <osl/file.h>
#include <sal/log.hxx>
#include <tools/stream.hxx>
@@ -270,7 +272,7 @@ void Sane::ReloadOptions()
fprintf( stderr, "Error: sane driver returned %s while reading number of options !\n", p_strstatus( nStatus ) );
mnOptions = pOptions[ 0 ];
- if( static_cast<size_t>(pZero->size) > sizeof( SANE_Word ) )
+ if( o3tl::make_unsigned(pZero->size) > sizeof( SANE_Word ) )
fprintf( stderr, "driver returned number of options with larger size than SANE_Word!!!\n" );
mppOptions.reset(new const SANE_Option_Descriptor*[ mnOptions ]);
mppOptions[ 0 ] = pZero;
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index bd261d694c85..41c0b66dba24 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -19,6 +19,7 @@
#include "scanner.hxx"
#include "sanedlg.hxx"
+#include <o3tl/safeint.hxx>
#include <osl/thread.hxx>
#include <sal/log.hxx>
#include <tools/solar.h>
@@ -245,7 +246,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
SAL_INFO("extensions.scanner", "ScannerManager::configureScanner");
- if( scanner_context.InternalData < 0 || static_cast<sal_uLong>(scanner_context.InternalData) >= rSanes.size() )
+ if( scanner_context.InternalData < 0 || o3tl::make_unsigned(scanner_context.InternalData) >= rSanes.size() )
throw ScannerException(
"Scanner does not exist",
Reference< XScannerManager >( this ),
@@ -281,7 +282,7 @@ void ScannerManager::startScan( const ScannerContext& scanner_context,
SAL_INFO("extensions.scanner", "ScannerManager::startScan");
- if( scanner_context.InternalData < 0 || static_cast<sal_uLong>(scanner_context.InternalData) >= rSanes.size() )
+ if( scanner_context.InternalData < 0 || o3tl::make_unsigned(scanner_context.InternalData) >= rSanes.size() )
throw ScannerException(
"Scanner does not exist",
Reference< XScannerManager >( this ),
@@ -306,7 +307,7 @@ ScanError ScannerManager::getError( const ScannerContext& scanner_context )
osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
- if( scanner_context.InternalData < 0 || static_cast<sal_uLong>(scanner_context.InternalData) >= rSanes.size() )
+ if( scanner_context.InternalData < 0 || o3tl::make_unsigned(scanner_context.InternalData) >= rSanes.size() )
throw ScannerException(
"Scanner does not exist",
Reference< XScannerManager >( this ),
@@ -324,7 +325,7 @@ Reference< css::awt::XBitmap > ScannerManager::getBitmap( const ScannerContext&
osl::MutexGuard aGuard( theSaneProtector::get() );
sanevec &rSanes = theSanes::get().m_aSanes;
- if( scanner_context.InternalData < 0 || static_cast<sal_uLong>(scanner_context.InternalData) >= rSanes.size() )
+ if( scanner_context.InternalData < 0 || o3tl::make_unsigned(scanner_context.InternalData) >= rSanes.size() )
throw ScannerException(
"Scanner does not exist",
Reference< XScannerManager >( this ),