summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-10-31 22:32:07 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-01 17:10:15 +0100
commit54760dfdc26fcded5c62bbad05429db5c9cee935 (patch)
tree0275b5bc9aa8a95af0581ed4be8d6349c58aa754
parente2c60649102a9840eff36b35813906d7cbb95d4b (diff)
Moved sal/rtl/source string files from C to C++, for easier maintenance.
-rw-r--r--sal/rtl/source/hash.cxx4
-rw-r--r--sal/rtl/source/hash.hxx (renamed from sal/rtl/source/hash.h)14
-rw-r--r--sal/rtl/source/strbuf.cxx (renamed from sal/rtl/source/strbuf.c)0
-rw-r--r--sal/rtl/source/strimp.cxx (renamed from sal/rtl/source/strimp.c)2
-rw-r--r--sal/rtl/source/strimp.hxx (renamed from sal/rtl/source/strimp.h)14
-rw-r--r--sal/rtl/source/string.cxx (renamed from sal/rtl/source/string.c)14
-rw-r--r--sal/rtl/source/strtmpl.cxx (renamed from sal/rtl/source/strtmpl.c)52
-rw-r--r--sal/rtl/source/surrogates.hxx (renamed from sal/rtl/source/surrogates.h)4
-rw-r--r--sal/rtl/source/uri.cxx2
-rw-r--r--sal/rtl/source/ustrbuf.cxx (renamed from sal/rtl/source/ustrbuf.c)1
-rw-r--r--sal/rtl/source/ustring.cxx (renamed from sal/rtl/source/ustring.c)48
11 files changed, 104 insertions, 51 deletions
diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx
index 4e03dfc2a6d7..8ddf2683ad53 100644
--- a/sal/rtl/source/hash.cxx
+++ b/sal/rtl/source/hash.cxx
@@ -29,8 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sal.hxx"
-#include "hash.h"
-#include "strimp.h"
+#include "hash.hxx"
+#include "strimp.hxx"
#include <osl/diagnose.h>
#include <sal/macros.h>
diff --git a/sal/rtl/source/hash.h b/sal/rtl/source/hash.hxx
index 6a6518833dfd..d103efcd64e7 100644
--- a/sal/rtl/source/hash.h
+++ b/sal/rtl/source/hash.hxx
@@ -1,24 +1,16 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-#ifndef INCLUDED_RTL_SOURCE_HASH_H
-#define INCLUDED_RTL_SOURCE_HASH_H
+#ifndef INCLUDED_RTL_SOURCE_HASH_HXX
+#define INCLUDED_RTL_SOURCE_HASH_HXX
#include <sal/types.h>
#include <rtl/ustring.h>
-#if defined __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
/* These functions are not multi-thread safe: */
rtl_uString *rtl_str_hash_intern (rtl_uString *pString,
int can_return);
void rtl_str_hash_remove (rtl_uString *pString);
-#if defined __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* INCLUDED_RTL_SOURCE_HASH_H */
+#endif /* INCLUDED_RTL_SOURCE_HASH_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/source/strbuf.c b/sal/rtl/source/strbuf.cxx
index c9a4f3140643..c9a4f3140643 100644
--- a/sal/rtl/source/strbuf.c
+++ b/sal/rtl/source/strbuf.cxx
diff --git a/sal/rtl/source/strimp.c b/sal/rtl/source/strimp.cxx
index ae75249fb4aa..a5b8f827a1b8 100644
--- a/sal/rtl/source/strimp.c
+++ b/sal/rtl/source/strimp.cxx
@@ -26,7 +26,7 @@
*
************************************************************************/
-#include "strimp.h"
+#include "strimp.hxx"
sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix )
{
diff --git a/sal/rtl/source/strimp.h b/sal/rtl/source/strimp.hxx
index 3db89cec8145..a9e5a38f6da7 100644
--- a/sal/rtl/source/strimp.h
+++ b/sal/rtl/source/strimp.hxx
@@ -26,8 +26,8 @@
*
************************************************************************/
-#ifndef INCLUDED_RTL_SOURCE_STRIMP_H
-#define INCLUDED_RTL_SOURCE_STRIMP_H
+#ifndef INCLUDED_RTL_SOURCE_STRIMP_HXX
+#define INCLUDED_RTL_SOURCE_STRIMP_HXX
#include <osl/interlck.h>
@@ -37,10 +37,6 @@
/* Help functions for String and UString */
/* ======================================================================= */
-#if defined __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
/*
* refCount is opaqueincludes 2 bit-fields;
* MSB: 'interned' - is stored in the intern hash
@@ -58,10 +54,6 @@ sal_Int16 rtl_ImplGetDigit( sal_Unicode ch, sal_Int16 nRadix );
sal_Bool rtl_ImplIsWhitespace( sal_Unicode c );
-#if defined __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* INCLUDED_RTL_SOURCE_STRIMP_H */
+#endif /* INCLUDED_RTL_SOURCE_STRIMP_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/rtl/source/string.c b/sal/rtl/source/string.cxx
index 2ee79611218a..c43b564a2099 100644
--- a/sal/rtl/source/string.c
+++ b/sal/rtl/source/string.cxx
@@ -35,8 +35,8 @@
#include <osl/diagnose.h>
#include <rtl/tencinfo.h>
-#include "strimp.h"
-#include "surrogates.h"
+#include "strimp.hxx"
+#include "surrogates.hxx"
#include <rtl/string.h>
#include "rtl/math.h"
@@ -69,9 +69,10 @@ static rtl_String const aImplEmpty_rtl_String =
/* Include String/UString template code */
-#include "strtmpl.c"
+#include "strtmpl.cxx"
sal_Int32 SAL_CALL rtl_str_valueOfFloat(sal_Char * pStr, float f)
+ SAL_THROW_EXTERN_C()
{
rtl_String * pResult = NULL;
sal_Int32 nLen;
@@ -87,6 +88,7 @@ sal_Int32 SAL_CALL rtl_str_valueOfFloat(sal_Char * pStr, float f)
}
sal_Int32 SAL_CALL rtl_str_valueOfDouble(sal_Char * pStr, double d)
+ SAL_THROW_EXTERN_C()
{
rtl_String * pResult = NULL;
sal_Int32 nLen;
@@ -101,13 +103,13 @@ sal_Int32 SAL_CALL rtl_str_valueOfDouble(sal_Char * pStr, double d)
return nLen;
}
-float SAL_CALL rtl_str_toFloat(sal_Char const * pStr)
+float SAL_CALL rtl_str_toFloat(sal_Char const * pStr) SAL_THROW_EXTERN_C()
{
return (float) rtl_math_stringToDouble(pStr, pStr + rtl_str_getLength(pStr),
'.', 0, 0, 0);
}
-double SAL_CALL rtl_str_toDouble(sal_Char const * pStr)
+double SAL_CALL rtl_str_toDouble(sal_Char const * pStr) SAL_THROW_EXTERN_C()
{
return rtl_math_stringToDouble(pStr, pStr + rtl_str_getLength(pStr), '.', 0,
0, 0);
@@ -305,6 +307,7 @@ void SAL_CALL rtl_uString2String( rtl_String** ppThis,
sal_Int32 nULen,
rtl_TextEncoding eTextEncoding,
sal_uInt32 nCvtFlags )
+ SAL_THROW_EXTERN_C()
{
rtl_impl_convertUStringToString(ppThis, pUStr, nULen, eTextEncoding,
nCvtFlags, sal_False);
@@ -315,6 +318,7 @@ sal_Bool SAL_CALL rtl_convertUStringToString(rtl_String ** pTarget,
sal_Int32 nLength,
rtl_TextEncoding nEncoding,
sal_uInt32 nFlags)
+ SAL_THROW_EXTERN_C()
{
return rtl_impl_convertUStringToString(pTarget, pSource, nLength, nEncoding,
nFlags, sal_True);
diff --git a/sal/rtl/source/strtmpl.c b/sal/rtl/source/strtmpl.cxx
index 830521d7b94f..93f91331d376 100644
--- a/sal/rtl/source/strtmpl.c
+++ b/sal/rtl/source/strtmpl.cxx
@@ -67,6 +67,7 @@ inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest,
/* ======================================================================= */
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( getLength )( const IMPL_RTL_STRCODE* pStr )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pTempStr = pStr;
while( *pTempStr )
@@ -78,6 +79,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( getLength )( const IMPL_RTL_STRCODE* pStr )
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compare )( const IMPL_RTL_STRCODE* pStr1,
const IMPL_RTL_STRCODE* pStr2 )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet;
while ( ((nRet = ((sal_Int32)(IMPL_RTL_USTRCODE(*pStr1)))-
@@ -97,6 +99,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compare_WithLength )( const IMPL_RTL_STRCOD
sal_Int32 nStr1Len,
const IMPL_RTL_STRCODE* pStr2,
sal_Int32 nStr2Len )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet = nStr1Len - nStr2Len;
int nCount = (nRet <= 0) ? nStr1Len : nStr2Len;
@@ -119,6 +122,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompare_WithLength )( const IMPL_R
const IMPL_RTL_STRCODE* pStr2,
sal_Int32 nStr2Len,
sal_Int32 nShortenedLength )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
@@ -147,6 +151,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( reverseCompare_WithLength )( const IMPL_RTL
sal_Int32 nStr1Len,
const IMPL_RTL_STRCODE* pStr2,
sal_Int32 nStr2Len )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pStr1Run = pStr1+nStr1Len;
const IMPL_RTL_STRCODE* pStr2Run = pStr2+nStr2Len;
@@ -168,6 +173,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( reverseCompare_WithLength )( const IMPL_RTL
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase )( const IMPL_RTL_STRCODE* pStr1,
const IMPL_RTL_STRCODE* pStr2 )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet;
sal_Int32 c1;
@@ -199,6 +205,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( compareIgnoreAsciiCase_WithLength )( const
sal_Int32 nStr1Len,
const IMPL_RTL_STRCODE* pStr2,
sal_Int32 nStr2Len )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
@@ -232,6 +239,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength
const IMPL_RTL_STRCODE* pStr2,
sal_Int32 nStr2Len,
sal_Int32 nShortenedLength )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pStr1End = pStr1 + nStr1Len;
const IMPL_RTL_STRCODE* pStr2End = pStr2 + nStr2Len;
@@ -265,6 +273,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( shortenedCompareIgnoreAsciiCase_WithLength
/* ----------------------------------------------------------------------- */
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode )( const IMPL_RTL_STRCODE* pStr )
+ SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( hashCode_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ) );
}
@@ -273,6 +282,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode )( const IMPL_RTL_STRCODE* pStr )
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode_WithLength )( const IMPL_RTL_STRCODE* pStr,
sal_Int32 nLen )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 h = nLen;
@@ -329,6 +339,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( hashCode_WithLength )( const IMPL_RTL_STRCO
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar )( const IMPL_RTL_STRCODE* pStr,
IMPL_RTL_STRCODE c )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pTempStr = pStr;
while ( *pTempStr )
@@ -347,6 +358,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar )( const IMPL_RTL_STRCODE* pStr
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar_WithLength )( const IMPL_RTL_STRCODE* pStr,
sal_Int32 nLen,
IMPL_RTL_STRCODE c )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pTempStr = pStr;
while ( nLen > 0 )
@@ -365,6 +377,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfChar_WithLength )( const IMPL_RTL_ST
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar )( const IMPL_RTL_STRCODE* pStr,
IMPL_RTL_STRCODE c )
+ SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( lastIndexOfChar_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ), c );
}
@@ -374,6 +387,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar )( const IMPL_RTL_STRCODE*
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar_WithLength )( const IMPL_RTL_STRCODE* pStr,
sal_Int32 nLen,
IMPL_RTL_STRCODE c )
+ SAL_THROW_EXTERN_C()
{
pStr += nLen;
while ( nLen > 0 )
@@ -392,6 +406,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfChar_WithLength )( const IMPL_RT
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfStr )( const IMPL_RTL_STRCODE* pStr,
const IMPL_RTL_STRCODE* pSubStr )
+ SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( indexOfStr_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ),
pSubStr, IMPL_RTL_STRNAME( getLength )( pSubStr ) );
@@ -403,6 +418,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfStr_WithLength )( const IMPL_RTL_STR
sal_Int32 nStrLen,
const IMPL_RTL_STRCODE* pSubStr,
sal_Int32 nSubLen )
+ SAL_THROW_EXTERN_C()
{
/* faster search for a single character */
if ( nSubLen < 2 )
@@ -464,6 +480,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( indexOfStr_WithLength )( const IMPL_RTL_STR
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfStr )( const IMPL_RTL_STRCODE* pStr,
const IMPL_RTL_STRCODE* pSubStr )
+ SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( lastIndexOfStr_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ),
pSubStr, IMPL_RTL_STRNAME( getLength )( pSubStr ) );
@@ -475,6 +492,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfStr_WithLength )( const IMPL_RTL
sal_Int32 nStrLen,
const IMPL_RTL_STRCODE* pSubStr,
sal_Int32 nSubLen )
+ SAL_THROW_EXTERN_C()
{
/* faster search for a single character */
if ( nSubLen < 2 )
@@ -530,6 +548,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( lastIndexOfStr_WithLength )( const IMPL_RTL
void SAL_CALL IMPL_RTL_STRNAME( replaceChar )( IMPL_RTL_STRCODE* pStr,
IMPL_RTL_STRCODE cOld,
IMPL_RTL_STRCODE cNew )
+ SAL_THROW_EXTERN_C()
{
while ( *pStr )
{
@@ -546,6 +565,7 @@ void SAL_CALL IMPL_RTL_STRNAME( replaceChar_WithLength )( IMPL_RTL_STRCODE* pStr
sal_Int32 nLen,
IMPL_RTL_STRCODE cOld,
IMPL_RTL_STRCODE cNew )
+ SAL_THROW_EXTERN_C()
{
while ( nLen > 0 )
{
@@ -560,6 +580,7 @@ void SAL_CALL IMPL_RTL_STRNAME( replaceChar_WithLength )( IMPL_RTL_STRCODE* pStr
/* ----------------------------------------------------------------------- */
void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr )
+ SAL_THROW_EXTERN_C()
{
while ( *pStr )
{
@@ -575,6 +596,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase )( IMPL_RTL_STRCODE* pStr )
void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE* pStr,
sal_Int32 nLen )
+ SAL_THROW_EXTERN_C()
{
while ( nLen > 0 )
{
@@ -590,6 +612,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiLowerCase_WithLength )( IMPL_RTL_STRCODE*
/* ----------------------------------------------------------------------- */
void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr )
+ SAL_THROW_EXTERN_C()
{
while ( *pStr )
{
@@ -605,6 +628,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase )( IMPL_RTL_STRCODE* pStr )
void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE* pStr,
sal_Int32 nLen )
+ SAL_THROW_EXTERN_C()
{
while ( nLen > 0 )
{
@@ -620,6 +644,7 @@ void SAL_CALL IMPL_RTL_STRNAME( toAsciiUpperCase_WithLength )( IMPL_RTL_STRCODE*
/* ----------------------------------------------------------------------- */
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim )( IMPL_RTL_STRCODE* pStr )
+ SAL_THROW_EXTERN_C()
{
return IMPL_RTL_STRNAME( trim_WithLength )( pStr, IMPL_RTL_STRNAME( getLength )( pStr ) );
}
@@ -627,6 +652,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim )( IMPL_RTL_STRCODE* pStr )
/* ----------------------------------------------------------------------- */
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim_WithLength )( IMPL_RTL_STRCODE* pStr, sal_Int32 nLen )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nPreSpaces = 0;
sal_Int32 nPostSpaces = 0;
@@ -670,6 +696,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( trim_WithLength )( IMPL_RTL_STRCODE* pStr,
/* ----------------------------------------------------------------------- */
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfBoolean )( IMPL_RTL_STRCODE* pStr, sal_Bool b )
+ SAL_THROW_EXTERN_C()
{
if ( b )
{
@@ -705,6 +732,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfBoolean )( IMPL_RTL_STRCODE* pStr, s
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfChar )( IMPL_RTL_STRCODE* pStr,
IMPL_RTL_STRCODE c )
+ SAL_THROW_EXTERN_C()
{
*pStr++ = c;
*pStr = 0;
@@ -716,6 +744,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfChar )( IMPL_RTL_STRCODE* pStr,
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt32 )( IMPL_RTL_STRCODE* pStr,
sal_Int32 n,
sal_Int16 nRadix )
+ SAL_THROW_EXTERN_C()
{
sal_Char aBuf[RTL_STR_MAX_VALUEOFINT32];
sal_Char* pBuf = aBuf;
@@ -770,6 +799,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt32 )( IMPL_RTL_STRCODE* pStr,
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt64 )( IMPL_RTL_STRCODE* pStr,
sal_Int64 n,
sal_Int16 nRadix )
+ SAL_THROW_EXTERN_C()
{
sal_Char aBuf[RTL_STR_MAX_VALUEOFINT64];
sal_Char* pBuf = aBuf;
@@ -823,6 +853,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( valueOfInt64 )( IMPL_RTL_STRCODE* pStr,
/* ----------------------------------------------------------------------- */
sal_Bool SAL_CALL IMPL_RTL_STRNAME( toBoolean )( const IMPL_RTL_STRCODE* pStr )
+ SAL_THROW_EXTERN_C()
{
if ( *pStr == '1' )
return sal_True;
@@ -849,6 +880,7 @@ sal_Bool SAL_CALL IMPL_RTL_STRNAME( toBoolean )( const IMPL_RTL_STRCODE* pStr )
sal_Int32 SAL_CALL IMPL_RTL_STRNAME( toInt32 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
+ SAL_THROW_EXTERN_C()
{
sal_Bool bNeg;
sal_Int16 nDigit;
@@ -895,6 +927,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRNAME( toInt32 )( const IMPL_RTL_STRCODE* pStr,
sal_Int64 SAL_CALL IMPL_RTL_STRNAME( toInt64 )( const IMPL_RTL_STRCODE* pStr,
sal_Int16 nRadix )
+ SAL_THROW_EXTERN_C()
{
sal_Bool bNeg;
sal_Int16 nDigit;
@@ -944,7 +977,7 @@ sal_Int64 SAL_CALL IMPL_RTL_STRNAME( toInt64 )( const IMPL_RTL_STRCODE* pStr,
static IMPL_RTL_STRINGDATA* IMPL_RTL_STRINGNAME( ImplAlloc )( sal_Int32 nLen )
{
IMPL_RTL_STRINGDATA * pData
- = (SAL_INT_CAST(sal_uInt32, nLen)
+ = (sal::static_int_cast< sal_uInt32 >(nLen)
<= ((SAL_MAX_UINT32 - sizeof (IMPL_RTL_STRINGDATA))
/ sizeof (IMPL_RTL_STRCODE)))
? (IMPL_RTL_STRINGDATA *) rtl_allocateMemory(
@@ -996,6 +1029,7 @@ static IMPL_RTL_STRCODE* IMPL_RTL_STRINGNAME( ImplNewCopy )( IMPL_RTL_STRINGDATA
/* ----------------------------------------------------------------------- */
void SAL_CALL IMPL_RTL_STRINGNAME( acquire )( IMPL_RTL_STRINGDATA* pThis )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_AQUIRE( pThis );
}
@@ -1003,6 +1037,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( acquire )( IMPL_RTL_STRINGDATA* pThis )
/* ----------------------------------------------------------------------- */
void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis )
+ SAL_THROW_EXTERN_C()
{
if (SAL_STRING_IS_STATIC (pThis))
return;
@@ -1026,6 +1061,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis )
/* ----------------------------------------------------------------------- */
void SAL_CALL IMPL_RTL_STRINGNAME( new )( IMPL_RTL_STRINGDATA** ppThis )
+ SAL_THROW_EXTERN_C()
{
if ( *ppThis)
IMPL_RTL_STRINGNAME( release )( *ppThis );
@@ -1037,6 +1073,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new )( IMPL_RTL_STRINGDATA** ppThis )
/* ----------------------------------------------------------------------- */
void SAL_CALL IMPL_RTL_STRINGNAME( new_WithLength )( IMPL_RTL_STRINGDATA** ppThis, sal_Int32 nLen )
+ SAL_THROW_EXTERN_C()
{
if ( nLen <= 0 )
IMPL_RTL_STRINGNAME( new )( ppThis );
@@ -1060,6 +1097,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( new_WithLength )( IMPL_RTL_STRINGDATA** ppThi
void SAL_CALL IMPL_RTL_STRINGNAME( newFromString )( IMPL_RTL_STRINGDATA** ppThis,
const IMPL_RTL_STRINGDATA* pStr )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg;
@@ -1083,6 +1121,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromString )( IMPL_RTL_STRINGDATA** ppThis
void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr )( IMPL_RTL_STRINGDATA** ppThis,
const IMPL_RTL_STRCODE* pCharStr )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRCODE* pBuffer;
IMPL_RTL_STRINGDATA* pOrg;
@@ -1126,6 +1165,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr )( IMPL_RTL_STRINGDATA** ppThis,
void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr_WithLength )( IMPL_RTL_STRINGDATA** ppThis,
const IMPL_RTL_STRCODE* pCharStr,
sal_Int32 nLen )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg;
@@ -1149,6 +1189,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newFromStr_WithLength )( IMPL_RTL_STRINGDATA*
void SAL_CALL IMPL_RTL_STRINGNAME( assign )( IMPL_RTL_STRINGDATA** ppThis,
IMPL_RTL_STRINGDATA* pStr )
+ SAL_THROW_EXTERN_C()
{
/* must be done at first, if pStr == *ppThis */
IMPL_RTL_AQUIRE( pStr );
@@ -1162,6 +1203,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( assign )( IMPL_RTL_STRINGDATA** ppThis,
/* ----------------------------------------------------------------------- */
sal_Int32 SAL_CALL IMPL_RTL_STRINGNAME( getLength )( const IMPL_RTL_STRINGDATA* pThis )
+ SAL_THROW_EXTERN_C()
{
return pThis->length;
}
@@ -1169,6 +1211,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRINGNAME( getLength )( const IMPL_RTL_STRINGDATA*
/* ----------------------------------------------------------------------- */
IMPL_RTL_STRCODE* SAL_CALL IMPL_RTL_STRINGNAME( getStr )( IMPL_RTL_STRINGDATA * pThis )
+ SAL_THROW_EXTERN_C()
{
return pThis->buffer;
}
@@ -1178,6 +1221,7 @@ IMPL_RTL_STRCODE* SAL_CALL IMPL_RTL_STRINGNAME( getStr )( IMPL_RTL_STRINGDATA *
void SAL_CALL IMPL_RTL_STRINGNAME( newConcat )( IMPL_RTL_STRINGDATA** ppThis,
IMPL_RTL_STRINGDATA* pLeft,
IMPL_RTL_STRINGDATA* pRight )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg = *ppThis;
@@ -1213,6 +1257,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplaceStrAt )( IMPL_RTL_STRINGDATA** ppTh
sal_Int32 nIndex,
sal_Int32 nCount,
IMPL_RTL_STRINGDATA* pNewSubStr )
+ SAL_THROW_EXTERN_C()
{
/* Append? */
if ( nIndex >= pStr->length )
@@ -1290,6 +1335,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplace )( IMPL_RTL_STRINGDATA** ppThis,
IMPL_RTL_STRINGDATA* pStr,
IMPL_RTL_STRCODE cOld,
IMPL_RTL_STRCODE cNew )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg = *ppThis;
int bChanged = 0;
@@ -1347,6 +1393,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newReplace )( IMPL_RTL_STRINGDATA** ppThis,
void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA** ppThis,
IMPL_RTL_STRINGDATA* pStr )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg = *ppThis;
int bChanged = 0;
@@ -1407,6 +1454,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiLowerCase )( IMPL_RTL_STRINGDATA**
void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA** ppThis,
IMPL_RTL_STRINGDATA* pStr )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg = *ppThis;
int bChanged = 0;
@@ -1467,6 +1515,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( newToAsciiUpperCase )( IMPL_RTL_STRINGDATA**
void SAL_CALL IMPL_RTL_STRINGNAME( newTrim )( IMPL_RTL_STRINGDATA** ppThis,
IMPL_RTL_STRINGDATA* pStr )
+ SAL_THROW_EXTERN_C()
{
IMPL_RTL_STRINGDATA* pOrg = *ppThis;
const IMPL_RTL_STRCODE* pCharStr = pStr->buffer;
@@ -1510,6 +1559,7 @@ sal_Int32 SAL_CALL IMPL_RTL_STRINGNAME( getToken )( IMPL_RTL_STRINGDATA** ppThis
sal_Int32 nToken,
IMPL_RTL_STRCODE cTok,
sal_Int32 nIndex )
+ SAL_THROW_EXTERN_C()
{
const IMPL_RTL_STRCODE* pCharStr = pStr->buffer;
const IMPL_RTL_STRCODE* pCharStrStart;
diff --git a/sal/rtl/source/surrogates.h b/sal/rtl/source/surrogates.hxx
index c686e181047a..42d4355ade00 100644
--- a/sal/rtl/source/surrogates.h
+++ b/sal/rtl/source/surrogates.hxx
@@ -26,8 +26,8 @@
*
************************************************************************/
-#ifndef INCLUDED_SAL_RTL_SOURCE_SURROGATES_H
-#define INCLUDED_SAL_RTL_SOURCE_SURROGATES_H
+#ifndef INCLUDED_SAL_RTL_SOURCE_SURROGATES_HXX
+#define INCLUDED_SAL_RTL_SOURCE_SURROGATES_HXX
#include "sal/config.h"
diff --git a/sal/rtl/source/uri.cxx b/sal/rtl/source/uri.cxx
index 928614eb32ce..191d319c6474 100644
--- a/sal/rtl/source/uri.cxx
+++ b/sal/rtl/source/uri.cxx
@@ -31,7 +31,7 @@
#include "rtl/uri.h"
-#include "surrogates.h"
+#include "surrogates.hxx"
#include "osl/diagnose.h"
#include "rtl/strbuf.hxx"
diff --git a/sal/rtl/source/ustrbuf.c b/sal/rtl/source/ustrbuf.cxx
index 374913ae78b8..82b2fcb43d1b 100644
--- a/sal/rtl/source/ustrbuf.c
+++ b/sal/rtl/source/ustrbuf.cxx
@@ -148,6 +148,7 @@ void SAL_CALL rtl_uStringbuffer_insert( rtl_uString ** This,
void rtl_uStringbuffer_insertUtf32(
rtl_uString ** pThis, sal_Int32 * capacity, sal_Int32 offset, sal_uInt32 c)
+ SAL_THROW_EXTERN_C()
{
sal_Unicode buf[2];
sal_Int32 len;
diff --git a/sal/rtl/source/ustring.c b/sal/rtl/source/ustring.cxx
index feb597547ae1..a37353c99161 100644
--- a/sal/rtl/source/ustring.c
+++ b/sal/rtl/source/ustring.cxx
@@ -40,9 +40,9 @@
#include <string.h>
#include <sal/alloca.h>
-#include "hash.h"
-#include "strimp.h"
-#include "surrogates.h"
+#include "hash.hxx"
+#include "strimp.hxx"
+#include "surrogates.hxx"
#include <rtl/ustring.h>
#include "rtl/math.h"
@@ -76,11 +76,11 @@ static void internRelease (rtl_uString *pThis);
/* Include String/UString template code */
-#include "strtmpl.c"
+#include "strtmpl.cxx"
sal_Int32 rtl_ustr_indexOfAscii_WithLength(
sal_Unicode const * str, sal_Int32 len,
- char const * subStr, sal_Int32 subLen)
+ char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
{
if (subLen > 0 && subLen <= len) {
sal_Int32 i;
@@ -97,7 +97,7 @@ sal_Int32 rtl_ustr_indexOfAscii_WithLength(
sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength(
sal_Unicode const * str, sal_Int32 len,
- char const * subStr, sal_Int32 subLen)
+ char const * subStr, sal_Int32 subLen) SAL_THROW_EXTERN_C()
{
if (subLen > 0 && subLen <= len) {
sal_Int32 i;
@@ -113,6 +113,7 @@ sal_Int32 rtl_ustr_lastIndexOfAscii_WithLength(
}
sal_Int32 SAL_CALL rtl_ustr_valueOfFloat(sal_Unicode * pStr, float f)
+ SAL_THROW_EXTERN_C()
{
rtl_uString * pResult = NULL;
sal_Int32 nLen;
@@ -128,6 +129,7 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfFloat(sal_Unicode * pStr, float f)
}
sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * pStr, double d)
+ SAL_THROW_EXTERN_C()
{
rtl_uString * pResult = NULL;
sal_Int32 nLen;
@@ -142,14 +144,14 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * pStr, double d)
return nLen;
}
-float SAL_CALL rtl_ustr_toFloat(sal_Unicode const * pStr)
+float SAL_CALL rtl_ustr_toFloat(sal_Unicode const * pStr) SAL_THROW_EXTERN_C()
{
return (float) rtl_math_uStringToDouble(pStr,
pStr + rtl_ustr_getLength(pStr),
'.', 0, 0, 0);
}
-double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr)
+double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr) SAL_THROW_EXTERN_C()
{
return rtl_math_uStringToDouble(pStr, pStr + rtl_ustr_getLength(pStr), '.',
0, 0, 0);
@@ -159,6 +161,7 @@ double SAL_CALL rtl_ustr_toDouble(sal_Unicode const * pStr)
sal_Int32 SAL_CALL rtl_ustr_ascii_compare( const sal_Unicode* pStr1,
const sal_Char* pStr2 )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet;
while ( ((nRet = ((sal_Int32)(*pStr1))-
@@ -177,6 +180,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_compare( const sal_Unicode* pStr1,
sal_Int32 SAL_CALL rtl_ustr_ascii_compare_WithLength( const sal_Unicode* pStr1,
sal_Int32 nStr1Len,
const sal_Char* pStr2 )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet = 0;
while( ((nRet = (nStr1Len ? (sal_Int32)(*pStr1) : 0)-
@@ -197,6 +201,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompare_WithLength( const sal_Unicode
sal_Int32 nStr1Len,
const sal_Char* pStr2,
sal_Int32 nShortenedLength )
+ SAL_THROW_EXTERN_C()
{
const sal_Unicode* pStr1End = pStr1 + nStr1Len;
sal_Int32 nRet;
@@ -240,6 +245,7 @@ sal_Int32 SAL_CALL rtl_ustr_asciil_reverseCompare_WithLength( const sal_Unicode*
sal_Int32 nStr1Len,
const sal_Char* pStr2,
sal_Int32 nStr2Len )
+ SAL_THROW_EXTERN_C()
{
const sal_Unicode* pStr1Run = pStr1+nStr1Len;
const sal_Char* pStr2Run = pStr2+nStr2Len;
@@ -261,6 +267,7 @@ sal_Int32 SAL_CALL rtl_ustr_asciil_reverseCompare_WithLength( const sal_Unicode*
sal_Bool SAL_CALL rtl_ustr_asciil_reverseEquals_WithLength( const sal_Unicode* pStr1,
const sal_Char* pStr2,
sal_Int32 nStrLen )
+ SAL_THROW_EXTERN_C()
{
const sal_Unicode* pStr1Run = pStr1+nStrLen;
const sal_Char* pStr2Run = pStr2+nStrLen;
@@ -279,6 +286,7 @@ sal_Bool SAL_CALL rtl_ustr_asciil_reverseEquals_WithLength( const sal_Unicode* p
sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase( const sal_Unicode* pStr1,
const sal_Char* pStr2 )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet;
sal_Int32 c1;
@@ -309,6 +317,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase( const sal_Unicode* pSt
sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( const sal_Unicode* pStr1,
sal_Int32 nStr1Len,
const sal_Char* pStr2 )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nRet;
sal_Int32 c1;
@@ -340,7 +349,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( const sal_U
sal_Int32 rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(
sal_Unicode const * first, sal_Int32 firstLen,
- char const * second, sal_Int32 secondLen)
+ char const * second, sal_Int32 secondLen) SAL_THROW_EXTERN_C()
{
sal_Int32 i;
sal_Int32 len = firstLen < secondLen ? firstLen : secondLen;
@@ -368,6 +377,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( co
sal_Int32 nStr1Len,
const sal_Char* pStr2,
sal_Int32 nShortenedLength )
+ SAL_THROW_EXTERN_C()
{
const sal_Unicode* pStr1End = pStr1 + nStr1Len;
sal_Int32 nRet;
@@ -417,6 +427,7 @@ sal_Int32 SAL_CALL rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( co
void SAL_CALL rtl_uString_newFromAscii( rtl_uString** ppThis,
const sal_Char* pCharStr )
+ SAL_THROW_EXTERN_C()
{
sal_Int32 nLen;
@@ -460,7 +471,7 @@ void SAL_CALL rtl_uString_newFromAscii( rtl_uString** ppThis,
void SAL_CALL rtl_uString_newFromCodePoints(
rtl_uString ** newString, sal_uInt32 const * codePoints,
- sal_Int32 codePointCount)
+ sal_Int32 codePointCount) SAL_THROW_EXTERN_C()
{
sal_Int32 n;
sal_Int32 i;
@@ -724,7 +735,7 @@ void SAL_CALL rtl_string2UString( rtl_uString** ppThis,
const sal_Char* pStr,
sal_Int32 nLen,
rtl_TextEncoding eTextEncoding,
- sal_uInt32 nCvtFlags )
+ sal_uInt32 nCvtFlags ) SAL_THROW_EXTERN_C()
{
rtl_string2UString_status( ppThis, pStr, nLen, eTextEncoding,
nCvtFlags, NULL );
@@ -732,10 +743,10 @@ void SAL_CALL rtl_string2UString( rtl_uString** ppThis,
/* ----------------------------------------------------------------------- */
-typedef enum {
+enum StrLifecycle {
CANNOT_RETURN,
CAN_RETURN = 1
-} StrLifecycle;
+};
static oslMutex
getInternMutex()
@@ -784,7 +795,7 @@ static void rtl_ustring_intern_internal( rtl_uString ** newStr,
}
void SAL_CALL rtl_uString_intern( rtl_uString ** newStr,
- rtl_uString * str)
+ rtl_uString * str) SAL_THROW_EXTERN_C()
{
if (SAL_STRING_IS_INTERN(str))
{
@@ -830,6 +841,7 @@ void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr,
rtl_TextEncoding eTextEncoding,
sal_uInt32 convertFlags,
sal_uInt32 * pInfo )
+ SAL_THROW_EXTERN_C()
{
rtl_uString *scratch;
@@ -848,8 +860,8 @@ void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr,
{
int i;
rtl_uString *pScratch;
- pScratch = alloca( sizeof( rtl_uString )
- + len * sizeof (IMPL_RTL_STRCODE ) );
+ pScratch = static_cast< rtl_uString * >(
+ alloca(sizeof (rtl_uString) + len * sizeof (IMPL_RTL_STRCODE)));
for (i = 0; i < len; i++)
{
/* Check ASCII range */
@@ -868,7 +880,9 @@ void SAL_CALL rtl_uString_internConvert( rtl_uString ** newStr,
sal_Size nSrcBytes;
sal_uInt32 nInfo;
- pScratch = alloca( sizeof(rtl_uString) + ulen * sizeof (IMPL_RTL_STRCODE) );
+ pScratch = static_cast< rtl_uString * >(
+ alloca(
+ sizeof (rtl_uString) + ulen * sizeof (IMPL_RTL_STRCODE)));
hConverter = rtl_createTextToUnicodeConverter( eTextEncoding );
rtl_convertTextToUnicode(