aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-06-03 16:01:15 +0200
committerJunio C Hamano <gitster@pobox.com>2025-06-03 08:30:50 -0700
commit3236e03c666d66ac94379e192eee5c098bcf7758 (patch)
tree87a68476af2b0de11247b37e1a8e38e9b74f44fb
parent2aa9ee7eecc696fe93a8f00b0eb2369de5279aaa (diff)
downloadgit-3236e03c666d66ac94379e192eee5c098bcf7758.tar.xz
builtin/maintenance: fix typedef for function pointers
The typedefs for `maintenance_task_fn` and `maintenance_auto_fn` are somewhat confusingly not true function pointers. As such, any user of those typedefs needs to manually add the pointer to make use of them. Fix this by making these true function pointers. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/gc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index cfbf9d8a2b..447e580084 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -1533,20 +1533,20 @@ static int maintenance_task_incremental_repack(struct maintenance_run_opts *opts
return 0;
}
-typedef int maintenance_task_fn(struct maintenance_run_opts *opts,
- struct gc_config *cfg);
+typedef int (*maintenance_task_fn)(struct maintenance_run_opts *opts,
+ struct gc_config *cfg);
/*
* An auto condition function returns 1 if the task should run
* and 0 if the task should NOT run. See needs_to_gc() for an
* example.
*/
-typedef int maintenance_auto_fn(struct gc_config *cfg);
+typedef int (*maintenance_auto_fn)(struct gc_config *cfg);
struct maintenance_task {
const char *name;
- maintenance_task_fn *fn;
- maintenance_auto_fn *auto_condition;
+ maintenance_task_fn fn;
+ maintenance_auto_fn auto_condition;
};
static const struct maintenance_task tasks[] = {