comparison src/regexp_nfa.c @ 25178:0797c8ce343d v8.2.3125

patch 8.2.3125: variables are set but not used Commit: https://github.com/vim/vim/commit/09f688c33aad9692276dfb68842cf0621a0e2002 Author: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com> Date: Thu Jul 8 18:05:00 2021 +0200 patch 8.2.3125: variables are set but not used Problem: Variables are set but not used. Solution: Move the declarations to the block where they are used. (closes #8527)
author Bram Moolenaar <Bram@vim.org>
date Thu, 08 Jul 2021 18:15:03 +0200
parents 10b269321459
children 078edc1821bf
comparison
equal deleted inserted replaced
25177:fb75b9b1bd3e 25178:0797c8ce343d
1369 int extra = 0; 1369 int extra = 0;
1370 int emit_range; 1370 int emit_range;
1371 int negated; 1371 int negated;
1372 int result; 1372 int result;
1373 int startc = -1; 1373 int startc = -1;
1374 int endc = -1;
1375 int oldstartc = -1;
1376 int save_prev_at_start = prev_at_start; 1374 int save_prev_at_start = prev_at_start;
1377 1375
1378 c = getchr(); 1376 c = getchr();
1379 switch (c) 1377 switch (c)
1380 { 1378 {
1836 } 1834 }
1837 /* 1835 /*
1838 * Failed to recognize a character class. Use the simple 1836 * Failed to recognize a character class. Use the simple
1839 * version that turns [abc] into 'a' OR 'b' OR 'c' 1837 * version that turns [abc] into 'a' OR 'b' OR 'c'
1840 */ 1838 */
1841 startc = endc = oldstartc = -1; 1839 startc = -1;
1842 negated = FALSE; 1840 negated = FALSE;
1843 if (*regparse == '^') // negated range 1841 if (*regparse == '^') // negated range
1844 { 1842 {
1845 negated = TRUE; 1843 negated = TRUE;
1846 MB_PTR_ADV(regparse); 1844 MB_PTR_ADV(regparse);
1857 } 1855 }
1858 // Emit the OR branches for each character in the [] 1856 // Emit the OR branches for each character in the []
1859 emit_range = FALSE; 1857 emit_range = FALSE;
1860 while (regparse < endp) 1858 while (regparse < endp)
1861 { 1859 {
1862 oldstartc = startc; 1860 int oldstartc = startc;
1861
1863 startc = -1; 1862 startc = -1;
1864 got_coll_char = FALSE; 1863 got_coll_char = FALSE;
1865 if (*regparse == '[') 1864 if (*regparse == '[')
1866 { 1865 {
1867 // Check for [: :], [= =], [. .] 1866 // Check for [: :], [= =], [. .]
2015 startc = PTR2CHAR(regparse); 2014 startc = PTR2CHAR(regparse);
2016 2015
2017 // Previous char was '-', so this char is end of range. 2016 // Previous char was '-', so this char is end of range.
2018 if (emit_range) 2017 if (emit_range)
2019 { 2018 {
2020 endc = startc; 2019 int endc = startc;
2020
2021 startc = oldstartc; 2021 startc = oldstartc;
2022 if (startc > endc) 2022 if (startc > endc)
2023 EMSG_RET_FAIL(_(e_reverse_range)); 2023 EMSG_RET_FAIL(_(e_reverse_range));
2024 2024
2025 if (endc > startc + 2) 2025 if (endc > startc + 2)