Re: [PATCH 4/6] Fix the COERCE_STATUS macro
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 25 Sep 2012 08:55:21 +0000 (11:55 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:36 +0000 (09:49 -0800)
8a/70cd1f9f6018566eec53dc9cbb5664412586cb [new file with mode: 0644]

diff --git a/8a/70cd1f9f6018566eec53dc9cbb5664412586cb b/8a/70cd1f9f6018566eec53dc9cbb5664412586cb
new file mode 100644 (file)
index 0000000..a7f90f8
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 473FB431FC0\r
+       for <notmuch@notmuchmail.org>; Tue, 25 Sep 2012 01:55:19 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id ZbRjFnU-fXMH for <notmuch@notmuchmail.org>;\r
+       Tue, 25 Sep 2012 01:55:18 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 28728431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 25 Sep 2012 01:55:18 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 5DE7C10014A;\r
+       Tue, 25 Sep 2012 11:55:22 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Austin Clements <amdragon@MIT.EDU>,\r
+       Justus Winter <4winter@informatik.uni-hamburg.de>\r
+Subject: Re: [PATCH 4/6] Fix the COERCE_STATUS macro\r
+In-Reply-To: <20120924174457.GK26662@mit.edu>\r
+References: <873927eb5i.fsf@convex-new.cs.unb.ca>\r
+       <1348500080-29726-1-git-send-email-4winter@informatik.uni-hamburg.de>\r
+       <1348500080-29726-4-git-send-email-4winter@informatik.uni-hamburg.de>\r
+       <20120924174457.GK26662@mit.edu>\r
+User-Agent: Notmuch/0.13.2+177~g6720ee8 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 25 Sep 2012 11:55:21 +0300\r
+Message-ID: <m28vbya3d2.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 25 Sep 2012 08:55:19 -0000\r
+\r
+On Mon, Sep 24 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+\r
+> Quoth Justus Winter on Sep 24 at  5:21 pm:\r
+>> Fix the COERCE_STATUS macro to handle _internal_error being declared\r
+>> as void function.\r
+>> \r
+>> Note that the function _internal_error does not return. Evaluating to\r
+>> NOTMUCH_STATUS_SUCCESS is done purely to appease the compiler.\r
+>> \r
+>> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>\r
+>> ---\r
+>>  lib/notmuch-private.h |   10 +++++++---\r
+>>  1 file changed, 7 insertions(+), 3 deletions(-)\r
+>> \r
+>> diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
+>> index bfb4111..7a409f5 100644\r
+>> --- a/lib/notmuch-private.h\r
+>> +++ b/lib/notmuch-private.h\r
+>> @@ -136,13 +136,17 @@ typedef enum _notmuch_private_status {\r
+>>   * to or greater than NOTMUCH_STATUS_LAST_STATUS. (The idea here is\r
+>>   * that the caller has previously handled any expected\r
+>>   * notmuch_private_status_t values.)\r
+>> + *\r
+>> + * Note that the function _internal_error does not return. Evaluating\r
+>> + * to NOTMUCH_STATUS_SUCCESS is done purely to appease the compiler.\r
+>>   */\r
+>>  #define COERCE_STATUS(private_status, format, ...)                 \\r
+>>      ((private_status >= (notmuch_private_status_t) NOTMUCH_STATUS_LAST_STATUS)\\r
+>>       ?                                                                     \\r
+>> -     (notmuch_status_t) _internal_error (format " (%s).\n",                \\r
+>> -                                         ##__VA_ARGS__,                    \\r
+>> -                                         __location__)                     \\r
+>> +     _internal_error (format " (%s).\n",                           \\r
+>> +                      ##__VA_ARGS__,                                       \\r
+>> +                      __location__),                                       \\r
+>> +     (notmuch_status_t) NOTMUCH_PRIVATE_STATUS_SUCCESS                     \\r
+>\r
+> Just a nit: why not simply NOTMUCH_STATUS_SUCCESS?\r
+>\r
+> Otherwise, this series LGTM.  No need to roll another version just for\r
+> this comment.\r
+\r
+I agree. LGTM.\r
+\r
+>\r
+>>       :                                                                     \\r
+>>       (notmuch_status_t) private_status)\r
+\r