diff options
author | Joe Mueller <unknown> | 2015-07-30 14:35:17 +1000 |
---|---|---|
committer | Joe Mueller <unknown> | 2015-07-30 14:35:17 +1000 |
commit | 58471e908a3b74b27379bb19a13d62cd8d4476b0 (patch) | |
tree | 8f61293f34d008fea20584c631d23e58b3fe53aa /lexers/LexTAL.cxx | |
parent | 2270ab97445c6f12bd0fddb273ab617fdb421594 (diff) | |
download | scintilla-mirror-58471e908a3b74b27379bb19a13d62cd8d4476b0.tar.gz |
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.
Diffstat (limited to 'lexers/LexTAL.cxx')
-rw-r--r-- | lexers/LexTAL.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lexers/LexTAL.cxx b/lexers/LexTAL.cxx index 403a05686..e7f28eaaa 100644 --- a/lexers/LexTAL.cxx +++ b/lexers/LexTAL.cxx @@ -45,12 +45,12 @@ inline bool isTALwordstart(char ch) return ch == '$' || ch == '^' || iswordstart(ch); } -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<char>(tolower(styler[start + i])); i++; @@ -65,7 +65,7 @@ static bool IsStreamCommentStyle(int style) { style == SCE_C_COMMENTDOCKEYWORDERROR; } -static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool bInAsm) { +static void ColourTo(Accessor &styler, Sci_PositionU end, unsigned int attr, bool bInAsm) { if ((bInAsm) && (attr == SCE_C_OPERATOR || attr == SCE_C_NUMBER || attr == SCE_C_DEFAULT || attr == SCE_C_WORD || attr == SCE_C_IDENTIFIER)) { styler.ColourTo(end, SCE_C_REGEX); } else @@ -73,7 +73,7 @@ static void ColourTo(Accessor &styler, unsigned int end, unsigned int attr, bool } // returns 1 if the item starts a class definition, and -1 if the word is "end", and 2 if the word is "asm" -static int classifyWordTAL(unsigned int start, unsigned int end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInAsm) { +static int classifyWordTAL(Sci_PositionU start, Sci_PositionU end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, bool bInAsm) { int ret = 0; WordList& keywords = *keywordlists[0]; @@ -132,11 +132,11 @@ static void ColouriseTALDoc(Sci_PositionU startPos, Sci_Position length, int ini state = SCE_C_DEFAULT; char chPrev = ' '; char chNext = styler[startPos]; - unsigned int lengthDoc = startPos + length; + Sci_PositionU lengthDoc = startPos + length; bool bInClassDefinition; - int currentLine = styler.GetLine(startPos); + Sci_Position currentLine = styler.GetLine(startPos); if (currentLine > 0) { styler.SetLineState(currentLine, styler.GetLineState(currentLine-1)); bInClassDefinition = (styler.GetLineState(currentLine) == 1); @@ -151,7 +151,7 @@ static void ColouriseTALDoc(Sci_PositionU startPos, Sci_Position length, int ini styler.StartSegment(startPos); int visibleChars = 0; - for (unsigned int i = startPos; i < lengthDoc; i++) { + for (Sci_PositionU i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); @@ -244,7 +244,7 @@ static void ColouriseTALDoc(Sci_PositionU startPos, Sci_Position length, int ini if (ch == '!' || (ch == '\r' || ch == '\n')) { if (((i > styler.GetStartSegment() + 2) || ( (initStyle == SCE_C_COMMENTDOC) && - (styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) { + (styler.GetStartSegment() == static_cast<Sci_PositionU>(startPos))))) { ColourTo(styler, i, state, bInAsm); state = SCE_C_DEFAULT; } @@ -273,9 +273,9 @@ static void FoldTALDoc(Sci_PositionU startPos, Sci_Position length, int initStyl bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 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]; @@ -284,9 +284,9 @@ static void FoldTALDoc(Sci_PositionU startPos, Sci_Position length, int initStyl bool was_end = false; bool section = false; - int lastStart = 0; + Sci_Position lastStart = 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; @@ -345,7 +345,7 @@ static void FoldTALDoc(Sci_PositionU startPos, Sci_Position length, int initStyl if (foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (ch == '{' && chNext == '$') { - unsigned int j=i+2; // skip {$ + Sci_PositionU j=i+2; // skip {$ while ((j<endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } |