1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-09 20:46:09 +02:00

list-objects: mark unused callback parameters

Our graph-traversal functions take callbacks for showing commits and
objects, but not all callbacks need each parameter.  Likewise for the
similar traverse_bitmap_commit_list(), which has a different interface
but serves the same purpose. And the include_check mechanism, which
passes along a void pointer which is not always used.

Mark the unused ones to to make -Wunused-parameter happy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2023-02-24 01:39:22 -05:00 committed by Junio C Hamano
parent 9ec03b59a8
commit c50dca2a18
4 changed files with 22 additions and 17 deletions

View File

@ -1590,7 +1590,7 @@ static int add_object_entry(const struct object_id *oid, enum object_type type,
static int add_object_entry_from_bitmap(const struct object_id *oid,
enum object_type type,
int flags, uint32_t name_hash,
int flags UNUSED, uint32_t name_hash,
struct packed_git *pack, off_t offset)
{
display_progress(progress_state, ++nr_seen);
@ -3464,7 +3464,7 @@ static void add_cruft_object_entry(const struct object_id *oid, enum object_type
return;
}
static void show_cruft_object(struct object *obj, const char *name, void *data)
static void show_cruft_object(struct object *obj, const char *name, void *data UNUSED)
{
/*
* if we did not record it earlier, it's at least as old as our
@ -3484,7 +3484,7 @@ static void show_cruft_commit(struct commit *commit, void *data)
show_cruft_object((struct object*)commit, NULL, data);
}
static int cruft_include_check_obj(struct object *obj, void *data)
static int cruft_include_check_obj(struct object *obj, void *data UNUSED)
{
return !has_object_kept_pack(&obj->oid, IN_CORE_KEEP_PACKS);
}
@ -3663,7 +3663,7 @@ static void read_object_list_from_stdin(void)
}
}
static void show_commit(struct commit *commit, void *data)
static void show_commit(struct commit *commit, void *data UNUSED)
{
add_object_entry(&commit->object.oid, OBJ_COMMIT, NULL, 0);
@ -3674,7 +3674,8 @@ static void show_commit(struct commit *commit, void *data)
propagate_island_marks(commit);
}
static void show_object(struct object *obj, const char *name, void *data)
static void show_object(struct object *obj, const char *name,
void *data UNUSED)
{
add_preferred_base_object(name);
add_object_entry(&obj->oid, obj->type, name, 0);

View File

@ -362,11 +362,11 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
static int show_object_fast(
const struct object_id *oid,
enum object_type type,
int exclude,
uint32_t name_hash,
struct packed_git *found_pack,
off_t found_offset)
enum object_type type UNUSED,
int exclude UNUSED,
uint32_t name_hash UNUSED,
struct packed_git *found_pack UNUSED,
off_t found_offset UNUSED)
{
fprintf(stdout, "%s\n", oid_to_hex(oid));
return 1;

View File

@ -951,7 +951,8 @@ static void show_object(struct object *object, const char *name, void *data_)
bitmap_set(data->base, bitmap_pos);
}
static void show_commit(struct commit *commit, void *data)
static void show_commit(struct commit *commit UNUSED,
void *data UNUSED)
{
}
@ -1940,7 +1941,8 @@ static void test_bitmap_type(struct bitmap_test_data *tdata,
type_name(bitmap_type));
}
static void test_show_object(struct object *object, const char *name,
static void test_show_object(struct object *object,
const char *name UNUSED,
void *data)
{
struct bitmap_test_data *tdata = data;

View File

@ -48,7 +48,9 @@ static int add_one_ref(const char *path, const struct object_id *oid,
* The traversal will have already marked us as SEEN, so we
* only need to handle any progress reporting here.
*/
static void mark_object(struct object *obj, const char *name, void *data)
static void mark_object(struct object *obj UNUSED,
const char *name UNUSED,
void *data)
{
update_progress(data);
}
@ -202,10 +204,10 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs,
static int mark_object_seen(const struct object_id *oid,
enum object_type type,
int exclude,
uint32_t name_hash,
struct packed_git *found_pack,
off_t found_offset)
int exclude UNUSED,
uint32_t name_hash UNUSED,
struct packed_git *found_pack UNUSED,
off_t found_offset UNUSED)
{
struct object *obj = lookup_object_by_type(the_repository, oid, type);
if (!obj)