@matheusbsbs / matheus-bagliano / commits / b50f37098f
Fork 0

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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Aug 19, 2010 at 18:30 UTC b50f37098fcf7efb097c01daa3d60df8b9704025
2 files changed +3 -1
compat/regex/regex_internal.c
+1 -1
@@ -692,10 +692,10 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
692 }
693 else
694 {
695 +#ifdef RE_ENABLE_I18N
696 /* No, skip all characters until IDX. */
697 int prev_valid_len = pstr->valid_len;
698
698 -#ifdef RE_ENABLE_I18N
699 if (BE (pstr->offsets_needed, 0))
700 {
701 pstr->len = pstr->raw_len - idx + offset;
compat/regex/regexec.c
+2
@@ -3059,7 +3059,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx,
3059 const re_dfa_t *const dfa = mctx->dfa;
3060 int result;
3061 int cur_idx;
3062 +#ifdef RE_ENABLE_I18N
3063 reg_errcode_t err = REG_NOERROR;
3064 +#endif
3065 re_node_set union_set;
3066 re_node_set_init_empty (&union_set);
3067 for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx)