unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] notmuch-new: Eliminate gcc warning caused by ino_cmp.
@ 2009-11-22 12:32 Jan Janak
  2009-11-23  2:38 ` Carl Worth
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Janak @ 2009-11-22 12:32 UTC (permalink / raw)
  To: notmuch

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@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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-23  2:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 12:32 [PATCH] notmuch-new: Eliminate gcc warning caused by ino_cmp Jan Janak
2009-11-23  2:38 ` Carl Worth
2009-11-23  2:47   ` Jan Janak

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).