{"thread":{"id":"29827","subject":"[PATCH] ctype.c: Fix a sparse warning","startedAt":"2012-03-04T19:10:57Z","lastAt":"2012-03-04T19:10:57Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"186044","messageId":"4F53BE41.5000309@ramsay1.demon.co.uk","threadId":"29827","inReplyTo":null,"subject":"[PATCH] ctype.c: Fix a sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-03-04T19:10:57Z","receivedAt":"2012-03-04T19:10:57Z","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 ctype.c\n    ctype.c:30:12: warning: symbol 'tolower_trans_tbl' was not declared.\\\n         Should it be static?\n\nAn appropriate extern declaration for the 'tolower_trans_tbl' symbol\nis included in the \"cache.h\" header file. In order to suppress the\nwarning, therefore, we could replace the \"git-compat-util.h\" header\ninclusion with \"cache.h\", since \"cache.h\" includes \"git-compat-util.h\"\nin turn. Here, however, we choose to move the extern declaration for\n'tolower_trans_tbl' into \"git-compat-util.h\", alongside the other\nextern declaration from ctype.c for 'sane_ctype'.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Junio,\n\nCould you please squash this, or something like it, into\ncommit 0f871cf5 (\"grep: use static trans-case table\",28-02-2012).\n\nThanks!\n\nATB,\nRamsay Jones\n\n cache.h           |    3 ---\n git-compat-util.h |    3 +++\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 9765b87..9d7bf3d 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1285,7 +1285,4 @@ extern struct startup_info *startup_info;\n /* builtin/merge.c */\n int checkout_fast_forward(const unsigned char *from, const unsigned char *to);\n \n-/* in ctype.c, for kwset users */\n-extern const char tolower_trans_tbl[256];\n-\n #endif /* CACHE_H */\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 426ae43..ed11ad8 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -457,6 +457,9 @@ static inline int has_extension(const char *filename, const char *ext)\n \treturn len > extlen && !memcmp(filename + len - extlen, ext, extlen);\n }\n \n+/* in ctype.c, for kwset users */\n+extern const char tolower_trans_tbl[256];\n+\n /* Sane ctype - no locale, and works with signed chars */\n #undef isascii\n #undef isspace\n-- \n1.7.9\n"}]}