]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http: mark unused parameter in fill_active_slot() callbacks
authorJeff King <peff@peff.net>
Fri, 17 Mar 2023 19:17:08 +0000 (15:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Mar 2023 21:17:48 +0000 (14:17 -0700)
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>
http-push.c
http-walker.c

index 88aa045ecba453eaab7f56c02c54a972ab07fd7c..2d01b430e74a457b458f13e78f8d5a07c8aa38ae 100644 (file)
@@ -602,7 +602,7 @@ static void finish_request(struct transfer_request *request)
 }
 
 static int is_running_queue;
-static int fill_active_slot(void *unused)
+static int fill_active_slot(void *data UNUSED)
 {
        struct transfer_request *request;
 
index 065a03d262bb751e4677f031738fc39abcff4cfa..93a4a98a3d3264cd04a5f3f5bf06b1fa503ff896 100644 (file)
@@ -127,7 +127,7 @@ static void release_object_request(struct object_request *obj_req)
        free(obj_req);
 }
 
-static int fill_active_slot(struct walker *walker)
+static int fill_active_slot(void *data UNUSED)
 {
        struct object_request *obj_req;
        struct list_head *pos, *tmp, *head = &object_queue_head;
@@ -613,7 +613,7 @@ struct walker *get_http_walker(const char *url)
        walker->cleanup = cleanup;
        walker->data = data;
 
-       add_fill_function(walker, (int (*)(void *)) fill_active_slot);
+       add_fill_function(NULL, fill_active_slot);
 
        return walker;
 }