From f996a5a153e1b7ff81d9343eedee244e585ecab9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 7 Nov 2016 08:03:01 +0100 Subject: basic: fix Android build rtl::math::round() is fine here, I guess. Change-Id: I4d92bc191182ff531e11d20ef87c69dc99da2b32 --- basic/source/sbx/sbxbyte.cxx | 6 +++--- basic/source/sbx/sbxchar.cxx | 8 ++++---- basic/source/sbx/sbxconv.hxx | 13 ------------- basic/source/sbx/sbxint.cxx | 14 +++++++------- basic/source/sbx/sbxlng.cxx | 8 ++++---- 5 files changed, 18 insertions(+), 31 deletions(-) (limited to 'basic') diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx index 562979b4c37e..9d52eebec395 100644 --- a/basic/source/sbx/sbxbyte.cxx +++ b/basic/source/sbx/sbxbyte.cxx @@ -21,7 +21,7 @@ #include #include "sbxconv.hxx" -#include +#include sal_uInt8 ImpGetByte( const SbxValues* p ) { @@ -123,7 +123,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt8) std::lround( p->nSingle ); + nRes = (sal_uInt8) rtl::math::round( p->nSingle ); break; case SbxDATE: case SbxDOUBLE: @@ -149,7 +149,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt8) std::lround( dVal ); + nRes = (sal_uInt8) rtl::math::round( dVal ); break; } case SbxBYREF | SbxSTRING: diff --git a/basic/source/sbx/sbxchar.cxx b/basic/source/sbx/sbxchar.cxx index 81d195c188e1..478a9d556adf 100644 --- a/basic/source/sbx/sbxchar.cxx +++ b/basic/source/sbx/sbxchar.cxx @@ -21,7 +21,7 @@ #include #include "sbxconv.hxx" -#include +#include sal_Unicode ImpGetChar( const SbxValues* p ) { @@ -111,7 +111,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR; } else - nRes = (sal_Unicode) std::lround( p->nSingle ); + nRes = (sal_Unicode) rtl::math::round( p->nSingle ); break; case SbxDATE: case SbxDOUBLE: @@ -137,7 +137,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR; } else - nRes = (sal_uInt8) std::lround( dVal ); + nRes = (sal_uInt8) rtl::math::round( dVal ); break; } case SbxBYREF | SbxSTRING: @@ -158,7 +158,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINCHAR; } else - nRes = (sal_Unicode) std::lround( d ); + nRes = (sal_Unicode) rtl::math::round( d ); } break; case SbxOBJECT: diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx index 34a9ba324b93..08fa296f2c8f 100644 --- a/basic/source/sbx/sbxconv.hxx +++ b/basic/source/sbx/sbxconv.hxx @@ -21,19 +21,6 @@ #define INCLUDED_BASIC_SOURCE_SBX_SBXCONV_HXX #include "sbxdec.hxx" -#if defined(ANDROID) -namespace std -{ -double lround(double d) -{ - return d + ( d < 0 ? -0.5 : 0.5 ); -} -double llround(double d) -{ - return d + ( d < 0 ? -0.5 : 0.5 ); -} -} -#endif class SbxArray; diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index b3d4cd30433b..41886a68e648 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -21,7 +21,7 @@ #include #include "sbxconv.hxx" -#include +#include sal_Int16 ImpGetInteger( const SbxValues* p ) { @@ -81,7 +81,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT; } else - nRes = (sal_Int16) std::lround( p->nSingle ); + nRes = (sal_Int16) rtl::math::round( p->nSingle ); break; case SbxCURRENCY: { @@ -142,7 +142,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT; } else - nRes = (sal_Int16) std::lround( dVal ); + nRes = (sal_Int16) rtl::math::round( dVal ); break; } case SbxLPSTR: @@ -165,7 +165,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMININT; } else - nRes = (sal_Int16) std::lround( d ); + nRes = (sal_Int16) rtl::math::round( d ); } break; case SbxOBJECT: @@ -347,7 +347,7 @@ sal_Int64 ImpDoubleToSalInt64( double d ) SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINSALINT64; } else - nRes = (sal_Int64) std::llround( d ); + nRes = (sal_Int64) rtl::math::round( d ); return nRes; } @@ -363,7 +363,7 @@ sal_uInt64 ImpDoubleToSalUInt64( double d ) SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt64) std::llround( d ); + nRes = (sal_uInt64) rtl::math::round( d ); return nRes; } @@ -713,7 +713,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = 0; } else - nRes = (sal_uInt64) std::llround( d ); + nRes = (sal_uInt64) rtl::math::round( d ); } else if( n64 < 0 ) { diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx index a5fcbadbad71..73f503d3f98e 100644 --- a/basic/source/sbx/sbxlng.cxx +++ b/basic/source/sbx/sbxlng.cxx @@ -21,7 +21,7 @@ #include #include "sbxconv.hxx" -#include +#include sal_Int32 ImpGetLong( const SbxValues* p ) { @@ -65,7 +65,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (sal_Int32) std::lround( p->nSingle ); + nRes = (sal_Int32) rtl::math::round( p->nSingle ); break; case SbxSALINT64: nRes = p->nInt64; @@ -106,7 +106,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (sal_Int32) std::lround( dVal ); + nRes = (sal_Int32) rtl::math::round( dVal ); break; } case SbxBYREF | SbxSTRING: @@ -129,7 +129,7 @@ start: SbxBase::SetError( ERRCODE_SBX_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (sal_Int32) std::lround( d ); + nRes = (sal_Int32) rtl::math::round( d ); } break; case SbxOBJECT: -- cgit