diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-11 15:51:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-12 12:46:45 +0200 |
commit | d4d37662b090cb237585156a47cd8e1f1cbe2656 (patch) | |
tree | 70e59ca62b055d7e49325a268d952e0ea057b2e9 /sal | |
parent | f2e65b3dbcd4c0ca91781067255854a0c5141d60 (diff) |
loplugin:constfields in reportdesign,sal,sax
and improve the rewriter so I spend less time fixing formatting
Change-Id: Ic2a6e5e31a5a202d2d02a47d77c484a57a5ec514
Reviewed-on: https://gerrit.libreoffice.org/61676
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/cppunittester/cppunittester.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/backtraceapi.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/file.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/file_impl.hxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/file_path_helper.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/file_url.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/pipe.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/signal.cxx | 2 | ||||
-rw-r--r-- | sal/osl/unx/socket.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/thread.cxx | 12 | ||||
-rw-r--r-- | sal/qa/osl/condition/osl_Condition.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_convert.cxx | 8 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_endswith.cxx | 6 | ||||
-rw-r--r-- | sal/rtl/bootstrap.cxx | 4 | ||||
-rw-r--r-- | sal/textenc/convertbig5hkscs.hxx | 2 | ||||
-rw-r--r-- | sal/textenc/convertgb18030.hxx | 16 | ||||
-rw-r--r-- | sal/textenc/convertsimple.cxx | 8 | ||||
-rw-r--r-- | sal/textenc/convertsinglebytetobmpunicode.hxx | 10 | ||||
-rw-r--r-- | sal/textenc/tenchelp.hxx | 94 | ||||
-rw-r--r-- | sal/textenc/tencinfo.cxx | 2 |
20 files changed, 95 insertions, 95 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index b4c15ea434a5..3ff102f18410 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -196,7 +196,7 @@ struct test_name_compare return nEndPos == maName.size(); } - std::string maName; + std::string const maName; }; bool addRecursiveTests(const std::vector<std::string>& test_names, CppUnit::Test* pTest, CppUnit::TestRunner& rRunner) diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx index 9edeef9fd7d9..07a315f36be2 100644 --- a/sal/osl/unx/backtraceapi.cxx +++ b/sal/osl/unx/backtraceapi.cxx @@ -30,7 +30,7 @@ struct FreeGuard { ~FreeGuard() { std::free(buffer); } - char ** buffer; + char ** const buffer; }; } diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 71f53470dd0e..c3c5cd7fd655 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -69,7 +69,7 @@ struct FileHandle_Impl KIND_FD = 1, KIND_MEM = 2 }; - int m_kind; + int const m_kind; /** State */ enum StateBits @@ -144,7 +144,7 @@ struct FileHandle_Impl class Guard { - pthread_mutex_t *m_mutex; + pthread_mutex_t * const m_mutex; public: explicit Guard(pthread_mutex_t *pMutex); diff --git a/sal/osl/unx/file_impl.hxx b/sal/osl/unx/file_impl.hxx index f0718e236f6f..de7a450e478d 100644 --- a/sal/osl/unx/file_impl.hxx +++ b/sal/osl/unx/file_impl.hxx @@ -28,8 +28,8 @@ struct DirectoryItem_Impl { sal_Int32 m_RefCount; - rtl_uString * m_ustrFilePath; /* holds native file name */ - unsigned char m_DType; + rtl_uString * const m_ustrFilePath; /* holds native file name */ + unsigned char const m_DType; explicit DirectoryItem_Impl( rtl_uString * ustrFilePath, unsigned char DType = 0); diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index 89969c1c40af..923b588a20c9 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -211,7 +211,7 @@ private: } private: - rtl::OUString m_path_list; + rtl::OUString const m_path_list; const sal_Unicode* m_end; const sal_Unicode m_separator; const sal_Unicode* m_path_segment_begin; diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index 428bfec90e3f..8e6f30f839d1 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -724,7 +724,7 @@ namespace { class UnicodeToTextConverter_Impl { - rtl_UnicodeToTextConverter m_converter; + rtl_UnicodeToTextConverter const m_converter; UnicodeToTextConverter_Impl() : m_converter (rtl_createUnicodeToTextConverter (osl_getThreadTextEncoding())) @@ -776,7 +776,7 @@ namespace { class TextToUnicodeConverter_Impl { - rtl_TextToUnicodeConverter m_converter; + rtl_TextToUnicodeConverter const m_converter; TextToUnicodeConverter_Impl() : m_converter (rtl_createTextToUnicodeConverter (osl_getThreadTextEncoding())) diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index 1c470b7fe3cd..feeca628762f 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -43,7 +43,7 @@ static oslPipe osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Op static struct { - int errcode; + int const errcode; oslPipeError error; } PipeError[]= { { 0, osl_Pipe_E_None }, /* no error */ diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx index c742634fc190..3ea564e14736 100644 --- a/sal/osl/unx/signal.cxx +++ b/sal/osl/unx/signal.cxx @@ -78,7 +78,7 @@ extern "C" using Handler1 = void (*)(int); extern "C" using Handler2 = void (*)(int, siginfo_t *, void *); struct SignalAction { - int Signal; + int const Signal; int Action; Handler1 Handler; bool siginfo; // Handler's type is Handler2 diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index b73ce1966847..05a6234f64df 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -201,8 +201,8 @@ static const sal_uInt32 SocketDirection[]= { static const struct { - int errcode; - oslSocketError error; + int const errcode; + oslSocketError const error; } SocketError[]= { { 0, osl_Socket_E_None }, /* no error */ { ENOTSOCK, osl_Socket_E_NotSocket }, /* Socket operation on non-socket */ diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx index 1cac41ce717b..a47ab7d317c5 100644 --- a/sal/osl/unx/thread.cxx +++ b/sal/osl/unx/thread.cxx @@ -87,11 +87,11 @@ typedef struct osl_thread_impl_st struct osl_thread_priority_st { - int m_Highest; - int m_Above_Normal; - int m_Normal; - int m_Below_Normal; - int m_Lowest; + int const m_Highest; + int const m_Above_Normal; + int const m_Normal; + int const m_Below_Normal; + int const m_Lowest; }; #define OSL_THREAD_PRIORITY_INITIALIZER { 127, 96, 64, 32, 0 } @@ -109,7 +109,7 @@ static void osl_thread_textencoding_init_Impl(); struct osl_thread_global_st { pthread_once_t m_once; - struct osl_thread_priority_st m_priority; + struct osl_thread_priority_st const m_priority; struct osl_thread_textencoding_st m_textencoding; }; diff --git a/sal/qa/osl/condition/osl_Condition.cxx b/sal/qa/osl/condition/osl_Condition.cxx index cac87532b8d8..e2c50fb309e6 100644 --- a/sal/qa/osl/condition/osl_Condition.cxx +++ b/sal/qa/osl/condition/osl_Condition.cxx @@ -39,7 +39,7 @@ public: protected: ::osl::Condition& m_MyCon; - ConditionType m_MyType; + ConditionType const m_MyType; void SAL_CALL run() override { diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx index f1992d4295c9..b80c446936dd 100644 --- a/sal/qa/rtl/strings/test_oustring_convert.cxx +++ b/sal/qa/rtl/strings/test_oustring_convert.cxx @@ -45,10 +45,10 @@ namespace { struct TestConvertToString { - sal_Unicode aSource[100]; - sal_Int32 nLength; - rtl_TextEncoding nEncoding; - sal_uInt32 nFlags; + sal_Unicode const aSource[100]; + sal_Int32 const nLength; + rtl_TextEncoding const nEncoding; + sal_uInt32 const nFlags; char const * pStrict; char const * pRelaxed; }; diff --git a/sal/qa/rtl/strings/test_oustring_endswith.cxx b/sal/qa/rtl/strings/test_oustring_endswith.cxx index d4e7bfcd0038..22c68abd1d2e 100644 --- a/sal/qa/rtl/strings/test_oustring_endswith.cxx +++ b/sal/qa/rtl/strings/test_oustring_endswith.cxx @@ -71,10 +71,10 @@ void test::oustring::EndsWith::endsWith() { struct Data { char const * str1; - sal_Int32 str1Len; + sal_Int32 const str1Len; char const * str2; - sal_Int32 str2Len; - bool endsWith; + sal_Int32 const str2Len; + bool const endsWith; }; Data const data[] = { { RTL_CONSTASCII_STRINGPARAM(""), RTL_CONSTASCII_STRINGPARAM(""), diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 108420dd0cc2..b63557375fe5 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -92,7 +92,7 @@ enum LookupMode { struct ExpandRequestLink { ExpandRequestLink const * next; Bootstrap_Impl const * file; - rtl::OUString key; + rtl::OUString const key; }; rtl::OUString expandMacros( @@ -314,7 +314,7 @@ struct Bootstrap_Impl Bootstrap_Impl * _base_ini; NameValueVector _nameValueVector; - OUString _iniName; + OUString const _iniName; explicit Bootstrap_Impl (OUString const & rIniName); ~Bootstrap_Impl(); diff --git a/sal/textenc/convertbig5hkscs.hxx b/sal/textenc/convertbig5hkscs.hxx index 089ac5845c95..1a2d1d689e47 100644 --- a/sal/textenc/convertbig5hkscs.hxx +++ b/sal/textenc/convertbig5hkscs.hxx @@ -34,7 +34,7 @@ struct ImplBig5HkscsConverterData sal_Int32 const * m_pUnicodeToBig5Hkscs2001PlaneOffsets; ImplUniToDBCSHighTab const * m_pUnicodeToBig5Data; ImplDBCSEUDCData const * m_pEudcData; - int m_nEudcCount; + int const m_nEudcCount; }; void * ImplCreateBig5HkscsToUnicodeContext(); diff --git a/sal/textenc/convertgb18030.hxx b/sal/textenc/convertgb18030.hxx index 680384794eb4..d3b3621dab24 100644 --- a/sal/textenc/convertgb18030.hxx +++ b/sal/textenc/convertgb18030.hxx @@ -26,18 +26,18 @@ struct ImplGb180302000ToUnicodeRange { - sal_Int32 m_nNonRangeDataIndex; - sal_uInt32 m_nFirstLinear; - sal_uInt32 m_nPastLinear; - sal_Unicode m_nFirstUnicode; + sal_Int32 const m_nNonRangeDataIndex; + sal_uInt32 const m_nFirstLinear; + sal_uInt32 const m_nPastLinear; + sal_Unicode const m_nFirstUnicode; }; struct ImplUnicodeToGb180302000Range { - sal_Int32 m_nNonRangeDataIndex; - sal_Unicode m_nFirstUnicode; - sal_Unicode m_nLastUnicode; - sal_uInt32 m_nFirstLinear; + sal_Int32 const m_nNonRangeDataIndex; + sal_Unicode const m_nFirstUnicode; + sal_Unicode const m_nLastUnicode; + sal_uInt32 const m_nFirstLinear; }; struct ImplGb18030ConverterData diff --git a/sal/textenc/convertsimple.cxx b/sal/textenc/convertsimple.cxx index 635a881432fd..9eb6b928021c 100644 --- a/sal/textenc/convertsimple.cxx +++ b/sal/textenc/convertsimple.cxx @@ -22,8 +22,8 @@ namespace { struct ImplReplaceCharData { - sal_uInt16 mnUniChar; - sal_uInt16 mnReplaceChar; + sal_uInt16 const mnUniChar; + sal_uInt16 const mnReplaceChar; }; static ImplReplaceCharData const aImplRepCharTab[] = @@ -353,8 +353,8 @@ sal_uInt16 ImplGetReplaceChar( sal_Unicode c ) struct ImplReplaceCharStrData { - sal_uInt16 mnUniChar; - sal_uInt16 maReplaceChars[IMPL_MAX_REPLACECHAR]; + sal_uInt16 const mnUniChar; + sal_uInt16 const maReplaceChars[IMPL_MAX_REPLACECHAR]; }; static ImplReplaceCharStrData const aImplRepCharStrTab[] = diff --git a/sal/textenc/convertsinglebytetobmpunicode.hxx b/sal/textenc/convertsinglebytetobmpunicode.hxx index 2a22ce82026b..53749db49d46 100644 --- a/sal/textenc/convertsinglebytetobmpunicode.hxx +++ b/sal/textenc/convertsinglebytetobmpunicode.hxx @@ -40,7 +40,7 @@ struct BmpUnicodeToSingleByteRange { /** The start of the range of BMP Unicode code points. */ - sal_Unicode unicode; + sal_Unicode const unicode; /** The extend of the range of BMP Unicode code points. @@ -49,7 +49,7 @@ struct BmpUnicodeToSingleByteRange { inclusive. It is an error if <code>unicode + range</code> is greater than <code>0xFFFF</code>.</p> */ - sal_uInt8 range; + sal_uInt8 const range; /** The start of the corresponding range of individual bytes. @@ -57,7 +57,7 @@ struct BmpUnicodeToSingleByteRange { <p>It is an error if <code>byte + range</code> is greater than <code>0xFF</code>.</p> */ - sal_uInt8 byte; + sal_uInt8 const byte; }; /** @@ -77,12 +77,12 @@ struct BmpUnicodeToSingleByteConverterData { <p>Illegal units from the single-byte character set are mapped to <code>0xFFFF</code>.</p> */ - sal_Unicode byteToUnicode[256]; + sal_Unicode const byteToUnicode[256]; /** The number of Unicode-to-byte conversion ranges. */ - std::size_t unicodeToByteEntries; + std::size_t const unicodeToByteEntries; /** The array of Unicode-to-byte conversion ranges, sorted by increasing diff --git a/sal/textenc/tenchelp.hxx b/sal/textenc/tenchelp.hxx index 901156730da5..655641ab606c 100644 --- a/sal/textenc/tenchelp.hxx +++ b/sal/textenc/tenchelp.hxx @@ -73,14 +73,14 @@ typedef void (* ImplResetUnicodeContextProc)(void * pContext); struct ImplTextConverter { void const * mpConvertData; - ImplConvertToUnicodeProc mpConvertTextToUnicodeProc; - ImplConvertToTextProc mpConvertUnicodeToTextProc; - ImplCreateTextContextProc mpCreateTextToUnicodeContext; - ImplDestroyTextContextProc mpDestroyTextToUnicodeContext; - ImplResetTextContextProc mpResetTextToUnicodeContext; - ImplCreateUnicodeContextProc mpCreateUnicodeToTextContext; - ImplDestroyUnicodeContextProc mpDestroyUnicodeToTextContext; - ImplResetUnicodeContextProc mpResetUnicodeToTextContext; + ImplConvertToUnicodeProc const mpConvertTextToUnicodeProc; + ImplConvertToTextProc const mpConvertUnicodeToTextProc; + ImplCreateTextContextProc const mpCreateTextToUnicodeContext; + ImplDestroyTextContextProc const mpDestroyTextToUnicodeContext; + ImplResetTextContextProc const mpResetTextToUnicodeContext; + ImplCreateUnicodeContextProc const mpCreateUnicodeToTextContext; + ImplDestroyUnicodeContextProc const mpDestroyUnicodeToTextContext; + ImplResetUnicodeContextProc const mpResetUnicodeToTextContext; }; /* ----------------------------- */ @@ -90,13 +90,13 @@ struct ImplTextConverter struct SAL_DLLPUBLIC_RTTI ImplTextEncodingData { ImplTextConverter maConverter; - sal_uInt8 mnMinCharSize; - sal_uInt8 mnMaxCharSize; - sal_uInt8 mnAveCharSize; - sal_uInt8 mnBestWindowsCharset; + sal_uInt8 const mnMinCharSize; + sal_uInt8 const mnMaxCharSize; + sal_uInt8 const mnAveCharSize; + sal_uInt8 const mnBestWindowsCharset; char const * mpBestUnixCharset; char const * mpBestMimeCharset; - sal_uInt32 mnInfoFlags; + sal_uInt32 const mnInfoFlags; }; /* ----------------------------------- */ @@ -105,9 +105,9 @@ struct SAL_DLLPUBLIC_RTTI ImplTextEncodingData struct ImplUniCharTabData { - sal_uInt16 mnUniChar; - unsigned char mnChar; - unsigned char mnChar2; + sal_uInt16 const mnUniChar; + unsigned char const mnChar; + unsigned char const mnChar2; // to cater for mappings like MS1258 with 1--2 bytes per Unicode char, // 0 if unused }; @@ -116,18 +116,18 @@ struct ImplByteConvertData { const sal_uInt16* mpToUniTab1; const sal_uInt16* mpToUniTab2; - unsigned char mnToUniStart1; - unsigned char mnToUniEnd1; - unsigned char mnToUniStart2; - unsigned char mnToUniEnd2; + unsigned char const mnToUniStart1; + unsigned char const mnToUniEnd1; + unsigned char const mnToUniStart2; + unsigned char const mnToUniEnd2; const unsigned char* mpToCharTab1; const unsigned char* mpToCharTab2; const ImplUniCharTabData* mpToCharExTab; - sal_uInt16 mnToCharStart1; - sal_uInt16 mnToCharEnd1; - sal_uInt16 mnToCharStart2; - sal_uInt16 mnToCharEnd2; - sal_uInt16 mnToCharExCount; + sal_uInt16 const mnToCharStart1; + sal_uInt16 const mnToCharEnd1; + sal_uInt16 const mnToCharStart2; + sal_uInt16 const mnToCharEnd2; + sal_uInt16 const mnToCharExCount; }; /* ----------------------------------- */ @@ -136,32 +136,32 @@ struct ImplByteConvertData struct ImplDBCSEUDCData { - unsigned char mnLeadStart; - unsigned char mnLeadEnd; - unsigned char mnTrail1Start; - unsigned char mnTrail1End; - unsigned char mnTrail2Start; - unsigned char mnTrail2End; - unsigned char mnTrail3Start; - unsigned char mnTrail3End; - unsigned char mnTrailCount; - sal_uInt16 mnTrailRangeCount; - sal_uInt16 mnUniStart; - sal_uInt16 mnUniEnd; + unsigned char const mnLeadStart; + unsigned char const mnLeadEnd; + unsigned char const mnTrail1Start; + unsigned char const mnTrail1End; + unsigned char const mnTrail2Start; + unsigned char const mnTrail2End; + unsigned char const mnTrail3Start; + unsigned char const mnTrail3End; + unsigned char const mnTrailCount; + sal_uInt16 const mnTrailRangeCount; + sal_uInt16 const mnUniStart; + sal_uInt16 const mnUniEnd; }; struct ImplDBCSToUniLeadTab { - sal_uInt16 mnUniChar; - sal_uInt8 mnTrailStart; - sal_uInt8 mnTrailEnd; + sal_uInt16 const mnUniChar; + sal_uInt8 const mnTrailStart; + sal_uInt8 const mnTrailEnd; const sal_uInt16* mpToUniTrailTab; }; struct ImplUniToDBCSHighTab { - sal_uInt8 mnLowStart; - sal_uInt8 mnLowEnd; + sal_uInt8 const mnLowStart; + sal_uInt8 const mnLowEnd; const sal_uInt16* mpToUniTrailTab; }; @@ -169,12 +169,12 @@ struct ImplDBCSConvertData { const ImplDBCSToUniLeadTab* mpToUniLeadTab; const ImplUniToDBCSHighTab* mpToDBCSHighTab; - unsigned char mnLeadStart; - unsigned char mnLeadEnd; - unsigned char mnTrailStart; - unsigned char mnTrailEnd; + unsigned char const mnLeadStart; + unsigned char const mnLeadEnd; + unsigned char const mnTrailStart; + unsigned char const mnTrailEnd; const ImplDBCSEUDCData* mpEUDCTab; - sal_uInt16 mnEUDCCount; + sal_uInt16 const mnEUDCCount; }; /* ---------------------------------- */ diff --git a/sal/textenc/tencinfo.cxx b/sal/textenc/tencinfo.cxx index 1e285652e080..91b98c056f68 100644 --- a/sal/textenc/tencinfo.cxx +++ b/sal/textenc/tencinfo.cxx @@ -105,7 +105,7 @@ static bool Impl_matchString( const char* pCompStr, const char* pMatchStr ) struct ImplStrCharsetDef { const char* mpCharsetStr; - rtl_TextEncoding meTextEncoding; + rtl_TextEncoding const meTextEncoding; }; struct ImplStrFirstPartCharsetDef |