From 96229bb5f01e86efe382523e1ee79ff23bdcc8e0 Mon Sep 17 00:00:00 2001 From: Joe Mueller Date: Thu, 30 Jul 2015 14:35:17 +1000 Subject: Use Sci_Position / Sci_PositionU for variables in lexers that represent positions and line numbers and may be widened to 64-bits in a future release. --- lexers/LexPLM.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lexers/LexPLM.cxx') diff --git a/lexers/LexPLM.cxx b/lexers/LexPLM.cxx index 3783508b9..e306685d6 100644 --- a/lexers/LexPLM.cxx +++ b/lexers/LexPLM.cxx @@ -24,12 +24,12 @@ using namespace Scintilla; #endif -static void GetRange(unsigned int start, - unsigned int end, +static void GetRange(Sci_PositionU start, + Sci_PositionU end, Accessor &styler, char *s, - unsigned int len) { - unsigned int i = 0; + Sci_PositionU len) { + Sci_PositionU i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(tolower(styler[start + i])); i++; @@ -43,13 +43,13 @@ static void ColourisePlmDoc(Sci_PositionU startPos, WordList *keywordlists[], Accessor &styler) { - unsigned int endPos = startPos + length; + Sci_PositionU endPos = startPos + length; int state = initStyle; styler.StartAt(startPos); styler.StartSegment(startPos); - for (unsigned int i = startPos; i < endPos; i++) { + for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = styler.SafeGetCharAt(i); char chNext = styler.SafeGetCharAt(i + 1); @@ -99,7 +99,7 @@ static void ColourisePlmDoc(Sci_PositionU startPos, if (!isdigit(ch) && !isalpha(ch) && ch != '$') { // Get the entire identifier. char word[1024]; - int segmentStart = styler.GetStartSegment(); + Sci_Position segmentStart = styler.GetStartSegment(); GetRange(segmentStart, i - 1, styler, word, sizeof(word)); i--; @@ -133,17 +133,17 @@ static void FoldPlmDoc(Sci_PositionU startPos, { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; - unsigned int endPos = startPos + length; + Sci_PositionU endPos = startPos + length; int visibleChars = 0; - int lineCurrent = styler.GetLine(startPos); + Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; - int startKeyword = 0; + Sci_Position startKeyword = 0; - for (unsigned int i = startPos; i < endPos; i++) { + for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; -- cgit v1.2.3