http: mark unused parameter in fill_active_slot() callbacks

We have a generic "fill" function that is used by both the dumb http push and fetch code paths. It takes a void parameter in case the caller wants to pass along extra data, but (since the previous commit) neither does so. So we could simply drop the extra parameter. But since it's good practice to provide a void pointer for in callback functions, we'll leave it here for the future, and just annotate it as unused (to appease -Wunused-parameter). While we're marking it, let's also fix the type in http-walker's function to have the correct "void" type. The original had to cast the function pointer and was technically undefined behavior (though generally OK in practice). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Mar 17, 2023 at 15:17 UTC 1e5e0974964170a917d6950dda74e82745ab65aa
2 files changed +3 -3
http-push.c
+1 -1
@@ -602,7 +602,7 @@ static void finish_request(struct transfer_request *request)
602 }
603
604 static int is_running_queue;
605 -static int fill_active_slot(void *unused)
605 +static int fill_active_slot(void *data UNUSED)
606 {
607 struct transfer_request *request;
608
http-walker.c
+2 -2
@@ -127,7 +127,7 @@ static void release_object_request(struct object_request *obj_req)
127 free(obj_req);
128 }
129
130 -static int fill_active_slot(struct walker *walker)
130 +static int fill_active_slot(void *data UNUSED)
131 {
132 struct object_request *obj_req;
133 struct list_head *pos, *tmp, *head = &object_queue_head;
@@ -613,7 +613,7 @@ struct walker *get_http_walker(const char *url)
613 walker->cleanup = cleanup;
614 walker->data = data;
615
616 - add_fill_function(walker, (int (*)(void *)) fill_active_slot);
616 + add_fill_function(NULL, fill_active_slot);
617
618 return walker;
619 }