Kaydet (Commit) b57951a6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

No need for a template here

Change-Id: I43262c984c311fcb1e1a9eca9b4dec4092351dea
üst 30be686d
......@@ -982,14 +982,30 @@ namespace {
else
return n;
}
}
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( toInt32 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( toInt )<sal_Int32>(pStr, nRadix);
}
template <typename T> static inline T IMPL_RTL_STRNAME( toUInt )( const IMPL_RTL_STRCODE* pStr,
sal_Int64 SAL_CALL IMPL_RTL_STRNAME( toInt64 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
{
BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( toInt )<sal_Int64>(pStr, nRadix);
}
/* ----------------------------------------------------------------------- */
sal_uInt64 SAL_CALL IMPL_RTL_STRNAME( toUInt64 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
SAL_THROW_EXTERN_C()
{
sal_Int16 nDigit;
T n = 0;
sal_uInt64 n = 0;
if ( (nRadix < RTL_STR_MIN_RADIX) || (nRadix > RTL_STR_MAX_RADIX) )
nRadix = 10;
......@@ -1002,8 +1018,8 @@ namespace {
if ( *pStr == '+' )
++pStr;
const T nDiv = std::numeric_limits<T>::max()/nRadix;
const sal_Int16 nMod = std::numeric_limits<T>::max()%nRadix;
const sal_uInt64 nDiv = SAL_MAX_UINT64/nRadix;
const sal_Int16 nMod = SAL_MAX_UINT64%nRadix;
while ( *pStr )
{
nDigit = rtl_ImplGetDigit( IMPL_RTL_USTRCODE( *pStr ), nRadix );
......@@ -1019,30 +1035,6 @@ namespace {
}
return n;
}
}
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( toInt32 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( toInt )<sal_Int32>(pStr, nRadix);
}
sal_Int64 SAL_CALL IMPL_RTL_STRNAME( toInt64 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( toInt )<sal_Int64>(pStr, nRadix);
}
/* ----------------------------------------------------------------------- */
sal_uInt64 SAL_CALL IMPL_RTL_STRNAME( toUInt64 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( toUInt )<sal_uInt64>(pStr, nRadix);
}
/* ======================================================================= */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment