From b50f37098fcf7efb097c01daa3d60df8b9704025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 19 Aug 2010 18:30:01 +0000 Subject: compat/regex: define out variables only used under RE_ENABLE_I18N MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- compat/regex/regex_internal.c | 2 +- compat/regex/regexec.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'compat/regex') diff --git a/compat/regex/regex_internal.c b/compat/regex/regex_internal.c index dad17a8131..193854cf5b 100644 --- a/compat/regex/regex_internal.c +++ b/compat/regex/regex_internal.c @@ -692,10 +692,10 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) } else { +#ifdef RE_ENABLE_I18N /* No, skip all characters until IDX. */ int prev_valid_len = pstr->valid_len; -#ifdef RE_ENABLE_I18N if (BE (pstr->offsets_needed, 0)) { pstr->len = pstr->raw_len - idx + offset; diff --git a/compat/regex/regexec.c b/compat/regex/regexec.c index aee502d299..0c2b054bce 100644 --- a/compat/regex/regexec.c +++ b/compat/regex/regexec.c @@ -3059,7 +3059,9 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, int str_idx, const re_dfa_t *const dfa = mctx->dfa; int result; int cur_idx; +#ifdef RE_ENABLE_I18N reg_errcode_t err = REG_NOERROR; +#endif re_node_set union_set; re_node_set_init_empty (&union_set); for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) -- cgit v1.2.3