aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexOScript.cxx
diff options
context:
space:
mode:
authorJoe Mueller <unknown>2015-07-30 14:35:17 +1000
committerJoe Mueller <unknown>2015-07-30 14:35:17 +1000
commit58471e908a3b74b27379bb19a13d62cd8d4476b0 (patch)
tree8f61293f34d008fea20584c631d23e58b3fe53aa /lexers/LexOScript.cxx
parent2270ab97445c6f12bd0fddb273ab617fdb421594 (diff)
downloadscintilla-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/LexOScript.cxx')
-rw-r--r--lexers/LexOScript.cxx32
1 files changed, 16 insertions, 16 deletions
diff --git a/lexers/LexOScript.cxx b/lexers/LexOScript.cxx
index d73295292..8d4fe7950 100644
--- a/lexers/LexOScript.cxx
+++ b/lexers/LexOScript.cxx
@@ -374,10 +374,10 @@ static inline bool IsBlockComment(int style) {
return style == SCE_OSCRIPT_BLOCK_COMMENT;
}
-static bool IsLineComment(int line, Accessor &styler) {
- int pos = styler.LineStart(line);
- int eolPos = styler.LineStart(line + 1) - 1;
- for (int i = pos; i < eolPos; i++) {
+static bool IsLineComment(Sci_Position line, Accessor &styler) {
+ Sci_Position pos = styler.LineStart(line);
+ Sci_Position eolPos = styler.LineStart(line + 1) - 1;
+ for (Sci_Position i = pos; i < eolPos; i++) {
char ch = styler[i];
char chNext = styler.SafeGetCharAt(i + 1);
int style = styler.StyleAt(i);
@@ -395,9 +395,9 @@ static inline bool IsPreprocessor(int style) {
style == SCE_OSCRIPT_DOC_COMMENT;
}
-static void GetRangeLowered(unsigned int start, unsigned int end,
- Accessor &styler, char *s, unsigned int len) {
- unsigned int i = 0;
+static void GetRangeLowered(Sci_PositionU start, Sci_PositionU end,
+ Accessor &styler, char *s, 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++;
@@ -405,9 +405,9 @@ static void GetRangeLowered(unsigned int start, unsigned int end,
s[i] = '\0';
}
-static void GetForwardWordLowered(unsigned int start, Accessor &styler,
- char *s, unsigned int len) {
- unsigned int i = 0;
+static void GetForwardWordLowered(Sci_PositionU start, Accessor &styler,
+ char *s, Sci_PositionU len) {
+ Sci_PositionU i = 0;
while (i < len - 1 && IsAlpha(styler.SafeGetCharAt(start + i))) {
s[i] = static_cast<char>(tolower(styler.SafeGetCharAt(start + i)));
i++;
@@ -416,7 +416,7 @@ static void GetForwardWordLowered(unsigned int start, Accessor &styler,
}
static void UpdatePreprocessorFoldLevel(int &levelCurrent,
- unsigned int startPos, Accessor &styler) {
+ Sci_PositionU startPos, Accessor &styler) {
char s[7]; // Size of the longest possible keyword + null.
GetForwardWordLowered(startPos, styler, s, sizeof(s));
@@ -431,8 +431,8 @@ static void UpdatePreprocessorFoldLevel(int &levelCurrent,
}
}
-static void UpdateKeywordFoldLevel(int &levelCurrent, unsigned int lastStart,
- unsigned int currentPos, Accessor &styler) {
+static void UpdateKeywordFoldLevel(int &levelCurrent, Sci_PositionU lastStart,
+ Sci_PositionU currentPos, Accessor &styler) {
char s[9];
GetRangeLowered(lastStart, currentPos, styler, s, sizeof(s));
@@ -456,9 +456,9 @@ static void FoldOScriptDoc(Sci_PositionU startPos, Sci_Position length, int init
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
bool foldPreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0;
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
- int endPos = startPos + length;
+ Sci_Position 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];
@@ -466,7 +466,7 @@ static void FoldOScriptDoc(Sci_PositionU startPos, Sci_Position length, int init
int style = initStyle;
int lastStart = 0;
- for (int i = startPos; i < endPos; i++) {
+ for (Sci_Position i = startPos; i < endPos; i++) {
char ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
int stylePrev = style;