Skip to content

Commit 2b30d66

Browse files
committed
Merge branch 'jk/mark-unused-parameters'
Mark unused parameters as UNUSED to squelch -Wunused warnings. * jk/mark-unused-parameters: t-hashmap: stop calling setup() for t_intern() test scalar: mark unused parameters in dummy function daemon: mark unused parameters in non-posix fallbacks setup: mark unused parameter in config callback test-mergesort: mark unused parameters in trivial callback t-hashmap: mark unused parameters in callback function reftable: mark unused parameters in virtual functions reftable: drop obsolete test function declarations reftable: ignore unused argc/argv in test functions unit-tests: ignore unused argc/argv t/helper: mark more unused argv/argc arguments oss-fuzz: mark unused argv/argc argument refs: mark unused parameters in do_for_each_reflog_helper() refs: mark unused parameters in ref_store fsck callbacks update-ref: mark more unused parameters in parser callbacks imap-send: mark unused parameter in ssl_socket_connect() fallback
2 parents 2ff26d2 + a6bcb3c commit 2b30d66

36 files changed

+81
-73
lines changed

builtin/update-ref.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static void parse_cmd_update(struct ref_transaction *transaction,
274274
}
275275

276276
static void parse_cmd_symref_update(struct ref_transaction *transaction,
277-
const char *next, const char *end)
277+
const char *next, const char *end UNUSED)
278278
{
279279
char *refname, *new_target, *old_arg;
280280
char *old_target = NULL;
@@ -360,7 +360,7 @@ static void parse_cmd_create(struct ref_transaction *transaction,
360360

361361

362362
static void parse_cmd_symref_create(struct ref_transaction *transaction,
363-
const char *next, const char *end)
363+
const char *next, const char *end UNUSED)
364364
{
365365
struct strbuf err = STRBUF_INIT;
366366
char *refname, *new_target;
@@ -423,7 +423,7 @@ static void parse_cmd_delete(struct ref_transaction *transaction,
423423

424424

425425
static void parse_cmd_symref_delete(struct ref_transaction *transaction,
426-
const char *next, const char *end)
426+
const char *next, const char *end UNUSED)
427427
{
428428
struct strbuf err = STRBUF_INIT;
429429
char *refname, *old_target;
@@ -479,7 +479,7 @@ static void parse_cmd_verify(struct ref_transaction *transaction,
479479
}
480480

481481
static void parse_cmd_symref_verify(struct ref_transaction *transaction,
482-
const char *next, const char *end)
482+
const char *next, const char *end UNUSED)
483483
{
484484
struct strbuf err = STRBUF_INIT;
485485
struct object_id old_oid;

daemon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,13 +1177,13 @@ static int service_loop(struct socketlist *socklist)
11771177

11781178
struct credentials;
11791179

1180-
static void drop_privileges(struct credentials *cred)
1180+
static void drop_privileges(struct credentials *cred UNUSED)
11811181
{
11821182
/* nothing */
11831183
}
11841184

1185-
static struct credentials *prepare_credentials(const char *user_name,
1186-
const char *group_name)
1185+
static struct credentials *prepare_credentials(const char *user_name UNUSED,
1186+
const char *group_name UNUSED)
11871187
{
11881188
die("--user not supported on this platform");
11891189
}

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static void socket_perror(const char *func, struct imap_socket *sock, int ret)
192192

193193
#ifdef NO_OPENSSL
194194
static int ssl_socket_connect(struct imap_socket *sock UNUSED,
195-
const struct imap_server_conf *cfg,
195+
const struct imap_server_conf *cfg UNUSED,
196196
int use_tls_only UNUSED)
197197
{
198198
fprintf(stderr, "SSL requested but SSL support not compiled in\n");

oss-fuzz/dummy-cmd-main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* executed.
99
*/
1010

11-
int cmd_main(int argc, const char **argv) {
11+
int cmd_main(int argc UNUSED, const char **argv UNUSED) {
1212
BUG("We should not execute cmd_main() from a fuzz target");
1313
return 1;
1414
}

refs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,9 +2392,10 @@ struct do_for_each_reflog_help {
23922392
void *cb_data;
23932393
};
23942394

2395-
static int do_for_each_reflog_helper(const char *refname, const char *referent,
2395+
static int do_for_each_reflog_helper(const char *refname,
2396+
const char *referent UNUSED,
23962397
const struct object_id *oid UNUSED,
2397-
int flags,
2398+
int flags UNUSED,
23982399
void *cb_data)
23992400
{
24002401
struct do_for_each_reflog_help *hp = cb_data;

refs/packed-backend.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,8 +1735,8 @@ static struct ref_iterator *packed_reflog_iterator_begin(struct ref_store *ref_s
17351735
return empty_ref_iterator_begin();
17361736
}
17371737

1738-
static int packed_fsck(struct ref_store *ref_store,
1739-
struct fsck_options *o)
1738+
static int packed_fsck(struct ref_store *ref_store UNUSED,
1739+
struct fsck_options *o UNUSED)
17401740
{
17411741
return 0;
17421742
}

refs/reftable-backend.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static struct reftable_ref_iterator *ref_iterator_for_stack(struct reftable_ref_
616616

617617
static struct ref_iterator *reftable_be_iterator_begin(struct ref_store *ref_store,
618618
const char *prefix,
619-
const char **exclude_patterns,
619+
const char **exclude_patterns UNUSED,
620620
unsigned int flags)
621621
{
622622
struct reftable_ref_iterator *main_iter, *worktree_iter;
@@ -1125,9 +1125,9 @@ static int reftable_be_transaction_prepare(struct ref_store *ref_store,
11251125
return ret;
11261126
}
11271127

1128-
static int reftable_be_transaction_abort(struct ref_store *ref_store,
1128+
static int reftable_be_transaction_abort(struct ref_store *ref_store UNUSED,
11291129
struct ref_transaction *transaction,
1130-
struct strbuf *err)
1130+
struct strbuf *err UNUSED)
11311131
{
11321132
struct reftable_transaction_data *tx_data = transaction->backend_data;
11331133
free_transaction_data(tx_data);
@@ -1317,7 +1317,7 @@ static int write_transaction_table(struct reftable_writer *writer, void *cb_data
13171317
return ret;
13181318
}
13191319

1320-
static int reftable_be_transaction_finish(struct ref_store *ref_store,
1320+
static int reftable_be_transaction_finish(struct ref_store *ref_store UNUSED,
13211321
struct ref_transaction *transaction,
13221322
struct strbuf *err)
13231323
{
@@ -1728,8 +1728,8 @@ static int reftable_reflog_iterator_advance(struct ref_iterator *ref_iterator)
17281728
return ITER_OK;
17291729
}
17301730

1731-
static int reftable_reflog_iterator_peel(struct ref_iterator *ref_iterator,
1732-
struct object_id *peeled)
1731+
static int reftable_reflog_iterator_peel(struct ref_iterator *ref_iterator UNUSED,
1732+
struct object_id *peeled UNUSED)
17331733
{
17341734
BUG("reftable reflog iterator cannot be peeled");
17351735
return -1;
@@ -1990,7 +1990,7 @@ static int write_reflog_existence_table(struct reftable_writer *writer,
19901990

19911991
static int reftable_be_create_reflog(struct ref_store *ref_store,
19921992
const char *refname,
1993-
struct strbuf *errmsg)
1993+
struct strbuf *errmsg UNUSED)
19941994
{
19951995
struct reftable_ref_store *refs =
19961996
reftable_be_downcast(ref_store, REF_STORE_WRITE, "create_reflog");
@@ -2311,8 +2311,8 @@ static int reftable_be_reflog_expire(struct ref_store *ref_store,
23112311
return ret;
23122312
}
23132313

2314-
static int reftable_be_fsck(struct ref_store *ref_store,
2315-
struct fsck_options *o)
2314+
static int reftable_be_fsck(struct ref_store *ref_store UNUSED,
2315+
struct fsck_options *o UNUSED)
23162316
{
23172317
return 0;
23182318
}

reftable/block_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static void test_block_read_write(void)
116116
}
117117
}
118118

119-
int block_test_main(int argc, const char *argv[])
119+
int block_test_main(int argc UNUSED, const char *argv[] UNUSED)
120120
{
121121
RUN_TEST(test_block_read_write);
122122
return 0;

reftable/blocksource.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ license that can be found in the LICENSE file or at
1313
#include "reftable-blocksource.h"
1414
#include "reftable-error.h"
1515

16-
static void strbuf_return_block(void *b, struct reftable_block *dest)
16+
static void strbuf_return_block(void *b UNUSED, struct reftable_block *dest)
1717
{
1818
if (dest->len)
1919
memset(dest->data, 0xff, dest->len);
2020
reftable_free(dest->data);
2121
}
2222

23-
static void strbuf_close(void *b)
23+
static void strbuf_close(void *b UNUSED)
2424
{
2525
}
2626

@@ -55,7 +55,7 @@ void block_source_from_strbuf(struct reftable_block_source *bs,
5555
bs->arg = buf;
5656
}
5757

58-
static void malloc_return_block(void *b, struct reftable_block *dest)
58+
static void malloc_return_block(void *b UNUSED, struct reftable_block *dest)
5959
{
6060
if (dest->len)
6161
memset(dest->data, 0xff, dest->len);
@@ -85,7 +85,7 @@ static uint64_t file_size(void *b)
8585
return ((struct file_block_source *)b)->size;
8686
}
8787

88-
static void file_return_block(void *b, struct reftable_block *dest)
88+
static void file_return_block(void *b UNUSED, struct reftable_block *dest UNUSED)
8989
{
9090
}
9191

reftable/generic.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,19 @@ int iterator_next(struct reftable_iterator *it, struct reftable_record *rec)
201201
return it->ops->next(it->iter_arg, rec);
202202
}
203203

204-
static int empty_iterator_seek(void *arg, struct reftable_record *want)
204+
static int empty_iterator_seek(void *arg UNUSED,
205+
struct reftable_record *want UNUSED)
205206
{
206207
return 0;
207208
}
208209

209-
static int empty_iterator_next(void *arg, struct reftable_record *rec)
210+
static int empty_iterator_next(void *arg UNUSED,
211+
struct reftable_record *rec UNUSED)
210212
{
211213
return 1;
212214
}
213215

214-
static void empty_iterator_close(void *arg)
216+
static void empty_iterator_close(void *arg UNUSED)
215217
{
216218
}
217219

0 commit comments

Comments
 (0)