notes: mark unused callback parameters
for_each_note() requires a callback, but not all callbacks need all of the parameters. Likewise, init_notes() takes a callback to implement the "combine" strategy, but the "ignore" variant obviously doesn't look at its arguments at all. Mark unused parameters as appropriate to silence compiler warnings. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Feb 24, 2023 at 01:39 UTC
3c50c88f426dddd6c4cb1c1ae847a1eddd5eafee
2 files changed
+9
-7
builtin/notes.c
+3
-2
@@ -113,8 +113,9 @@ static void free_note_data(struct note_data *d)
113
}
114
115
static int list_each_note(const struct object_id *object_oid,
116
- const struct object_id *note_oid, char *note_path,
117
- void *cb_data)
116
+ const struct object_id *note_oid,
117
+ char *note_path UNUSED,
118
+ void *cb_data UNUSED)
119
{
120
printf("%s %s\n", oid_to_hex(note_oid), oid_to_hex(object_oid));
121
return 0;
notes.c
+6
-5
@@ -752,7 +752,7 @@ static int write_each_non_note_until(const char *note_path,
752
return 0;
753
}
754
755
-static int write_each_note(const struct object_id *object_oid,
755
+static int write_each_note(const struct object_id *object_oid UNUSED,
756
const struct object_id *note_oid, char *note_path,
757
void *cb_data)
758
{
@@ -780,8 +780,9 @@ struct note_delete_list {
780
};
781
782
static int prune_notes_helper(const struct object_id *object_oid,
783
- const struct object_id *note_oid, char *note_path,
784
- void *cb_data)
783
+ const struct object_id *note_oid UNUSED,
784
+ char *note_path UNUSED,
785
+ void *cb_data)
786
{
787
struct note_delete_list **l = (struct note_delete_list **) cb_data;
788
struct note_delete_list *n;
@@ -848,8 +849,8 @@ int combine_notes_overwrite(struct object_id *cur_oid,
849
return 0;
850
}
851
851
-int combine_notes_ignore(struct object_id *cur_oid,
852
- const struct object_id *new_oid)
852
+int combine_notes_ignore(struct object_id *cur_oid UNUSED,
853
+ const struct object_id *new_oid UNUSED)
854
{
855
return 0;
856
}