{"thread":{"id":"31610","subject":"[PATCH] test-wildmatch.c: Fix some sparse warnings","startedAt":"2012-09-19T18:13:41Z","lastAt":"2012-09-19T18:13:41Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"199516","messageId":"505A0B55.8060609@ramsay1.demon.co.uk","threadId":"31610","inReplyTo":null,"subject":"[PATCH] test-wildmatch.c: Fix some sparse warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-09-19T18:13:41Z","receivedAt":"2012-09-19T18:13:41Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn particular, sparse complains as follows:\n\n        SP test-wildmatch.c\n    test-wildmatch.c:40:5: warning: symbol 'wildmatch_errors' was not \\\n        declared. Should it be static?\n    test-wildmatch.c:41:6: warning: symbol 'number_separator' was not \\\n        declared. Should it be static?\n    test-wildmatch.c:45:5: warning: symbol 'explode_mod' was not \\\n        declared. Should it be static?\n    test-wildmatch.c:46:5: warning: symbol 'empties_mod' was not \\\n        declared. Should it be static?\n    test-wildmatch.c:47:5: warning: symbol 'empty_at_start' was not \\\n        declared. Should it be static?\n    test-wildmatch.c:48:5: warning: symbol 'empty_at_end' was not \\\n        declared. Should it be static?\n    test-wildmatch.c:49:6: warning: symbol 'empties' was not \\\n        declared. Should it be static?\n\nIn order to suppress the warnings, we simply add the static modifier\nto the declaration of (most of) the above symbols. Note that the\n'number_separator' symbol was not actually used, so we removed the\ndeclaration instead. Also, we add the static modifier to the\n'fnmatch_errors' variable (not noted above because it was #ifdef-ed\nout).\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Nguyen,\n\nIf you need to re-roll your 'nd/wildmatch' branch, could you please\nsquash this patch into the relevent commit(s). Also, I note that two\ncommits have \"compat/wildmatch\" in the subject, but the files are\nat the top level.\n\nThanks!\n\nATB,\nRamsay Jones\n\n test-wildmatch.c | 15 +++++++--------\n 1 file changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/test-wildmatch.c b/test-wildmatch.c\nindex b94921b..bb726c8 100644\n--- a/test-wildmatch.c\n+++ b/test-wildmatch.c\n@@ -34,19 +34,18 @@\n #ifdef COMPARE_WITH_FNMATCH\n #include <fnmatch.h>\n \n-int fnmatch_errors = 0;\n+static int fnmatch_errors = 0;\n #endif\n \n-int wildmatch_errors = 0;\n-char number_separator = ',';\n+static int wildmatch_errors = 0;\n \n typedef char bool;\n \n-int explode_mod = 0;\n-int empties_mod = 0;\n-int empty_at_start = 0;\n-int empty_at_end = 0;\n-char *empties;\n+static int explode_mod = 0;\n+static int empties_mod = 0;\n+static int empty_at_start = 0;\n+static int empty_at_end = 0;\n+static char *empties;\n \n static struct option options[] = {\n   OPT_STRING('e', \"empties\", &empties, \"\", \"\"),\n-- \n1.7.12\n"}]}