Skip to content

Commit 5b62e63

Browse files
Ramsay Jonesgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b75cdfa commit 5b62e63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compat/regex/regexec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
23132313
}
23142314

23152315
/* Update the state_log if we need */
2316-
re_dfastate_t *
2316+
static re_dfastate_t *
23172317
internal_function
23182318
merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
23192319
re_dfastate_t *next_state)
@@ -2326,7 +2326,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
23262326
mctx->state_log[cur_idx] = next_state;
23272327
mctx->state_log_top = cur_idx;
23282328
}
2329-
else if (mctx->state_log[cur_idx] == 0)
2329+
else if (mctx->state_log[cur_idx] == NULL)
23302330
{
23312331
mctx->state_log[cur_idx] = next_state;
23322332
}
@@ -2392,7 +2392,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
23922392
/* Skip bytes in the input that correspond to part of a
23932393
multi-byte match, then look in the log for a state
23942394
from which to restart matching. */
2395-
re_dfastate_t *
2395+
static re_dfastate_t *
23962396
internal_function
23972397
find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
23982398
{

0 commit comments

Comments
 (0)