]> git.cworth.org Git - notmuch/commitdiff
CLI: replace some constructs with more uncrustify friendly ones
authorDavid Bremner <david@tethera.net>
Wed, 12 Jun 2019 22:47:20 +0000 (19:47 -0300)
committerDavid Bremner <david@tethera.net>
Fri, 14 Jun 2019 10:41:27 +0000 (07:41 -0300)
In particular
   - use (bool) instead of !!
   - cuddle the opening parens of function calls
   - add parens in some ternery operators

command-line-arguments.c
mime-node.c
notmuch-search.c
notmuch-show.c

index d64aa85bbb3f2a390b072f6eeccbce3177630ccb..6699c5217b6d8abb182dfa207a15dbb21682ba49 100644 (file)
@@ -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. */
index a93cbb31daed9d54f0ef8fdfe97414952ebba85c..4ca51fe93a34987a35d914714ee06724fc181c3b 100644 (file)
@@ -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 {
index e2dee4181b7400907723177e1cba687c8a9f21de..e3a856176025db87bf4be2e7b66a011eef31e8d2 100644 (file)
@@ -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]);
index 4dfe9c1d9def25c6294e335f999d2b5891b33ebb..bce7d8279b42060abfc2b9a2a3b6a431264ea89f 100644 (file)
@@ -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;