Prepare manual declaration fixups Co-authored-by: NWilson <363415+NWilson@users.noreply.github.com>
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index c1ccc79..acd78f6 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c
@@ -2502,7 +2502,6 @@ get_ucp(PCRE2_SPTR *ptrptr, BOOL utf, BOOL *negptr, uint16_t *ptypeptr, uint16_t *pdataptr, int *errorcodeptr, compile_block *cb) { - uint32_t c; ptrdiff_t i; PCRE2_SIZE bot, top; PCRE2_SPTR ptr = *ptrptr; @@ -2516,6 +2515,7 @@ if (ptr >= cb->end_pattern) goto ERROR_RETURN; + uint32_t c; GETCHARINCTEST(c, ptr); *negptr = FALSE; @@ -2882,9 +2882,9 @@ #ifdef SUPPORT_UNICODE if (utf && is_group) { - uint32_t c; PCRE2_SPTR p = ptr; + uint32_t c; GETCHARINC(c, p); // Peek at next character uint32_t type = UCD_CHARTYPE(c);
diff --git a/src/pcre2_jit_char_inc.h b/src/pcre2_jit_char_inc.h index fdf2a1f..401676c 100644 --- a/src/pcre2_jit_char_inc.h +++ b/src/pcre2_jit_char_inc.h
@@ -322,7 +322,7 @@ xclass_update_min_max(compiler_common *common, PCRE2_SPTR cc, sljit_u32 *min_ptr, sljit_u32 *max_ptr) { - uint32_t type, c; + uint32_t type; sljit_u32 min = *min_ptr; sljit_u32 max = *max_ptr; uint32_t char_list_add; @@ -337,6 +337,7 @@ { type = *cc++; SLJIT_ASSERT(type == XCL_SINGLE || type == XCL_RANGE); + uint32_t c; GETCHARINCTEST(c, cc); if (c < min)
diff --git a/src/pcre2_match.c b/src/pcre2_match.c index 6b7141a..26aeb56 100644 --- a/src/pcre2_match.c +++ b/src/pcre2_match.c
@@ -1281,8 +1281,8 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t ch; Fecode++; + uint32_t ch; GETCHARINC(ch, Fecode); GETCHARINC(fc, Feptr); if (ch == fc) @@ -1857,7 +1857,6 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t d; for (i = 1; i <= Lmin; i++) { if (Feptr >= mb->end_subject) @@ -1866,6 +1865,7 @@ RRETURN(MATCH_NOMATCH); } + uint32_t d; GETCHARINC(d, Feptr); if (Lc == d || Loc == d) RRETURN(MATCH_NOMATCH); @@ -1898,7 +1898,6 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t d; for (;;) { RMATCH(Fecode, RM204); @@ -1912,6 +1911,7 @@ RRETURN(MATCH_NOMATCH); } + uint32_t d; GETCHARINC(d, Feptr); if (Lc == d || Loc == d) RRETURN(MATCH_NOMATCH); @@ -1953,7 +1953,6 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t d; for (i = Lmin; i < Lmax; i++) { int len = 1; @@ -1963,6 +1962,7 @@ break; } + uint32_t d; GETCHARLEN(d, Feptr, len); if (Lc == d || Loc == d) break; @@ -2028,7 +2028,6 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t d; for (i = 1; i <= Lmin; i++) { if (Feptr >= mb->end_subject) @@ -2037,6 +2036,7 @@ RRETURN(MATCH_NOMATCH); } + uint32_t d; GETCHARINC(d, Feptr); if (Lc == d) RRETURN(MATCH_NOMATCH); @@ -2067,7 +2067,6 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t d; for (;;) { RMATCH(Fecode, RM206); @@ -2081,6 +2080,7 @@ RRETURN(MATCH_NOMATCH); } + uint32_t d; GETCHARINC(d, Feptr); if (Lc == d) RRETURN(MATCH_NOMATCH); @@ -2120,7 +2120,6 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t d; for (i = Lmin; i < Lmax; i++) { int len = 1; @@ -2130,6 +2129,7 @@ break; } + uint32_t d; GETCHARLEN(d, Feptr, len); if (Lc == d) break;
diff --git a/src/pcre2_substitute.c b/src/pcre2_substitute.c index 73ea00f..336b6e8 100644 --- a/src/pcre2_substitute.c +++ b/src/pcre2_substitute.c
@@ -221,12 +221,11 @@ #ifdef SUPPORT_UNICODE if (utf) { - uint32_t c, type; - while (ptr < ptrend) { + uint32_t c; GETCHAR(c, ptr); - type = UCD_CHARTYPE(c); + uint32_t type = UCD_CHARTYPE(c); if (type != ucp_Nd && PRIV(ucp_gentype)[type] != ucp_L && c != CHAR_UNDERSCORE) break; ptr++; @@ -359,9 +358,9 @@ while (input < input_end) { - uint32_t ch; unsigned int chlen; + uint32_t ch; GETCHARINCTEST(ch, input); #ifdef SUPPORT_UNICODE