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/LexMarkdown.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/LexMarkdown.cxx')
| -rw-r--r-- | lexers/LexMarkdown.cxx | 24 | 
1 files changed, 12 insertions, 12 deletions
| diff --git a/lexers/LexMarkdown.cxx b/lexers/LexMarkdown.cxx index a587ca845..781f85deb 100644 --- a/lexers/LexMarkdown.cxx +++ b/lexers/LexMarkdown.cxx @@ -60,8 +60,8 @@ static inline bool IsNewline(const int ch) {  }  // True if can follow ch down to the end with possibly trailing whitespace -static bool FollowToLineEnd(const int ch, const int state, const unsigned int endPos, StyleContext &sc) { -    unsigned int i = 0; +static bool FollowToLineEnd(const int ch, const int state, const Sci_PositionU endPos, StyleContext &sc) { +    Sci_PositionU i = 0;      while (sc.GetRelative(++i) == ch)          ;      // Skip over whitespace @@ -78,7 +78,7 @@ static bool FollowToLineEnd(const int ch, const int state, const unsigned int en  // Set the state on text section from current to length characters,  // then set the rest until the newline to default, except for any characters matching token -static void SetStateAndZoom(const int state, const int length, const int token, StyleContext &sc) { +static void SetStateAndZoom(const int state, const Sci_Position length, const int token, StyleContext &sc) {      sc.SetState(state);      sc.Forward(length);      sc.SetState(SCE_MARKDOWN_DEFAULT); @@ -100,11 +100,11 @@ static void SetStateAndZoom(const int state, const int length, const int token,  // Does the previous line have more than spaces and tabs?  static bool HasPrevLineContent(StyleContext &sc) { -    int i = 0; +    Sci_Position i = 0;      // Go back to the previous newline -    while ((--i + (int)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i))) +    while ((--i + (Sci_Position)sc.currentPos) >= 0 && !IsNewline(sc.GetRelative(i)))          ; -    while ((--i + (int)sc.currentPos) >= 0) { +    while ((--i + (Sci_Position)sc.currentPos) >= 0) {          if (IsNewline(sc.GetRelative(i)))              break;          if (!IsASpaceOrTab(sc.GetRelative(i))) @@ -117,9 +117,9 @@ static bool AtTermStart(StyleContext &sc) {      return sc.currentPos == 0 || isspacechar(sc.chPrev);  } -static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) { +static bool IsValidHrule(const Sci_PositionU endPos, StyleContext &sc) {      int count = 1; -    unsigned int i = 0; +    Sci_PositionU i = 0;      for (;;) {          ++i;          int c = sc.GetRelative(i); @@ -145,7 +145,7 @@ static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {  static void ColorizeMarkdownDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,                                 WordList **, Accessor &styler) { -    unsigned int endPos = startPos + length; +    Sci_PositionU endPos = startPos + length;      int precharCount = 0;      // Don't advance on a new loop iteration and retry at the same position.      // Useful in the corner case of having to start at the beginning file position @@ -225,7 +225,7 @@ static void ColorizeMarkdownDoc(Sci_PositionU startPos, Sci_Position length, int          }          else if (sc.state == SCE_MARKDOWN_CODEBK) {              if (sc.atLineStart && sc.Match("~~~")) { -                int i = 1; +                Sci_Position i = 1;                  while (!IsNewline(sc.GetRelative(i)) && sc.currentPos + i < endPos)                      i++;                  sc.Forward(i); @@ -347,8 +347,8 @@ static void ColorizeMarkdownDoc(Sci_PositionU startPos, Sci_Position length, int              }              // Links and Images              if (sc.Match("![") || sc.ch == '[') { -                int i = 0, j = 0, k = 0; -                int len = endPos - sc.currentPos; +                Sci_Position i = 0, j = 0, k = 0; +                Sci_Position len = endPos - sc.currentPos;                  while (i < len && (sc.GetRelative(++i) != ']' || sc.GetRelative(i - 1) == '\\'))                      ;                  if (sc.GetRelative(i) == ']') { | 
