comphelper/source/misc/syntaxhighlight.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
New commits: commit 0f9855eab1acf3b8b98e76b27d8b74f4544132cf Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed Jul 9 16:50:36 2025 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Jul 10 09:57:10 2025 +0200 const up comphelper syntax arrays Change-Id: Ie7b210f131f81ade2ff07ef663ede52252b4fda3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187585 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index 89dcb73752e4..60994e997540 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -52,7 +52,7 @@ namespace o3tl { // ########################################################################## // ATTENTION: all these words need to be in lower case // ########################################################################## -static const char* strListBasicKeyWords[] = { +const char* const strListBasicKeyWords[] = { "access", "alias", "and", @@ -185,8 +185,7 @@ static const char* strListBasicKeyWords[] = { "xor" }; - -static const char* strListSqlKeyWords[] = { +const char* const strListSqlKeyWords[] = { "all", "and", "any", @@ -251,7 +250,6 @@ static const char* strListSqlKeyWords[] = { "where" }; - extern "C" { static int compare_strings( const void *arg1, const void *arg2 ) @@ -283,7 +281,7 @@ class SyntaxHighlighter::Tokenizer bool getNextToken(std::u16string_view::const_iterator& pos, std::u16string_view::const_iterator end, /*out*/TokenType& reType, /*out*/std::u16string_view::const_iterator& rpStartPos, /*out*/std::u16string_view::const_iterator& rpEndPos) const; - const char** ppListKeyWords; + const char* const* ppListKeyWords; sal_uInt16 nKeyWordCount; public: @@ -293,7 +291,7 @@ public: void getHighlightPortions(std::u16string_view rLine, /*out*/std::vector<HighlightPortion>& portions) const; - void setKeyWords( const char** ppKeyWords, sal_uInt16 nCount ); + void setKeyWords( const char* const* ppKeyWords, sal_uInt16 nCount ); }; // Helper function: test character flag @@ -312,7 +310,7 @@ bool SyntaxHighlighter::Tokenizer::testCharFlags(sal_Unicode c, CharFlags nTestF return bRet; } -void SyntaxHighlighter::Tokenizer::setKeyWords( const char** ppKeyWords, sal_uInt16 nCount ) +void SyntaxHighlighter::Tokenizer::setKeyWords( const char* const* ppKeyWords, sal_uInt16 nCount ) { ppListKeyWords = ppKeyWords; nKeyWordCount = nCount;