mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00: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:
parent
9ec03b59a8
commit
c50dca2a18
4 changed files with 22 additions and 17 deletions
|
@ -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,
|
static int add_object_entry_from_bitmap(const struct object_id *oid,
|
||||||
enum object_type type,
|
enum object_type type,
|
||||||
int flags, uint32_t name_hash,
|
int flags UNUSED, uint32_t name_hash,
|
||||||
struct packed_git *pack, off_t offset)
|
struct packed_git *pack, off_t offset)
|
||||||
{
|
{
|
||||||
display_progress(progress_state, ++nr_seen);
|
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;
|
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
|
* 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);
|
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);
|
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);
|
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);
|
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_preferred_base_object(name);
|
||||||
add_object_entry(&obj->oid, obj->type, name, 0);
|
add_object_entry(&obj->oid, obj->type, name, 0);
|
||||||
|
|
|
@ -362,11 +362,11 @@ static int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
|
||||||
|
|
||||||
static int show_object_fast(
|
static int show_object_fast(
|
||||||
const struct object_id *oid,
|
const struct object_id *oid,
|
||||||
enum object_type type,
|
enum object_type type UNUSED,
|
||||||
int exclude,
|
int exclude UNUSED,
|
||||||
uint32_t name_hash,
|
uint32_t name_hash UNUSED,
|
||||||
struct packed_git *found_pack,
|
struct packed_git *found_pack UNUSED,
|
||||||
off_t found_offset)
|
off_t found_offset UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "%s\n", oid_to_hex(oid));
|
fprintf(stdout, "%s\n", oid_to_hex(oid));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -951,7 +951,8 @@ static void show_object(struct object *object, const char *name, void *data_)
|
||||||
bitmap_set(data->base, bitmap_pos);
|
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));
|
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)
|
void *data)
|
||||||
{
|
{
|
||||||
struct bitmap_test_data *tdata = data;
|
struct bitmap_test_data *tdata = data;
|
||||||
|
|
12
reachable.c
12
reachable.c
|
@ -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
|
* The traversal will have already marked us as SEEN, so we
|
||||||
* only need to handle any progress reporting here.
|
* 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);
|
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,
|
static int mark_object_seen(const struct object_id *oid,
|
||||||
enum object_type type,
|
enum object_type type,
|
||||||
int exclude,
|
int exclude UNUSED,
|
||||||
uint32_t name_hash,
|
uint32_t name_hash UNUSED,
|
||||||
struct packed_git *found_pack,
|
struct packed_git *found_pack UNUSED,
|
||||||
off_t found_offset)
|
off_t found_offset UNUSED)
|
||||||
{
|
{
|
||||||
struct object *obj = lookup_object_by_type(the_repository, oid, type);
|
struct object *obj = lookup_object_by_type(the_repository, oid, type);
|
||||||
if (!obj)
|
if (!obj)
|
||||||
|
|
Loading…
Reference in a new issue