diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-02-16 08:29:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-02-16 08:31:45 +0100 |
commit | acc9fb5ca0bc378ac03637cba948520a29938940 (patch) | |
tree | 1b2d7e124c8505f781d0f9402417534ce0f39877 /sal | |
parent | a5661d717197a6723b80fb65cde463c479983934 (diff) |
Prevent misuses of RTL_CONSTASCII_USTRINGPARAM
works only on 64 bit platforms, though.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/string.hxx | 16 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 25 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index 68f2aa190ce4..0809c260ee59 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -495,6 +495,14 @@ public: str, strLength, strLength) == 0; } + // This overload is left undefined, to detect calls of matchL that + // erroneously use RTL_CONSTASCII_USTRINGPARAM instead of + // RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit + // platforms): +#if SAL_TYPES_SIZEOFLONG == 8 + void matchL(char const *, sal_Int32, rtl_TextEncoding) const; +#endif + /** Match against a substring appearing in this string, ignoring the case of ASCII letters. @@ -686,6 +694,14 @@ public: return n < 0 ? n : n + fromIndex; } + // This overload is left undefined, to detect calls of indexOfL that + // erroneously use RTL_CONSTASCII_USTRINGPARAM instead of + // RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit + // platforms): +#if SAL_TYPES_SIZEOFLONG == 8 + void indexOfL(char const *, sal_Int32, rtl_TextEncoding) const; +#endif + /** Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the end. diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index cf1ec92df360..23182431416d 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -681,6 +681,14 @@ public: asciiStr, asciiStrLength ) == 0; } + // This overload is left undefined, to detect calls of matchAsciiL that + // erroneously use RTL_CONSTASCII_USTRINGPARAM instead of + // RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit + // platforms): +#if SAL_TYPES_SIZEOFLONG == 8 + void matchAsciiL(char const *, sal_Int32, rtl_TextEncoding) const; +#endif + /** Match against a substring appearing in this string, ignoring the case of ASCII letters. @@ -711,6 +719,15 @@ public: asciiStr, asciiStrLength ) == 0; } + // This overload is left undefined, to detect calls of + // matchIgnoreAsciiCaseAsciiL that erroneously use + // RTL_CONSTASCII_USTRINGPARAM instead of RTL_CONSTASCII_STRINGPARAM (but + // would lead to ambiguities on 32 bit platforms): +#if SAL_TYPES_SIZEOFLONG == 8 + void matchIgnoreAsciiCaseAsciiL(char const *, sal_Int32, rtl_TextEncoding) + const; +#endif + /** Check whether this string ends with a given substring. @@ -905,6 +922,14 @@ public: return ret < 0 ? ret : ret + fromIndex; } + // This overload is left undefined, to detect calls of indexOfAsciiL that + // erroneously use RTL_CONSTASCII_USTRINGPARAM instead of + // RTL_CONSTASCII_STRINGPARAM (but would lead to ambiguities on 32 bit + // platforms): +#if SAL_TYPES_SIZEOFLONG == 8 + void indexOfAsciiL(char const *, sal_Int32 len, rtl_TextEncoding) const; +#endif + /** Returns the index within this string of the last occurrence of the specified substring, searching backward starting at the end. |