Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 4DAFF431FBC for ; Sun, 22 Nov 2009 04:32:50 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hr7zC58AVxQJ for ; Sun, 22 Nov 2009 04:32:50 -0800 (PST) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by olra.theworths.org (Postfix) with ESMTP id C3396431FAE for ; Sun, 22 Nov 2009 04:32:49 -0800 (PST) Received: by fg-out-1718.google.com with SMTP id 19so1817087fgg.2 for ; Sun, 22 Nov 2009 04:32:47 -0800 (PST) Received: by 10.102.149.9 with SMTP id w9mr1655750mud.77.1258893167040; Sun, 22 Nov 2009 04:32:47 -0800 (PST) Received: from x61s.janakj (r2c34.net.upc.cz [62.245.66.34]) by mx.google.com with ESMTPS id n10sm12765281mue.36.2009.11.22.04.32.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 22 Nov 2009 04:32:46 -0800 (PST) Received: by x61s.janakj (Postfix, from userid 1000) id 87E1E440651; Sun, 22 Nov 2009 13:32:36 +0100 (CET) From: Jan Janak To: notmuch@notmuchmail.org Date: Sun, 22 Nov 2009 13:32:36 +0100 Message-Id: <1258893156-25849-1-git-send-email-jan@ryngle.com> X-Mailer: git-send-email 1.6.3.3 Subject: [notmuch] [PATCH] notmuch-new: Eliminate gcc warning caused by ino_cmp. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 12:32:50 -0000 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 --- 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