diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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.
Diffstat (limited to 'source/ui-log.c')
| -rw-r--r-- | source/ui-log.c | 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 3 insertions, 1 deletion
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; |
