Skip to content

Commit 3236e03

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2aa9ee7 commit 3236e03

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/gc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,20 +1533,20 @@ static int maintenance_task_incremental_repack(struct maintenance_run_opts *opts
15331533
return 0;
15341534
}
15351535

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);
15381538

15391539
/*
15401540
* An auto condition function returns 1 if the task should run
15411541
* and 0 if the task should NOT run. See needs_to_gc() for an
15421542
* example.
15431543
*/
1544-
typedef int maintenance_auto_fn(struct gc_config *cfg);
1544+
typedef int (*maintenance_auto_fn)(struct gc_config *cfg);
15451545

15461546
struct maintenance_task {
15471547
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;
15501550
};
15511551

15521552
static const struct maintenance_task tasks[] = {

0 commit comments

Comments
 (0)