summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-07-19 16:56:19 +0200
committerJunio C Hamano <gitster@pobox.com>2017-07-21 11:58:46 -0700
commitc1e860f1dcd29495f98fc60d68f75151196335e6 (patch)
tree26fc9afa42ffecc6e19979357f8d9678e6c1caf7 /builtin
parent840ed141983718e0c5518a325534a5656797132a (diff)
downloadgit-c1e860f1dcd29495f98fc60d68f75151196335e6.tar.gz
run_processes_parallel: change confusing task_cb conventionjs/run-process-parallel-api-fix
By declaring the task_cb parameter of type `void **`, the signature of the get_next_task method suggests that the "task-specific cookie" can be defined in that method, and the signatures of the start_failure and of the task_finished methods declare that parameter of type `void *`, suggesting that those methods are mere users of said cookie. That convention makes a total lot of sense, because the tasks are pretty much dead when one of the latter two methods is called: there would be little use to reset that cookie at that point because nobody would be able to see the change afterwards. However, this is not what the code actually does. For all three methods, it passes the *address* of pp->children[i].data. As reasoned above, this behavior makes no sense. So let's change the implementation to adhere to the convention suggested by the signatures. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/submodule--helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index dbe5699fe6..b0ca2a548f 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -781,7 +781,7 @@ static int update_clone_task_finished(int result,
const struct cache_entry *ce;
struct submodule_update_clone *suc = suc_cb;
- int *idxP = *(int**)idx_task_cb;
+ int *idxP = idx_task_cb;
int idx = *idxP;
free(idxP);