summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-13 12:54:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-17 08:09:50 +0100
commit7f055f373bf2a19f6f2c73914eaa4f3c6fa57f98 (patch)
treeee2bc19bc3f580ee48f12fbca2f55cefa48e0720 /basic
parente4969b2b63bff3f1dba2c46848107f4ab9c0fa3a (diff)
inline SbxMAXSALUINT64 and friends
which don't offer any value Change-Id: Ie8082abc80ffd0e7719f4fa9a0d5f93203628ee5 Reviewed-on: https://gerrit.libreoffice.org/44798 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/sbx/sbxcurr.cxx12
-rw-r--r--basic/source/sbx/sbxint.cxx30
2 files changed, 21 insertions, 21 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;
}