]> granicus.if.org Git - vim/commitdiff
patch 8.2.3125: variables are set but not used v8.2.3125
author=?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Thu, 8 Jul 2021 16:05:00 +0000 (18:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 8 Jul 2021 16:05:00 +0000 (18:05 +0200)
Problem:    Variables are set but not used.
Solution:   Move the declarations to the block where they are used.
            (closes #8527)

src/regexp_nfa.c
src/version.c

index 7dff195ea24423bf1837aa49ee98cb2d375bec2e..db629def766f134f01d560d65cb670d9db17e95f 100644 (file)
@@ -1371,8 +1371,6 @@ nfa_regatom(void)
     int                negated;
     int                result;
     int                startc = -1;
-    int                endc = -1;
-    int                oldstartc = -1;
     int                save_prev_at_start = prev_at_start;
 
     c = getchr();
@@ -1838,7 +1836,7 @@ collection:
                 * Failed to recognize a character class. Use the simple
                 * version that turns [abc] into 'a' OR 'b' OR 'c'
                 */
-               startc = endc = oldstartc = -1;
+               startc = -1;
                negated = FALSE;
                if (*regparse == '^')                   // negated range
                {
@@ -1859,7 +1857,8 @@ collection:
                emit_range = FALSE;
                while (regparse < endp)
                {
-                   oldstartc = startc;
+                   int     oldstartc = startc;
+
                    startc = -1;
                    got_coll_char = FALSE;
                    if (*regparse == '[')
@@ -2017,7 +2016,8 @@ collection:
                    // Previous char was '-', so this char is end of range.
                    if (emit_range)
                    {
-                       endc = startc;
+                       int     endc = startc;
+
                        startc = oldstartc;
                        if (startc > endc)
                            EMSG_RET_FAIL(_(e_reverse_range));
index 1fb224326d19a4936347114cd67893d8460ff767..117051ffbbccd6c0ebde7eabfbb26e20fe3783da 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3125,
 /**/
     3124,
 /**/