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>
Patrick Steinhardt committed
Jun 3, 2025 at 16:01 UTC
3236e03c666d66ac94379e192eee5c098bcf7758
1 file changed
+5
-5
builtin/gc.c
+5
-5
@@ -1533,20 +1533,20 @@ static int maintenance_task_incremental_repack(struct maintenance_run_opts *opts
1533
return 0;
1534
}
1535
1536
-typedef int maintenance_task_fn(struct maintenance_run_opts *opts,
1537
- struct gc_config *cfg);
1536
+typedef int (*maintenance_task_fn)(struct maintenance_run_opts *opts,
1537
+ struct gc_config *cfg);
1538
1539
/*
1540
* An auto condition function returns 1 if the task should run
1541
* and 0 if the task should NOT run. See needs_to_gc() for an
1542
* example.
1543
*/
1544
-typedef int maintenance_auto_fn(struct gc_config *cfg);
1544
+typedef int (*maintenance_auto_fn)(struct gc_config *cfg);
1545
1546
struct maintenance_task {
1547
const char *name;
1548
- maintenance_task_fn *fn;
1549
- maintenance_auto_fn *auto_condition;
1548
+ maintenance_task_fn fn;
1549
+ maintenance_auto_fn auto_condition;
1550
};
1551
1552
static const struct maintenance_task tasks[] = {