Skip to content

Commit 30c5679

Browse files
committed
isUTF8_CHAR: Rename variables in macro
It is better to use a name that is less likely to occur outside the macro, as perlhacktips explains.
1 parent 9dc4d08 commit 30c5679

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

inline.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,7 +2229,7 @@ Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
22292229
* immediately after it.
22302230
*/
22312231

2232-
#define DFA_RETURN_SUCCESS_ return s - s0
2232+
#define DFA_RETURN_SUCCESS_ return (s8dfa_ - s0)
22332233
#define DFA_RETURN_FAILURE_ return 0
22342234
#ifdef HAS_EXTRA_LONG_UTF8
22352235
# define DFA_TEASE_APART_FF_ goto tease_apart_FF
@@ -2242,15 +2242,15 @@ Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
22422242
reject_action, \
22432243
incomplete_char_action) \
22442244
STMT_START { \
2245-
const U8 * s = s0; \
2246-
const U8 * const e_ = e; \
2245+
const U8 * s8dfa_ = s0; \
2246+
const U8 * const e8dfa_ = e; \
22472247
UV state = 0; \
22482248
\
2249-
PERL_NON_CORE_CHECK_EMPTY(s, e_); \
2249+
PERL_NON_CORE_CHECK_EMPTY(s8dfa_, e8dfa_); \
22502250
\
22512251
do { \
2252-
state = dfa_tab[256 + state + dfa_tab[*s]]; \
2253-
s++; \
2252+
state = dfa_tab[256 + state + dfa_tab[*s8dfa_]]; \
2253+
s8dfa_++; \
22542254
\
22552255
if (state == 0) { /* Accepting state */ \
22562256
accept_action; \
@@ -2259,7 +2259,7 @@ Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el)
22592259
if (UNLIKELY(state == 1)) { /* Rejecting state */ \
22602260
reject_action; \
22612261
} \
2262-
} while (s < e_); \
2262+
} while (s8dfa_ < e8dfa_); \
22632263
\
22642264
/* Here, dropped out of loop before end-of-char */ \
22652265
incomplete_char_action; \

0 commit comments

Comments
 (0)