From 91957a75aab89415d92aa137d73fc5cf892a0408 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 2 Jun 2015 11:27:00 +0200 Subject: loplugin:cstylecast: deal with those that are (technically) const_cast Change-Id: I5bad1428e96c76f7d295f69e10beea4397d560ff --- i18npool/qa/cppunit/test_textsearch.cxx | 8 ++++---- i18npool/source/breakiterator/gendict.cxx | 2 +- i18npool/source/collator/gencoll_rule.cxx | 2 +- i18npool/source/indexentry/genindex_data.cxx | 2 +- i18npool/source/search/textsearch.cxx | 6 +++--- i18npool/source/textconversion/genconv_dict.cxx | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) (limited to 'i18npool') diff --git a/i18npool/qa/cppunit/test_textsearch.cxx b/i18npool/qa/cppunit/test_textsearch.cxx index db2d4022250e..3de164ac6007 100644 --- a/i18npool/qa/cppunit/test_textsearch.cxx +++ b/i18npool/qa/cppunit/test_textsearch.cxx @@ -61,11 +61,11 @@ void TestTextSearch::testICU() OUString aString( "abcdefgh" ); OUString aPattern( "e" ); - IcuUniString aSearchPat( (const UChar*)aPattern.getStr(), aPattern.getLength() ); + IcuUniString aSearchPat( reinterpret_cast(aPattern.getStr()), aPattern.getLength() ); pRegexMatcher = new RegexMatcher( aSearchPat, nSearchFlags, nErr ); - IcuUniString aSource( (const UChar*)aString.getStr(), aString.getLength() ); + IcuUniString aSource( reinterpret_cast(aString.getStr()), aString.getLength() ); pRegexMatcher->reset( aSource ); CPPUNIT_ASSERT( pRegexMatcher->find( 0, nErr ) ); @@ -80,10 +80,10 @@ void TestTextSearch::testICU() OUString aString2( "acababaabcababadcdaa" ); OUString aPattern2( "a" ); - IcuUniString aSearchPat2( (const UChar*)aPattern2.getStr(), aPattern2.getLength() ); + IcuUniString aSearchPat2( reinterpret_cast(aPattern2.getStr()), aPattern2.getLength() ); pRegexMatcher = new RegexMatcher( aSearchPat2, nSearchFlags, nErr ); - IcuUniString aSource2( (const UChar*)aString2.getStr(), aString2.getLength() ); + IcuUniString aSource2( reinterpret_cast(aString2.getStr()), aString2.getLength() ); pRegexMatcher->reset( aSource2 ); CPPUNIT_ASSERT( pRegexMatcher->find( 0, nErr ) ); diff --git a/i18npool/source/breakiterator/gendict.cxx b/i18npool/source/breakiterator/gendict.cxx index 8bec7d203fb4..3e649dd964fb 100644 --- a/i18npool/source/breakiterator/gendict.cxx +++ b/i18npool/source/breakiterator/gendict.cxx @@ -120,7 +120,7 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector(rPatternStr.getStr()), rPatternStr.getLength()); #ifndef DISABLE_WORDBOUND_EMULATION // for conveniance specific syntax elements of the old regex engine are emulated // - by replacing \< with "word-break followed by a look-ahead word-char" @@ -860,7 +860,7 @@ SearchResult TextSearch::RESrchFrwrd( const OUString& searchStr, // use the ICU RegexMatcher to find the matches UErrorCode nIcuErr = U_ZERO_ERROR; - const IcuUniString aSearchTargetStr( (const UChar*)searchStr.getStr(), endPos); + const IcuUniString aSearchTargetStr( reinterpret_cast(searchStr.getStr()), endPos); pRegexMatcher->reset( aSearchTargetStr); // search until there is a valid match for(;;) @@ -915,7 +915,7 @@ SearchResult TextSearch::RESrchBkwrd( const OUString& searchStr, // TODO: use ICU's backward searching once it becomes available // as its replacement using forward search is not as good as the real thing UErrorCode nIcuErr = U_ZERO_ERROR; - const IcuUniString aSearchTargetStr( (const UChar*)searchStr.getStr(), startPos); + const IcuUniString aSearchTargetStr( reinterpret_cast(searchStr.getStr()), startPos); pRegexMatcher->reset( aSearchTargetStr); if (!lcl_findRegex( pRegexMatcher, endPos, nIcuErr)) return aRet; diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx index c7538ee25004..f83d4cacff92 100644 --- a/i18npool/source/textconversion/genconv_dict.cxx +++ b/i18npool/source/textconversion/genconv_dict.cxx @@ -100,7 +100,7 @@ void make_hhc_char(FILE *sfp, FILE *cfp) while (fgets(Cstr, 1024, sfp)) { // input file is in UTF-8 encoding (Hangul:Hanja) // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); const sal_Unicode *Ustr = Ostr.getStr(); sal_Int32 len = Ostr.getLength(); @@ -188,7 +188,7 @@ void make_stc_char(FILE *sfp, FILE *cfp) while (fgets(Cstr, 1024, sfp)) { // input file is in UTF-8 encoding (SChinese:TChinese) // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); const sal_Unicode *Ustr = Ostr.getStr(); sal_Int32 len = Ostr.getLength(); if (Ustr[1] == 'v') @@ -354,7 +354,7 @@ void make_stc_word(FILE *sfp, FILE *cfp) while (fgets(Cstr, 1024, sfp)) { // input file is in UTF-8 encoding (SChinese:TChinese) // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); sal_Int32 len = Ostr.getLength(); if (char_total + len + 1 > 0xFFFF) { fprintf(stderr, "Word Dictionary stc_word.dic is too big (line %ld)", sal::static_int_cast< long >(line)); -- cgit