compat/regex/regexec.c: Fix some sparse warnings
Sparse issues an "Using plain integer as NULL pointer" warning along with two "symbol was not declared. Should it be static?" type warnings for the 'merge_state_with_log' and 'find_recover_state' functions. In order to suppress the warnings, we replace the use of '0' as a null pointer constant with NULL and add the static modifier to the function definitions. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
b75cdfaa88
commit
5b62e6374a
|
@ -2313,7 +2313,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the state_log if we need */
|
/* Update the state_log if we need */
|
||||||
re_dfastate_t *
|
static re_dfastate_t *
|
||||||
internal_function
|
internal_function
|
||||||
merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
|
merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
|
||||||
re_dfastate_t *next_state)
|
re_dfastate_t *next_state)
|
||||||
|
@ -2326,7 +2326,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
|
||||||
mctx->state_log[cur_idx] = next_state;
|
mctx->state_log[cur_idx] = next_state;
|
||||||
mctx->state_log_top = cur_idx;
|
mctx->state_log_top = cur_idx;
|
||||||
}
|
}
|
||||||
else if (mctx->state_log[cur_idx] == 0)
|
else if (mctx->state_log[cur_idx] == NULL)
|
||||||
{
|
{
|
||||||
mctx->state_log[cur_idx] = next_state;
|
mctx->state_log[cur_idx] = next_state;
|
||||||
}
|
}
|
||||||
|
@ -2392,7 +2392,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
|
||||||
/* Skip bytes in the input that correspond to part of a
|
/* Skip bytes in the input that correspond to part of a
|
||||||
multi-byte match, then look in the log for a state
|
multi-byte match, then look in the log for a state
|
||||||
from which to restart matching. */
|
from which to restart matching. */
|
||||||
re_dfastate_t *
|
static re_dfastate_t *
|
||||||
internal_function
|
internal_function
|
||||||
find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
|
find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue