From 2adfc3eafda93e8c8b1df0a27ef7c522d3b0a93a Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 25 Sep 2012 11:55:21 +0300 Subject: [PATCH] Re: [PATCH 4/6] Fix the COERCE_STATUS macro --- 8a/70cd1f9f6018566eec53dc9cbb5664412586cb | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 8a/70cd1f9f6018566eec53dc9cbb5664412586cb diff --git a/8a/70cd1f9f6018566eec53dc9cbb5664412586cb b/8a/70cd1f9f6018566eec53dc9cbb5664412586cb new file mode 100644 index 000000000..a7f90f848 --- /dev/null +++ b/8a/70cd1f9f6018566eec53dc9cbb5664412586cb @@ -0,0 +1,103 @@ +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 473FB431FC0 + for ; Tue, 25 Sep 2012 01:55:19 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +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 ZbRjFnU-fXMH for ; + Tue, 25 Sep 2012 01:55:18 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 28728431FAF + for ; Tue, 25 Sep 2012 01:55:18 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 5DE7C10014A; + Tue, 25 Sep 2012 11:55:22 +0300 (EEST) +From: Tomi Ollila +To: Austin Clements , + Justus Winter <4winter@informatik.uni-hamburg.de> +Subject: Re: [PATCH 4/6] Fix the COERCE_STATUS macro +In-Reply-To: <20120924174457.GK26662@mit.edu> +References: <873927eb5i.fsf@convex-new.cs.unb.ca> + <1348500080-29726-1-git-send-email-4winter@informatik.uni-hamburg.de> + <1348500080-29726-4-git-send-email-4winter@informatik.uni-hamburg.de> + <20120924174457.GK26662@mit.edu> +User-Agent: Notmuch/0.13.2+177~g6720ee8 (http://notmuchmail.org) Emacs/24.2.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Tue, 25 Sep 2012 08:55:19 -0000 + +On Mon, Sep 24 2012, Austin Clements wrote: + +> Quoth Justus Winter on Sep 24 at 5:21 pm: +>> Fix the COERCE_STATUS macro to handle _internal_error being declared +>> as void function. +>> +>> Note that the function _internal_error does not return. Evaluating to +>> NOTMUCH_STATUS_SUCCESS is done purely to appease the compiler. +>> +>> Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> +>> --- +>> lib/notmuch-private.h | 10 +++++++--- +>> 1 file changed, 7 insertions(+), 3 deletions(-) +>> +>> diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h +>> index bfb4111..7a409f5 100644 +>> --- a/lib/notmuch-private.h +>> +++ b/lib/notmuch-private.h +>> @@ -136,13 +136,17 @@ typedef enum _notmuch_private_status { +>> * to or greater than NOTMUCH_STATUS_LAST_STATUS. (The idea here is +>> * that the caller has previously handled any expected +>> * notmuch_private_status_t values.) +>> + * +>> + * Note that the function _internal_error does not return. Evaluating +>> + * to NOTMUCH_STATUS_SUCCESS is done purely to appease the compiler. +>> */ +>> #define COERCE_STATUS(private_status, format, ...) \ +>> ((private_status >= (notmuch_private_status_t) NOTMUCH_STATUS_LAST_STATUS)\ +>> ? \ +>> - (notmuch_status_t) _internal_error (format " (%s).\n", \ +>> - ##__VA_ARGS__, \ +>> - __location__) \ +>> + _internal_error (format " (%s).\n", \ +>> + ##__VA_ARGS__, \ +>> + __location__), \ +>> + (notmuch_status_t) NOTMUCH_PRIVATE_STATUS_SUCCESS \ +> +> Just a nit: why not simply NOTMUCH_STATUS_SUCCESS? +> +> Otherwise, this series LGTM. No need to roll another version just for +> this comment. + +I agree. LGTM. + +> +>> : \ +>> (notmuch_status_t) private_status) + -- 2.26.2