submodule-parallel-fetch: make some file local symbols static
PATCH 1/1 submodule-parallel-fetch: make some file local symbols static
---
Hi Stefan,
When you next re-roll the patches for your 'sb/submodule-parallel-fetch' branch, could you please squash parts of this into the relevant patches. [which would correspond to commits a93fb7a ("run-command: add an asynchronous parallel child processor", 22-09-2015) and 58713c8 ("fetch_populated_submodules:
use new parallel job processing", 22-09-2015).]
Thanks!
Also, you might consider renaming some (file local) functions with really long names, to something a little shorter, like (say):
handle_submodule_fetch_start_err -> fetch_start_failure handle_submodule_fetch_finish -> fetch_finish
(but, as I have said several times, I'm not good at naming things ... ;-)
Also, you could move the definition of get_next_submodule() to be above/before fetch_populated_submodules() so that you can remove the forward declaration.
[Note these issues were spotted by sparse and static-check.pl]
HTH
ATB,
Ramsay Jones
run-command.c | 12 ++++++------ submodule.c | 12 ++++++------ test-run-command.c | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-)
run-command.c +6 -6
@@ -902,9 +902,9 @@ struct parallel_processes {struct strbuf buffered_output;/* of finished children */ }; -void default_start_failure (void *data, -struct child_process *cp, -struct strbuf *err) +static void default_start_failure (void *data, +struct child_process *cp, +struct strbuf *err) {int i;struct strbuf sb =STRBUF_INIT ;
@@ -915,9 +915,9 @@ void default_start_failure(void *data,die_errno ("Starting a child failed:%s" , sb.buf); } -void default_return_value (void *data, -struct child_process *cp, -int result) +static void default_return_value (void *data, +struct child_process *cp, +int result) {int i;struct strbuf sb =STRBUF_INIT ;
submodule.c +6 -6
@@ -620,16 +620,16 @@ struct submodule_parallel_fetch { };#define SPF_INIT {0, ARGV_ARRAY_INIT, NULL, NULL, 0, 0, 0} -int get_next_submodule (void *data,struct child_process *cp, -struct strbuf *err); +static int get_next_submodule (void *data,struct child_process *cp, +struct strbuf *err); -void handle_submodule_fetch_start_err (void *data,struct child_process *cp,struct strbuf *err) +static void handle_submodule_fetch_start_err (void *data,struct child_process *cp,struct strbuf *err) {struct submodule_parallel_fetch *spf = data; spf->result =1 ; } -void handle_submodule_fetch_finish (void *data,struct child_process *cp,int retvalue) +static void handle_submodule_fetch_finish (void *data,struct child_process *cp,int retvalue) {struct submodule_parallel_fetch *spf = data;
@@ -673,8 +673,8 @@ out:return spf.result; } -int get_next_submodule (void *data,struct child_process *cp, -struct strbuf *err) +static int get_next_submodule (void *data,struct child_process *cp, +struct strbuf *err) {int ret =0 ;struct submodule_parallel_fetch *spf = data;
test-run-command.c +3 -3
@@ -16,9 +16,9 @@#include <errno.h> static int number_callbacks; -int parallel_next (void *data, -struct child_process *cp, -struct strbuf *err) +static int parallel_next (void *data, +struct child_process *cp, +struct strbuf *err) {struct child_process *d = data;if (number_callbacks >=4 )
Signature · 1 line
2.5.0
Quoted 1 line · Ramsay Jones
[Note these issues were spotted by sparse and static-check.pl]
Any chance you got a link to docs about static-check.pl? I've never heard of this...
Regards,
Jake