From cda15af9657880e91ccf65603e109b202d9e78bf Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 6 Apr 2017 21:04:37 +1000 Subject: Added const where possible. --- lexlib/WordList.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lexlib/WordList.cxx') diff --git a/lexlib/WordList.cxx b/lexlib/WordList.cxx index 2f673397f..895fdf7dc 100644 --- a/lexlib/WordList.cxx +++ b/lexlib/WordList.cxx @@ -34,7 +34,7 @@ static char **ArrayFromWordList(char *wordlist, int *len, bool onlyLineEnds = fa wordSeparator[static_cast('\t')] = true; } for (int j = 0; wordlist[j]; j++) { - int curr = static_cast(wordlist[j]); + const int curr = static_cast(wordlist[j]); if (!wordSeparator[curr] && wordSeparator[prev]) words++; prev = curr; @@ -143,7 +143,7 @@ void WordList::Set(const char *s) { bool WordList::InList(const char *s) const { if (0 == words) return false; - unsigned char firstChar = s[0]; + const unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { while (static_cast(words[j][0]) == firstChar) { @@ -185,7 +185,7 @@ bool WordList::InList(const char *s) const { bool WordList::InListAbbreviated(const char *s, const char marker) const { if (0 == words) return false; - unsigned char firstChar = s[0]; + const unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { while (static_cast(words[j][0]) == firstChar) { @@ -239,7 +239,7 @@ bool WordList::InListAbbreviated(const char *s, const char marker) const { bool WordList::InListAbridged(const char *s, const char marker) const { if (0 == words) return false; - unsigned char firstChar = s[0]; + const unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { while (static_cast(words[j][0]) == firstChar) { -- cgit v1.2.3