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 54A336DE1326 for ; Thu, 13 Jun 2019 04:08:36 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.049 X-Spam-Level: X-Spam-Status: No, score=-0.049 tagged_above=-999 required=5 tests=[AWL=-0.048, 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 Eyy_tBK47y6G for ; Thu, 13 Jun 2019 04:08:35 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 68E246DE108B for ; Thu, 13 Jun 2019 04:08:33 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hbNaq-0007gM-IH; Thu, 13 Jun 2019 07:08:32 -0400 Received: (nullmailer pid 6328 invoked by uid 1000); Thu, 13 Jun 2019 11:08:38 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 3/8] CLI: replace some constructs with more uncrustify friendly ones Date: Thu, 13 Jun 2019 08:08:32 -0300 Message-Id: <20190613110837.6256-4-david@tethera.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190613110837.6256-1-david@tethera.net> References: <20190613110837.6256-1-david@tethera.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Thu, 13 Jun 2019 11:08:36 -0000 In particular - use (bool) instead of !! - cuddle the opening parens of function calls - add parens in some ternery operators --- command-line-arguments.c | 16 ++++++++-------- mime-node.c | 8 ++++---- notmuch-search.c | 4 ++-- notmuch-show.c | 16 ++++++++-------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/command-line-arguments.c b/command-line-arguments.c index d64aa85b..6699c521 100644 --- a/command-line-arguments.c +++ b/command-line-arguments.c @@ -78,7 +78,7 @@ _process_boolean_arg (const notmuch_opt_desc_t *arg_desc, char next, return OPT_FAILED; } - *arg_desc->opt_bool = negate ? !value : value; + *arg_desc->opt_bool = negate ? (! value) : value; return OPT_OK; } @@ -120,13 +120,13 @@ _process_string_arg (const notmuch_opt_desc_t *arg_desc, char next, const char * static int _opt_set_count (const notmuch_opt_desc_t *opt_desc) { return - !!opt_desc->opt_inherit + - !!opt_desc->opt_bool + - !!opt_desc->opt_int + - !!opt_desc->opt_keyword + - !!opt_desc->opt_flags + - !!opt_desc->opt_string + - !!opt_desc->opt_position; + (bool) opt_desc->opt_inherit + + (bool) opt_desc->opt_bool + + (bool) opt_desc->opt_int + + (bool) opt_desc->opt_keyword + + (bool) opt_desc->opt_flags + + (bool) opt_desc->opt_string + + (bool) opt_desc->opt_position; } /* Return true if opt_desc is valid. */ diff --git a/mime-node.c b/mime-node.c index a93cbb31..4ca51fe9 100644 --- a/mime-node.c +++ b/mime-node.c @@ -185,8 +185,8 @@ node_verify (mime_node_t *node, GMimeObject *part) notmuch_status_t status; node->verify_attempted = true; - node->sig_list = g_mime_multipart_signed_verify - (GMIME_MULTIPART_SIGNED (part), GMIME_ENCRYPT_NONE, &err); + node->sig_list = g_mime_multipart_signed_verify ( + GMIME_MULTIPART_SIGNED (part), GMIME_ENCRYPT_NONE, &err); if (node->sig_list) set_signature_list_destructor (node); @@ -342,8 +342,8 @@ mime_node_child (mime_node_t *parent, int child) if (child == GMIME_MULTIPART_ENCRYPTED_CONTENT && parent->decrypted_child) sub = parent->decrypted_child; else - sub = g_mime_multipart_get_part - (GMIME_MULTIPART (parent->part), child); + sub = g_mime_multipart_get_part ( + GMIME_MULTIPART (parent->part), child); } else if (GMIME_IS_MESSAGE (parent->part)) { sub = g_mime_message_get_mime_part (GMIME_MESSAGE (parent->part)); } else { diff --git a/notmuch-search.c b/notmuch-search.c index e2dee418..e3a85617 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -752,8 +752,8 @@ _notmuch_search_prepare (search_context_t *ctx, notmuch_config_t *config, int ar size_t search_exclude_tags_length; notmuch_status_t status; - search_exclude_tags = notmuch_config_get_search_exclude_tags - (config, &search_exclude_tags_length); + search_exclude_tags = notmuch_config_get_search_exclude_tags ( + config, &search_exclude_tags_length); for (i = 0; i < search_exclude_tags_length; i++) { status = notmuch_query_add_tag_exclude (ctx->query, search_exclude_tags[i]); diff --git a/notmuch-show.c b/notmuch-show.c index 4dfe9c1d..bce7d827 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -490,8 +490,8 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node, { /* The disposition and content-type metadata are associated with * the envelope for message parts */ - GMimeObject *meta = node->envelope_part ? - GMIME_OBJECT (node->envelope_part) : node->part; + GMimeObject *meta = node->envelope_part ? ( + GMIME_OBJECT (node->envelope_part) ) : node->part ; GMimeContentType *content_type = g_mime_object_get_content_type (meta); const bool leaf = GMIME_IS_PART (node->part); GMimeStream *stream = params->out_stream; @@ -513,8 +513,8 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node, char *content_string; const char *disposition = _get_disposition (meta); const char *cid = g_mime_object_get_content_id (meta); - const char *filename = leaf ? - g_mime_part_get_filename (GMIME_PART (node->part)) : NULL; + const char *filename = leaf ? ( + g_mime_part_get_filename (GMIME_PART (node->part)) ) : NULL ; if (disposition && strcasecmp (disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) @@ -688,14 +688,14 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node, /* The disposition and content-type metadata are associated with * the envelope for message parts */ - GMimeObject *meta = node->envelope_part ? - GMIME_OBJECT (node->envelope_part) : node->part; + GMimeObject *meta = node->envelope_part ? ( + GMIME_OBJECT (node->envelope_part) ): node->part; GMimeContentType *content_type = g_mime_object_get_content_type (meta); char *content_string; const char *disposition = _get_disposition (meta); const char *cid = g_mime_object_get_content_id (meta); - const char *filename = GMIME_IS_PART (node->part) ? - g_mime_part_get_filename (GMIME_PART (node->part)) : NULL; + const char *filename = GMIME_IS_PART (node->part) ? ( + g_mime_part_get_filename (GMIME_PART (node->part) ) ) : NULL; int nclose = 0; int i; -- 2.20.1