summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/sbx/sbxcurr.cxx12
-rw-r--r--basic/source/sbx/sbxint.cxx30
-rw-r--r--include/basic/sbxdef.hxx6
3 files changed, 22 insertions, 26 deletions
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index ed1d1db2c546..06a71227bf94 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -204,9 +204,9 @@ start:
// is unreachable, obviously. Avoid warning by ifdeffing
// this out for now. Do not delete this #if 0 block unless
// you know for sure the 'break' above is intentional.
- if ( nRes > SbxMAXSALINT64 )
+ if ( nRes > SAL_MAX_INT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMAXSALINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MAX_INT64;
}
#endif
}
@@ -214,13 +214,13 @@ start:
nRes = p->nInt64 * CURRENCY_FACTOR; break;
#if 0
// As above
- if ( nRes > SbxMAXSALINT64 )
+ if ( nRes > SAL_MAX_INT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMAXSALINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MAX_INT64;
}
- else if ( nRes < SbxMINSALINT64 )
+ else if ( nRes < SAL_MIN_INT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMINSALINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MIN_INT64;
}
break;
#endif
diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index e3230259f205..97357b6ed6bc 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -339,13 +339,13 @@ start:
sal_Int64 ImpDoubleToSalInt64( double d )
{
sal_Int64 nRes;
- if( d > SbxMAXSALINT64 )
+ if( d > SAL_MAX_INT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMAXSALINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MAX_INT64;
}
- else if( d < SbxMINSALINT64 )
+ else if( d < SAL_MIN_INT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMINSALINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MIN_INT64;
}
else
nRes = (sal_Int64) rtl::math::round( d );
@@ -355,9 +355,9 @@ sal_Int64 ImpDoubleToSalInt64( double d )
sal_uInt64 ImpDoubleToSalUInt64( double d )
{
sal_uInt64 nRes;
- if( d > SbxMAXSALUINT64 )
+ if( d > SAL_MAX_UINT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMAXSALUINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MAX_UINT64;
}
else if( d < 0.0 )
{
@@ -372,7 +372,7 @@ sal_uInt64 ImpDoubleToSalUInt64( double d )
double ImpSalUInt64ToDouble( sal_uInt64 n )
{
double d = 0.0;
- if( n > SbxMAXSALINT64 )
+ if( n > SAL_MAX_INT64 )
SbxBase::SetError( ERRCODE_BASIC_CONVERSION );
else
d = (double)(sal_Int64) n;
@@ -418,9 +418,9 @@ start:
case SbxSALINT64:
nRes = p->nInt64; break;
case SbxSALUINT64:
- if( p->uInt64 > SbxMAXSALINT64 )
+ if( p->uInt64 > SAL_MAX_INT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMAXSALINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MAX_INT64;
}
else
nRes = (sal_Int64) p->uInt64;
@@ -705,9 +705,9 @@ start:
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr, false ) != ERRCODE_NONE )
nRes = 0;
- else if( d > SbxMAXSALUINT64 )
+ else if( d > SAL_MAX_UINT64 )
{
- SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SbxMAXSALUINT64;
+ SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); nRes = SAL_MAX_UINT64;
}
else if( d < 0.0 )
{
@@ -818,7 +818,7 @@ start:
case SbxLPSTR:
if( !p->pOUString )
p->pOUString = new OUString;
- if( n > SbxMAXSALINT64 )
+ if( n > SAL_MAX_INT64 )
SbxBase::SetError( ERRCODE_BASIC_CONVERSION );
else
{
@@ -881,16 +881,16 @@ start:
*p->pDouble = ImpSalUInt64ToDouble( n ); break;
case SbxBYREF | SbxCURRENCY:
- if ( n > ( SbxMAXSALINT64 / CURRENCY_FACTOR ) )
+ if ( n > ( SAL_MAX_INT64 / CURRENCY_FACTOR ) )
{
SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW );
- n = SbxMAXSALINT64;
+ n = SAL_MAX_INT64;
}
*p->pnInt64 = ( sal_Int64) ( n * CURRENCY_FACTOR ); break;
case SbxBYREF | SbxSALUINT64:
*p->puInt64 = n; break;
case SbxBYREF | SbxSALINT64:
- if( n > SbxMAXSALINT64 )
+ if( n > SAL_MAX_INT64 )
{
SbxBase::SetError( ERRCODE_BASIC_MATH_OVERFLOW ); n = 0;
}
diff --git a/include/basic/sbxdef.hxx b/include/basic/sbxdef.hxx
index f015b963c621..74ae183f50ed 100644
--- a/include/basic/sbxdef.hxx
+++ b/include/basic/sbxdef.hxx
@@ -176,7 +176,7 @@ namespace o3tl
// of the implementation. Only type double is greedy and takes
// what it gets.
-#define SbxMAXCHAR u'\xFFFF'
+#define SbxMAXCHAR (u'\xFFFF')
#define SbxMINCHAR (0)
#define SbxMAXBYTE ( 255)
#define SbxMAXINT ( 32767)
@@ -186,10 +186,6 @@ namespace o3tl
#define SbxMINLNG ((sal_Int32)(-2147483647-1))
#define SbxMAXULNG ((sal_uInt32) 0xffffffff)
-#define SbxMAXSALUINT64 SAL_MAX_UINT64
-#define SbxMAXSALINT64 SAL_MAX_INT64
-#define SbxMINSALINT64 SAL_MIN_INT64
-
// Currency stored as SbxSALINT64 == sal_Int64
// value range limits are ~(2^63 - 1)/10000
// fixed precision has 4 digits right of decimal pt