Skip to content

Commit 3a58e7d

Browse files
committed
Merge branch 'jk/unused-post-2.40' into seen
* jk/unused-post-2.40: transport: mark unused parameters in fetch_refs_from_bundle() http: mark unused parameter in fill_active_slot() callbacks http: drop unused parameter from start_object_request() mailmap: drop debugging code
2 parents 6c6a79c + b3edf33 commit 3a58e7d

File tree

4 files changed

+11
-47
lines changed

4 files changed

+11
-47
lines changed

http-push.c

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

605605
static int is_running_queue;
606-
static int fill_active_slot(void *unused)
606+
static int fill_active_slot(void *data UNUSED)
607607
{
608608
struct transfer_request *request;
609609

http-walker.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ static void fetch_alternates(struct walker *walker, const char *base);
5353

5454
static void process_object_response(void *callback_data);
5555

56-
static void start_object_request(struct walker *walker,
57-
struct object_request *obj_req)
56+
static void start_object_request(struct object_request *obj_req)
5857
{
5958
struct active_request_slot *slot;
6059
struct http_object_request *req;
@@ -111,7 +110,7 @@ static void process_object_response(void *callback_data)
111110
obj_req->repo =
112111
obj_req->repo->next;
113112
release_http_object_request(obj_req->req);
114-
start_object_request(walker, obj_req);
113+
start_object_request(obj_req);
115114
return;
116115
}
117116
}
@@ -128,7 +127,7 @@ static void release_object_request(struct object_request *obj_req)
128127
free(obj_req);
129128
}
130129

131-
static int fill_active_slot(struct walker *walker)
130+
static int fill_active_slot(void *data UNUSED)
132131
{
133132
struct object_request *obj_req;
134133
struct list_head *pos, *tmp, *head = &object_queue_head;
@@ -139,7 +138,7 @@ static int fill_active_slot(struct walker *walker)
139138
if (repo_has_object_file(the_repository, &obj_req->oid))
140139
obj_req->state = COMPLETE;
141140
else {
142-
start_object_request(walker, obj_req);
141+
start_object_request(obj_req);
143142
return 1;
144143
}
145144
}
@@ -614,7 +613,7 @@ struct walker *get_http_walker(const char *url)
614613
walker->cleanup = cleanup;
615614
walker->data = data;
616615

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

619618
return walker;
620619
}

mailmap.c

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
#include "mailmap.h"
44
#include "object-store.h"
55

6-
#define DEBUG_MAILMAP 0
7-
#if DEBUG_MAILMAP
8-
#define debug_mm(...) fprintf(stderr, __VA_ARGS__)
9-
#define debug_str(X) ((X) ? (X) : "(none)")
10-
#else
11-
__attribute__((format (printf, 1, 2)))
12-
static inline void debug_mm(const char *format, ...) {}
13-
static inline const char *debug_str(const char *s) { return s; }
14-
#endif
15-
166
const char *git_mailmap_file;
177
const char *git_mailmap_blob;
188

@@ -30,23 +20,17 @@ struct mailmap_entry {
3020
struct string_list namemap;
3121
};
3222

33-
static void free_mailmap_info(void *p, const char *s)
23+
static void free_mailmap_info(void *p, const char *s UNUSED)
3424
{
3525
struct mailmap_info *mi = (struct mailmap_info *)p;
36-
debug_mm("mailmap: -- complex: '%s' -> '%s' <%s>\n",
37-
s, debug_str(mi->name), debug_str(mi->email));
3826
free(mi->name);
3927
free(mi->email);
4028
free(mi);
4129
}
4230

43-
static void free_mailmap_entry(void *p, const char *s)
31+
static void free_mailmap_entry(void *p, const char *s UNUSED)
4432
{
4533
struct mailmap_entry *me = (struct mailmap_entry *)p;
46-
debug_mm("mailmap: removing entries for <%s>, with %"PRIuMAX" sub-entries\n",
47-
s, (uintmax_t)me->namemap.nr);
48-
debug_mm("mailmap: - simple: '%s' <%s>\n",
49-
debug_str(me->name), debug_str(me->email));
5034

5135
free(me->name);
5236
free(me->email);
@@ -93,8 +77,6 @@ static void add_mapping(struct string_list *map,
9377
}
9478

9579
if (!old_name) {
96-
debug_mm("mailmap: adding (simple) entry for '%s'\n", old_email);
97-
9880
/* Replace current name and new email for simple entry */
9981
if (new_name) {
10082
free(me->name);
@@ -106,15 +88,10 @@ static void add_mapping(struct string_list *map,
10688
}
10789
} else {
10890
struct mailmap_info *mi = xcalloc(1, sizeof(struct mailmap_info));
109-
debug_mm("mailmap: adding (complex) entry for '%s'\n", old_email);
11091
mi->name = xstrdup_or_null(new_name);
11192
mi->email = xstrdup_or_null(new_email);
11293
string_list_insert(&me->namemap, old_name)->util = mi;
11394
}
114-
115-
debug_mm("mailmap: '%s' <%s> -> '%s' <%s>\n",
116-
debug_str(old_name), old_email,
117-
debug_str(new_name), debug_str(new_email));
11895
}
11996

12097
static char *parse_name_and_email(char *buffer, char **name,
@@ -250,11 +227,8 @@ int read_mailmap(struct string_list *map)
250227

251228
void clear_mailmap(struct string_list *map)
252229
{
253-
debug_mm("mailmap: clearing %"PRIuMAX" entries...\n",
254-
(uintmax_t)map->nr);
255230
map->strdup_strings = 1;
256231
string_list_clear_func(map, free_mailmap_entry);
257-
debug_mm("mailmap: cleared\n");
258232
}
259233

260234
/*
@@ -315,10 +289,6 @@ int map_user(struct string_list *map,
315289
struct string_list_item *item;
316290
struct mailmap_entry *me;
317291

318-
debug_mm("map_user: map '%.*s' <%.*s>\n",
319-
(int)*namelen, debug_str(*name),
320-
(int)*emaillen, debug_str(*email));
321-
322292
item = lookup_prefix(map, *email, *emaillen);
323293
if (item) {
324294
me = (struct mailmap_entry *)item->util;
@@ -336,10 +306,8 @@ int map_user(struct string_list *map,
336306
}
337307
if (item) {
338308
struct mailmap_info *mi = (struct mailmap_info *)item->util;
339-
if (mi->name == NULL && mi->email == NULL) {
340-
debug_mm("map_user: -- (no simple mapping)\n");
309+
if (mi->name == NULL && mi->email == NULL)
341310
return 0;
342-
}
343311
if (mi->email) {
344312
*email = mi->email;
345313
*emaillen = strlen(*email);
@@ -348,11 +316,7 @@ int map_user(struct string_list *map,
348316
*name = mi->name;
349317
*namelen = strlen(*name);
350318
}
351-
debug_mm("map_user: to '%.*s' <%.*s>\n",
352-
(int)*namelen, debug_str(*name),
353-
(int)*emaillen, debug_str(*email));
354319
return 1;
355320
}
356-
debug_mm("map_user: --\n");
357321
return 0;
358322
}

transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ static struct ref *get_refs_from_bundle(struct transport *transport,
170170
}
171171

172172
static int fetch_refs_from_bundle(struct transport *transport,
173-
int nr_heads, struct ref **to_fetch)
173+
int nr_heads UNUSED,
174+
struct ref **to_fetch UNUSED)
174175
{
175176
struct bundle_transport_data *data = transport->data;
176177
struct strvec extra_index_pack_args = STRVEC_INIT;

0 commit comments

Comments
 (0)