{"thread":{"id":"8525","subject":"[RFC][PATCH 05/10] Sparse: fix some \"symbol not declared\" warnings (Part 3)","startedAt":"2007-06-08T22:15:01Z","lastAt":"2007-06-08T22:15:01Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"44432","messageId":"4669D4E5.2070702@ramsay1.demon.co.uk","threadId":"8525","inReplyTo":null,"subject":"[RFC][PATCH 05/10] Sparse: fix some \"symbol not declared\" warnings (Part 3)","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2007-06-08T22:15:01Z","receivedAt":"2007-06-08T22:15:01Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThis commit removes this warning, in various ways, for three more\nsymbols, thus:\n\n    - 'common_cmds': this symbol is created by the generate-cmdlist.sh\n      script, so modify the script to include the static keyword in\n      the declaration.\n\n    - 'curl_ftp_no_epsv': add declaration to http.h header file.\n      (Note that it could be declared static in http.c, but so could\n      several other variables in that header; just being consistent)\n\n    - 'wt_status_use_color': add a declaration to the wt-status.h\n      header file, but change the symbol to a function at the same\n      time.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n builtin-runstatus.c |    6 ++----\n generate-cmdlist.sh |    2 +-\n http.h              |    2 +-\n wt-status.c         |   12 +++++++++---\n wt-status.h         |    1 +\n 5 files changed, 14 insertions(+), 9 deletions(-)\n\ndiff --git a/builtin-runstatus.c b/builtin-runstatus.c\nindex d7b04cb..1a9a647 100644\n--- a/builtin-runstatus.c\n+++ b/builtin-runstatus.c\n@@ -2,8 +2,6 @@\n #include \"wt-status.h\"\n #include \"builtin.h\"\n \n-extern int wt_status_use_color;\n-\n static const char runstatus_usage[] =\n \"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]\";\n \n@@ -17,9 +15,9 @@ int cmd_runstatus(int argc, const char **argv, const char *prefix)\n \n \tfor (i = 1; i < argc; i++) {\n \t\tif (!strcmp(argv[i], \"--color\"))\n-\t\t\twt_status_use_color = 1;\n+\t\t\twt_status_use_color(1);\n \t\telse if (!strcmp(argv[i], \"--nocolor\"))\n-\t\t\twt_status_use_color = 0;\n+\t\t\twt_status_use_color(0);\n \t\telse if (!strcmp(argv[i], \"--amend\")) {\n \t\t\ts.amend = 1;\n \t\t\ts.reference = \"HEAD^1\";\ndiff --git a/generate-cmdlist.sh b/generate-cmdlist.sh\nindex 975777f..17df47b 100755\n--- a/generate-cmdlist.sh\n+++ b/generate-cmdlist.sh\n@@ -7,7 +7,7 @@ struct cmdname_help\n     char help[80];\n };\n \n-struct cmdname_help common_cmds[] = {\"\n+static struct cmdname_help common_cmds[] = {\"\n \n sort <<\\EOF |\n add\ndiff --git a/http.h b/http.h\nindex 69b6b66..9070e6f 100644\n--- a/http.h\n+++ b/http.h\n@@ -99,9 +99,9 @@ extern char *ssl_capath;\n extern char *ssl_cainfo;\n extern long curl_low_speed_limit;\n extern long curl_low_speed_time;\n+extern int curl_ftp_no_epsv;\n \n extern struct curl_slist *pragma_header;\n-extern struct curl_slist *no_range_header;\n \n extern struct active_request_slot *active_queue_head;\n \ndiff --git a/wt-status.c b/wt-status.c\nindex fd8a877..9fa9100 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -8,7 +8,7 @@\n #include \"revision.h\"\n #include \"diffcore.h\"\n \n-int wt_status_use_color = 0;\n+static int use_color = 0;\n static char wt_status_colors[][COLOR_MAXLEN] = {\n \t\"\",         /* WT_STATUS_HEADER: normal */\n \t\"\\033[32m\", /* WT_STATUS_UPDATED: green */\n@@ -39,7 +39,7 @@ static int parse_status_slot(const char *var, int offset)\n \n static const char* color(int slot)\n {\n-\treturn wt_status_use_color ? wt_status_colors[slot] : \"\";\n+\treturn use_color ? wt_status_colors[slot] : \"\";\n }\n \n void wt_status_prepare(struct wt_status *s)\n@@ -349,7 +349,7 @@ void wt_status_print(struct wt_status *s)\n int git_status_config(const char *k, const char *v)\n {\n \tif (!strcmp(k, \"status.color\") || !strcmp(k, \"color.status\")) {\n-\t\twt_status_use_color = git_config_colorbool(k, v);\n+\t\tuse_color = git_config_colorbool(k, v);\n \t\treturn 0;\n \t}\n \tif (!prefixcmp(k, \"status.color.\") || !prefixcmp(k, \"color.status.\")) {\n@@ -358,3 +358,9 @@ int git_status_config(const char *k, const char *v)\n \t}\n \treturn git_default_config(k, v);\n }\n+\n+void wt_status_use_color(int please)\n+{\n+\tuse_color = please;\n+}\n+\ndiff --git a/wt-status.h b/wt-status.h\nindex cfea4ae..dd4421a 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -24,5 +24,6 @@ struct wt_status {\n int git_status_config(const char *var, const char *value);\n void wt_status_prepare(struct wt_status *s);\n void wt_status_print(struct wt_status *s);\n+void wt_status_use_color(int please);\n \n #endif /* STATUS_H */\n-- \n1.5.2\n"}]}