From 5ce5cc5f6063b859f55d5651e8fa4d7cebb72134 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 27 Sep 2026 19:57:03 -1000 Subject: Pass callbacks to git by address ISO C has no conversion between a function pointer and void *, so the callbacks handed through git's data pointers and the write found by dlsym stopped the pedantic half of a DEVELOPER=1 build. --- source/ui-log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/ui-log.c') diff --git a/source/ui-log.c b/source/ui-log.c index 9f21114..d23fcd4 100644 --- a/source/ui-log.c +++ b/source/ui-log.c @@ -93,6 +93,8 @@ static void follow_path(struct diff_filepair *pair) */ static int should_show(struct commit *commit, struct rev_info *revs) { + // Static, because the walk keeps the address in its diff options. + static filepair_fn follow = follow_path; struct commit_list *parents = commit->parents; struct commit *parent; int found = 0, saved_fmt; @@ -128,7 +130,7 @@ static int should_show(struct commit *commit, struct rev_info *revs) saved_fmt = revs->diffopt.output_format; revs->diffopt.output_format = DIFF_FORMAT_CALLBACK; revs->diffopt.format_callback = cgit_diff_tree_cb; - revs->diffopt.format_callback_data = follow_path; + revs->diffopt.format_callback_data = &follow; revs->diffopt.no_free = 1; diff_flush(&revs->diffopt); revs->diffopt.output_format = saved_fmt; -- cgit 2.12.1