diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-22 08:35:01 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-22 08:35:01 +1000 |
commit | 8f9a43df028d13c1bc6654aa6dcf66dd542843d2 (patch) | |
tree | 677c3aae65caee744f4ce00478f40dcfec7147bc /lexlib | |
parent | afcd6f1fa748f2ade19010b3307c341b382818de (diff) | |
download | scintilla-mirror-8f9a43df028d13c1bc6654aa6dcf66dd542843d2.tar.gz |
Backport: Remove casts between char and unsigned char where possible.
Backport of changeset 6731:8e06234817c0.
Diffstat (limited to 'lexlib')
-rw-r--r-- | lexlib/LexAccessor.h | 2 | ||||
-rw-r--r-- | lexlib/StyleContext.cxx | 6 | ||||
-rw-r--r-- | lexlib/WordList.cxx | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 30dadcabe..48097e279 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -109,7 +109,7 @@ public: return true; } char StyleAt(Sci_Position position) const { - return static_cast<char>(pAccess->StyleAt(position)); + return pAccess->StyleAt(position); } Sci_Position GetLine(Sci_Position position) const { return pAccess->LineFromPosition(position); diff --git a/lexlib/StyleContext.cxx b/lexlib/StyleContext.cxx index ba73fbf8f..683e21453 100644 --- a/lexlib/StyleContext.cxx +++ b/lexlib/StyleContext.cxx @@ -26,8 +26,8 @@ bool StyleContext::MatchIgnoreCase(const char *s) { return false; s++; for (int n = 2; *s; n++) { - if (static_cast<unsigned char>(*s) != - MakeLowerCase(static_cast<unsigned char>(styler.SafeGetCharAt(currentPos + n, 0)))) + if (*s != + MakeLowerCase(styler.SafeGetCharAt(currentPos + n, 0))) return false; s++; } @@ -58,7 +58,7 @@ static void getRangeLowered(Sci_PositionU start, Sci_PositionU len) { Sci_PositionU i = 0; while ((i < end - start + 1) && (i < len-1)) { - s[i] = static_cast<char>(tolower(styler[start + i])); + s[i] = MakeLowerCase(styler[start + i]); i++; } s[i] = '\0'; diff --git a/lexlib/WordList.cxx b/lexlib/WordList.cxx index 425bcc01a..954689ef7 100644 --- a/lexlib/WordList.cxx +++ b/lexlib/WordList.cxx @@ -113,7 +113,7 @@ static int cmpWords(const void *a, const void *b) { } static void SortWordList(char **words, unsigned int len) { - qsort(static_cast<void *>(words), len, sizeof(*words), cmpWords); + qsort(words, len, sizeof(*words), cmpWords); } #endif @@ -147,7 +147,7 @@ bool WordList::InList(const char *s) const { const unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { - while (static_cast<unsigned char>(words[j][0]) == firstChar) { + while (words[j][0] == firstChar) { if (s[1] == words[j][1]) { const char *a = words[j] + 1; const char *b = s + 1; @@ -189,7 +189,7 @@ bool WordList::InListAbbreviated(const char *s, const char marker) const { const unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { - while (static_cast<unsigned char>(words[j][0]) == firstChar) { + while (words[j][0] == firstChar) { bool isSubword = false; int start = 1; if (words[j][1] == marker) { @@ -243,7 +243,7 @@ bool WordList::InListAbridged(const char *s, const char marker) const { const unsigned char firstChar = s[0]; int j = starts[firstChar]; if (j >= 0) { - while (static_cast<unsigned char>(words[j][0]) == firstChar) { + while (words[j][0] == firstChar) { const char *a = words[j]; const char *b = s; while (*a && *a == *b) { |