summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-08-12 13:16:47 +0000
committerJim Meyering <jim@meyering.net>2005-08-12 13:16:47 +0000
commit320b71c4d381a792e7c2a5f456055af47605c924 (patch)
tree2d6e443722686282a99792ec1f671b4fb4375df8 /lib
parent2e2488888927ae97a3b1bb9bc696f4141258ea73 (diff)
downloadcoreutils-320b71c4d381a792e7c2a5f456055af47605c924.tar.xz
(re_string_realloc_buffers): Rename local-shadowed
variable: s/new_array/offsets/. (re_acquire_state) [lint]: Set *err, to avoid warnings in caller.
Diffstat (limited to 'lib')
-rw-r--r--lib/regex_internal.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index 779126f67..ff04abbcf 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);