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>

Ramsay Jones committed Apr 27, 2013 at 19:43 UTC 5b62e6374aabb20297b22bdd72952ff582b2198b
1 file changed +3 -3
compat/regex/regexec.c
+3 -3
@@ -2313,7 +2313,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
2313 }
2314
2315 /* Update the state_log if we need */
2316 -re_dfastate_t *
2316 +static re_dfastate_t *
2317 internal_function
2318 merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
2319 re_dfastate_t *next_state)
@@ -2326,7 +2326,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
2326 mctx->state_log[cur_idx] = next_state;
2327 mctx->state_log_top = cur_idx;
2328 }
2329 - else if (mctx->state_log[cur_idx] == 0)
2329 + else if (mctx->state_log[cur_idx] == NULL)
2330 {
2331 mctx->state_log[cur_idx] = next_state;
2332 }
@@ -2392,7 +2392,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
2392 /* Skip bytes in the input that correspond to part of a
2393 multi-byte match, then look in the log for a state
2394 from which to restart matching. */
2395 -re_dfastate_t *
2395 +static re_dfastate_t *
2396 internal_function
2397 find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
2398 {