The function passed to scandir in the fourth argument takes two const void* arguments. To eliminate the gcc warning about incompatible types, we change ino_cmp to match this and then re-type the parameters in the body of ino_cmp.
Signed-off-by: Jan Janak <jan at ryngle.com> --- notmuch-new.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index 0dd2784..6db3d0f 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -75,9 +75,10 @@ add_files_print_progress (add_files_state_t *state) fflush (stdout); } -static int ino_cmp(const struct dirent **a, const struct dirent **b) +static int ino_cmp(const void *a, const void *b) { - return ((*a)->d_ino < (*b)->d_ino) ? -1 : 1; + return ((*(const struct dirent**)a)->d_ino < + (*(const struct dirent**)b)->d_ino) ? -1 : 1; } /* Examine 'path' recursively as follows: -- 1.6.3.3