{"thread":{"id":"33639","subject":"[PATCH 3/6] compat/regex/regexec.c: Fix some sparse warnings","startedAt":"2013-04-27T18:43:05Z","lastAt":"2013-04-27T18:43:05Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"215723","messageId":"517C1C39.2060508@ramsay1.demon.co.uk","threadId":"33639","inReplyTo":null,"subject":"[PATCH 3/6] compat/regex/regexec.c: Fix some sparse warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-04-27T18:43:05Z","receivedAt":"2013-04-27T18:43:05Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSparse issues an \"Using plain integer as NULL pointer\" warning along\nwith two \"symbol was not declared. Should it be static?\" type warnings\nfor the 'merge_state_with_log' and 'find_recover_state' functions.\n\nIn order to suppress the warnings, we replace the use of '0' as a null\npointer constant with NULL and add the static modifier to the function\ndefinitions.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n compat/regex/regexec.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/compat/regex/regexec.c b/compat/regex/regexec.c\nindex 0194965..0cd6e0e 100644\n--- a/compat/regex/regexec.c\n+++ b/compat/regex/regexec.c\n@@ -2313,7 +2313,7 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,\n }\n \n /* Update the state_log if we need */\n-re_dfastate_t *\n+static re_dfastate_t *\n internal_function\n merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,\n \t\t      re_dfastate_t *next_state)\n@@ -2326,7 +2326,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,\n       mctx->state_log[cur_idx] = next_state;\n       mctx->state_log_top = cur_idx;\n     }\n-  else if (mctx->state_log[cur_idx] == 0)\n+  else if (mctx->state_log[cur_idx] == NULL)\n     {\n       mctx->state_log[cur_idx] = next_state;\n     }\n@@ -2392,7 +2392,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,\n /* Skip bytes in the input that correspond to part of a\n    multi-byte match, then look in the log for a state\n    from which to restart matching.  */\n-re_dfastate_t *\n+static re_dfastate_t *\n internal_function\n find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)\n {\n-- \n1.8.2\n"}]}