From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 273616DE32FF for ; Mon, 26 Jun 2017 05:14:40 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.082 X-Spam-Level: X-Spam-Status: No, score=0.082 tagged_above=-999 required=5 tests=[AWL=0.202, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AtckoXOzhtsf for ; Mon, 26 Jun 2017 05:14:39 -0700 (PDT) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) by arlo.cworth.org (Postfix) with ESMTPS id C00CF6DE32EE for ; Mon, 26 Jun 2017 05:14:38 -0700 (PDT) Received: by mail-it0-f44.google.com with SMTP id m68so15756742ith.1 for ; Mon, 26 Jun 2017 05:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SLY69cwqgQd1MBFqrT49aJvHbK1CV0Lt5rRVFZ/YNBU=; b=Eod2Rtcij+xuNM7tenVv/OHHe3rT7fHD0Y+5tZH732rR5Vx8bBeMMeCR5DOpmLctZb qh9WVnFOnE1WmZXL7wbUHNfXGUlutq27poapthvgbZ9yLvm7J7kYRKVP+iRthAICkOqx 1DSwe4GG6UYdH8veb7FO310AWkeFY1feMAD61J7797gVv6nTM/MlYSws6FRgR4rSW0La zkqM07Km4zmchgZrx+CvzjQnAsmLlLsSp6aASJ8PU2YXHsLF6jOY8khUSiF3NbcZtNbe LL0ptAQzPkeVhN554gC4vJOqLKClJ9dnijKuwUS5IDfZ6QdcM9FzXDiS3avjmnnD2/Ti yqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SLY69cwqgQd1MBFqrT49aJvHbK1CV0Lt5rRVFZ/YNBU=; b=aSimDPpxVLEwZdBDR02wmQHe2SDMozKtTU4eXePubqYfcbTX9bNojt3CNNy2VuJcwt fEJ0DF8/Y97nVLx18GlYknPtw7tEm6lKlu4NrQ3GrU4lLRNAMAMjdSWR75ZyL0LyiN/1 tKyg3JnUDS3zzwz2ir5bSvrX4d5Cgk6VvNkcue7xZRtgq1KdPftXXAMrSilG3EPuf3QN UDh41Xf+FamoEckpI6yjHq3SWDIH0OeIHnDWGcX/acubOHqbPzAaFb6il4YV7AaR6I7I y8LaLOpyqU3W6qmeVFozoZyzDzkj6b8Wr7K/o+lVAHWK8uM7Hh2hBrsVdD/3WZuzLwRv HM0w== X-Gm-Message-State: AKS2vOxkJcaFFgrbhkpYndUNr2ByLGEZm374WjrH8kkmffhJce8VQuOG EBgn5KSgjP2FM2uxggfENHIwmNIBI3AX X-Received: by 10.36.69.210 with SMTP id c79mr21877798itd.109.1498479278003; Mon, 26 Jun 2017 05:14:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.35.219 with HTTP; Mon, 26 Jun 2017 05:14:37 -0700 (PDT) In-Reply-To: <87fuetiamo.fsf@fifthhorseman.net> References: <20170616225026.8098-1-piotr.trojanek@gmail.com> <20170616225026.8098-4-piotr.trojanek@gmail.com> <87fuetiamo.fsf@fifthhorseman.net> From: Piotr Trojanek Date: Mon, 26 Jun 2017 13:14:37 +0100 Message-ID: Subject: Re: [PATCH 4/5] fix wrong printf formatting of signed/unsigned integers To: Daniel Kahn Gillmor Cc: notmuch@notmuchmail.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Mon, 26 Jun 2017 12:14:40 -0000 On Wed, Jun 21, 2017 at 5:11 PM, Daniel Kahn Gillmor wrote: > patch 5 adds FIXMEs that should probably actually be fixed, though, rather than just flagged. Thanks for merging the uncontroversial patches. Fixing the flagged problems is not obvious to me, it really depends on your intentions. For the first FIXME, the documentation for notmuch_directory_delete says (lib/notmuch.h:1971): * Delete directory document from the database, and destroy the * notmuch_directory_t object. but that is not what happens, for example, if the call to _notmuch_database_ensure_writable fails. Then the notmuch_directory_t object is only destroyed by the caller (see the end of _remove_directory function, notmuch-new.c:886). The comment should clearly say if the object is always destroyed or only if no error happened. For the second FIXME, I don't quite see why not just use the bsearch function. It could be called either with strcmp (if exact is true) or with a simple wrapper around strncmp (if exact is false). This wrapper could replace the string_cmp routine, so together with bsearch this could even make the code smaller. Also, I don't really understand the intention behind declaring string_cmp as returning notmuch_bool_t and then, in bsearch_first, casting its result to int. Am I missing something? -- Piotr Trojanek