{"thread":{"id":"40431","subject":"[PATCH] submodule-parallel-fetch: make some file local symbols static","startedAt":"2015-09-25T15:15:24Z","lastAt":"2015-09-25T15:40:38Z","messageCount":2,"participants":["Ramsay Jones","Jacob Keller"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"270751","messageId":"5605650C.2000809@ramsayjones.plus.com","threadId":"40431","inReplyTo":null,"subject":"[PATCH] submodule-parallel-fetch: make some file local symbols static","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2015-09-25T15:15:24Z","receivedAt":"2015-09-25T15:15:24Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Stefan,\n\nWhen you next re-roll the patches for your\n'sb/submodule-parallel-fetch' branch, could you please squash\nparts of this into the relevant patches. [which would correspond\nto commits a93fb7a (\"run-command: add an asynchronous parallel\nchild processor\", 22-09-2015) and 58713c8 (\"fetch_populated_submodules:\nuse new parallel job processing\", 22-09-2015).]\n\nThanks!\n\nAlso, you might consider renaming some (file local) functions with\nreally long names, to something a little shorter, like (say):\n\n  handle_submodule_fetch_start_err -> fetch_start_failure\n  handle_submodule_fetch_finish -> fetch_finish\n\n(but, as I have said several times, I'm not good at naming things ... ;-)\n\nAlso, you could move the definition of get_next_submodule() to be\nabove/before fetch_populated_submodules() so that you can remove the\nforward declaration.\n\n[Note these issues were spotted by sparse and static-check.pl]\n\nHTH\n\nATB,\nRamsay Jones\n\n\n run-command.c      | 12 ++++++------\n submodule.c        | 12 ++++++------\n test-run-command.c |  6 +++---\n 3 files changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/run-command.c b/run-command.c\nindex 528a4fb..6ca0151 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -902,9 +902,9 @@ struct parallel_processes {\n \tstruct strbuf buffered_output; /* of finished children */\n };\n \n-void default_start_failure(void *data,\n-\t\t\t   struct child_process *cp,\n-\t\t\t   struct strbuf *err)\n+static void default_start_failure(void *data,\n+\t\t\t\t  struct child_process *cp,\n+\t\t\t\t  struct strbuf *err)\n {\n \tint i;\n \tstruct strbuf sb = STRBUF_INIT;\n@@ -915,9 +915,9 @@ void default_start_failure(void *data,\n \tdie_errno(\"Starting a child failed:%s\", sb.buf);\n }\n \n-void default_return_value(void *data,\n-\t\t\t  struct child_process *cp,\n-\t\t\t  int result)\n+static void default_return_value(void *data,\n+\t\t\t\t struct child_process *cp,\n+\t\t\t\t int result)\n {\n \tint i;\n \tstruct strbuf sb = STRBUF_INIT;\ndiff --git a/submodule.c b/submodule.c\nindex f362d6a..d786a76 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -620,16 +620,16 @@ struct submodule_parallel_fetch {\n };\n #define SPF_INIT {0, ARGV_ARRAY_INIT, NULL, NULL, 0, 0, 0}\n \n-int get_next_submodule(void *data, struct child_process *cp,\n-\t\t       struct strbuf *err);\n+static int get_next_submodule(void *data, struct child_process *cp,\n+\t\t\t      struct strbuf *err);\n \n-void handle_submodule_fetch_start_err(void *data, struct child_process *cp, struct strbuf *err)\n+static void handle_submodule_fetch_start_err(void *data, struct child_process *cp, struct strbuf *err)\n {\n \tstruct submodule_parallel_fetch *spf = data;\n \tspf->result = 1;\n }\n \n-void handle_submodule_fetch_finish( void *data, struct child_process *cp, int retvalue)\n+static void handle_submodule_fetch_finish( void *data, struct child_process *cp, int retvalue)\n {\n \tstruct submodule_parallel_fetch *spf = data;\n \n@@ -673,8 +673,8 @@ out:\n \treturn spf.result;\n }\n \n-int get_next_submodule(void *data, struct child_process *cp,\n-\t\t       struct strbuf *err)\n+static int get_next_submodule(void *data, struct child_process *cp,\n+\t\t\t      struct strbuf *err)\n {\n \tint ret = 0;\n \tstruct submodule_parallel_fetch *spf = data;\ndiff --git a/test-run-command.c b/test-run-command.c\nindex 94c6eee..2555791 100644\n--- a/test-run-command.c\n+++ b/test-run-command.c\n@@ -16,9 +16,9 @@\n #include <errno.h>\n \n static int number_callbacks;\n-int parallel_next(void *data,\n-\t\t  struct child_process *cp,\n-\t\t  struct strbuf *err)\n+static int parallel_next(void *data,\n+\t\t\t struct child_process *cp,\n+\t\t\t struct strbuf *err)\n {\n \tstruct child_process *d = data;\n \tif (number_callbacks >= 4)\n-- \n2.5.0\n"},{"id":"270752","messageId":"CA+P7+xoPtpt_=1vf4OKaDSt5E4AYkPapkUp94-f=WaytbHdv0g@mail.gmail.com","threadId":"40431","inReplyTo":"5605650C.2000809@ramsayjones.plus.com","subject":"Re: [PATCH] submodule-parallel-fetch: make some file local symbols static","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2015-09-25T15:40:38Z","receivedAt":"2015-09-25T15:40:38Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Fri, Sep 25, 2015 at 8:15 AM, Ramsay Jones\n<ramsay@ramsayjones.plus.com> wrote:\n> [Note these issues were spotted by sparse and static-check.pl]\n\nAny chance you got a link to docs about static-check.pl? I've never\nheard of this...\n\nRegards,\nJake\n"}]}