Skip to content

Commit 1e5e097

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 647edf7 commit 1e5e097

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

http-push.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ static void finish_request(struct transfer_request *request)
602602
}
603603

604604
static int is_running_queue;
605-
static int fill_active_slot(void *unused)
605+
static int fill_active_slot(void *data UNUSED)
606606
{
607607
struct transfer_request *request;
608608

http-walker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void release_object_request(struct object_request *obj_req)
127127
free(obj_req);
128128
}
129129

130-
static int fill_active_slot(struct walker *walker)
130+
static int fill_active_slot(void *data UNUSED)
131131
{
132132
struct object_request *obj_req;
133133
struct list_head *pos, *tmp, *head = &object_queue_head;
@@ -613,7 +613,7 @@ struct walker *get_http_walker(const char *url)
613613
walker->cleanup = cleanup;
614614
walker->data = data;
615615

616-
add_fill_function(walker, (int (*)(void *)) fill_active_slot);
616+
add_fill_function(NULL, fill_active_slot);
617617

618618
return walker;
619619
}

0 commit comments

Comments
 (0)