Skip to content

Commit 3c50c88

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

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

builtin/notes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ static void free_note_data(struct note_data *d)
113113
}
114114

115115
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)
118119
{
119120
printf("%s %s\n", oid_to_hex(note_oid), oid_to_hex(object_oid));
120121
return 0;

notes.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ static int write_each_non_note_until(const char *note_path,
752752
return 0;
753753
}
754754

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,
756756
const struct object_id *note_oid, char *note_path,
757757
void *cb_data)
758758
{
@@ -780,8 +780,9 @@ struct note_delete_list {
780780
};
781781

782782
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)
785786
{
786787
struct note_delete_list **l = (struct note_delete_list **) cb_data;
787788
struct note_delete_list *n;
@@ -848,8 +849,8 @@ int combine_notes_overwrite(struct object_id *cur_oid,
848849
return 0;
849850
}
850851

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)
853854
{
854855
return 0;
855856
}

0 commit comments

Comments
 (0)