From: Jim Meyering Date: Fri, 12 Aug 2005 13:16:47 +0000 (+0000) Subject: (re_string_realloc_buffers): Rename local-shadowed X-Git-Tag: CPPI-1_12~178 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=320b71c4d381a792e7c2a5f456055af47605c924;p=thirdparty%2Fcoreutils.git (re_string_realloc_buffers): Rename local-shadowed variable: s/new_array/offsets/. (re_acquire_state) [lint]: Set *err, to avoid warnings in caller. --- diff --git a/lib/regex_internal.c b/lib/regex_internal.c index 779126f67d..ff04abbcf6 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -153,10 +153,10 @@ re_string_realloc_buffers (pstr, new_buf_len) pstr->wcs = new_array; if (pstr->offsets != NULL) { - int *new_array = re_realloc (pstr->offsets, int, new_buf_len); - if (BE (new_array == NULL, 0)) + int *offsets = re_realloc (pstr->offsets, int, new_buf_len); + if (BE (offsets == NULL, 0)) return REG_ESPACE; - pstr->offsets = new_array; + pstr->offsets = offsets; } } #endif /* RE_ENABLE_I18N */ @@ -1423,13 +1423,19 @@ re_acquire_state (err, dfa, nodes) if (hash != state->hash) continue; if (re_node_set_compare (&state->nodes, nodes)) - return state; + { + IF_LINT (*err = REG_NOERROR); + return state; + } } /* There are no appropriate state in the dfa, create the new one. */ new_state = create_ci_newstate (dfa, nodes, hash); if (BE (new_state != NULL, 1)) - return new_state; + { + IF_LINT (*err = REG_NOERROR); + return new_state; + } else { *err = REG_ESPACE; @@ -1458,11 +1464,9 @@ re_acquire_state_context (err, dfa, nodes, context) re_dfastate_t *new_state; struct re_state_table_entry *spot; int i; + *err = REG_NOERROR; if (nodes->nelem == 0) - { - *err = REG_NOERROR; - return NULL; - } + return NULL; hash = calc_state_hash (nodes, context); spot = dfa->state_table + (hash & dfa->state_hash_mask);