aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RESearch.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2023-12-27 21:35:25 +1100
committerNeil <nyamatongwe@gmail.com>2023-12-27 21:35:25 +1100
commit93f1b9a2783e96a9f0f9a889f69ea6d1542354e0 (patch)
treef676ee976bdb27669265a239710e7c7cbdf09dcd /src/RESearch.cxx
parentd43efffed7ad01b42cc31b3752f9e582732ebbf3 (diff)
downloadscintilla-mirror-93f1b9a2783e96a9f0f9a889f69ea6d1542354e0.tar.gz
Avoid warnings by initializing, using const, and moving assignment out of if.
Diffstat (limited to 'src/RESearch.cxx')
-rw-r--r--src/RESearch.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/RESearch.cxx b/src/RESearch.cxx
index 5a509ab6e..6f8c675a4 100644
--- a/src/RESearch.cxx
+++ b/src/RESearch.cxx
@@ -502,7 +502,7 @@ const char *RESearch::Compile(const char *pattern, Sci::Position length, bool ca
} else {
i++;
p++;
- int incr;
+ int incr = 0;
c2 = GetBackslashExpression(p, incr);
i += incr;
p += incr;
@@ -537,7 +537,7 @@ const char *RESearch::Compile(const char *pattern, Sci::Position length, bool ca
} else if (*p == '\\' && p[1]) {
i++;
p++;
- int incr;
+ int incr = 0;
const int c = GetBackslashExpression(p, incr);
i += incr;
p += incr;
@@ -653,8 +653,8 @@ const char *RESearch::Compile(const char *pattern, Sci::Position length, bool ca
return badpat("Unmatched \\)");
}
} else {
- int incr;
- int c = GetBackslashExpression(p, incr);
+ int incr = 0;
+ const int c = GetBackslashExpression(p, incr);
i += incr;
p += incr;
if (c >= 0) {
@@ -938,8 +938,8 @@ Sci::Position RESearch::PMatch(const CharacterIndexer &ci, Sci::Position lp, Sci
Sci::Position llp = lp; /* lazy lp for LCLO */
Sci::Position e = NOTFOUND; /* extra pointer for CLO */
while (llp >= are) {
- Sci::Position q;
- if ((q = PMatch(ci, llp, endp, ap)) != NOTFOUND) {
+ const Sci::Position q = PMatch(ci, llp, endp, ap);
+ if (q != NOTFOUND) {
e = q;
lp = llp;
if (op != LCLO) return e;