aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cppcheck.suppress2
-rw-r--r--lexers/LexMarkdown.cxx8
-rw-r--r--lexers/LexTxt2tags.cxx8
3 files changed, 8 insertions, 10 deletions
diff --git a/cppcheck.suppress b/cppcheck.suppress
index fe31d215b..f6c54313c 100644
--- a/cppcheck.suppress
+++ b/cppcheck.suppress
@@ -20,7 +20,6 @@ variableScope:scintilla/lexers/LexFortran.cxx
variableScope:scintilla/lexers/LexGui4Cli.cxx
variableScope:scintilla/lexers/LexInno.cxx
variableScope:scintilla/lexers/LexLaTeX.cxx
-variableScope:scintilla/lexers/LexMarkdown.cxx
variableScope:scintilla/lexers/LexMetapost.cxx
variableScope:scintilla/lexers/LexModula.cxx
variableScope:scintilla/lexers/LexNimrod.cxx
@@ -35,7 +34,6 @@ variableScope:scintilla/lexers/LexSpecman.cxx
unreadVariable:scintilla/lexers/LexSpice.cxx
invalidscanf:scintilla/lexers/LexTCMD.cxx
variableScope:scintilla/lexers/LexTeX.cxx
-variableScope:scintilla/lexers/LexTxt2tags.cxx
variableScope:scintilla/lexers/LexVHDL.cxx
// Suppress C-style pointer casting for Qt code as won't be changing
diff --git a/lexers/LexMarkdown.cxx b/lexers/LexMarkdown.cxx
index a92697707..c774b736f 100644
--- a/lexers/LexMarkdown.cxx
+++ b/lexers/LexMarkdown.cxx
@@ -118,10 +118,11 @@ static bool AtTermStart(StyleContext &sc) {
}
static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {
- int c, count = 1;
+ int count = 1;
unsigned int i = 0;
- while (++i) {
- c = sc.GetRelative(i);
+ for (;;) {
+ ++i;
+ int c = sc.GetRelative(i);
if (c == sc.ch)
++count;
// hit a terminating character
@@ -140,7 +141,6 @@ static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {
}
}
}
- return false;
}
static void ColorizeMarkdownDoc(unsigned int startPos, int length, int initStyle,
diff --git a/lexers/LexTxt2tags.cxx b/lexers/LexTxt2tags.cxx
index 8f8e181ba..fd4a96c33 100644
--- a/lexers/LexTxt2tags.cxx
+++ b/lexers/LexTxt2tags.cxx
@@ -78,10 +78,11 @@ static bool HasPrevLineContent(StyleContext &sc) {
// Separator line
static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {
- int c, count = 1;
+ int count = 1;
unsigned int i = 0;
- while (++i) {
- c = sc.GetRelative(i);
+ for (;;) {
+ ++i;
+ int c = sc.GetRelative(i);
if (c == sc.ch)
++count;
// hit a terminating character
@@ -100,7 +101,6 @@ static bool IsValidHrule(const unsigned int endPos, StyleContext &sc) {
}
}
}
- return false;
}
static void ColorizeTxt2tagsDoc(unsigned int startPos, int length, int initStyle,