Skip to content

Commit b50f370

Browse files
avargitster
authored andcommitted
compat/regex: define out variables only used under RE_ENABLE_I18N
Wrap variables that were only used RE_ENABLE_I18N in `#ifdef RE_ENABLE_I18N`. This eliminates compiler warnings when compiling with NO_REGEX=YesPlease. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent de83172 commit b50f370

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compat/regex/regex_internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,10 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
692692
}
693693
else
694694
{
695+
#ifdef RE_ENABLE_I18N
695696
/* No, skip all characters until IDX. */
696697
int prev_valid_len = pstr->valid_len;
697698

698-
#ifdef RE_ENABLE_I18N
699699
if (BE (pstr->offsets_needed, 0))
700700
{
701701
pstr->len = pstr->raw_len - idx + offset;

compat/regex/regexec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3059,7 +3059,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx,
30593059
const re_dfa_t *const dfa = mctx->dfa;
30603060
int result;
30613061
int cur_idx;
3062+
#ifdef RE_ENABLE_I18N
30623063
reg_errcode_t err = REG_NOERROR;
3064+
#endif
30633065
re_node_set union_set;
30643066
re_node_set_init_empty (&union_set);
30653067
for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)

0 commit comments

Comments
 (0)