]> git.cworth.org Git - notmuch/commitdiff
lib: run uncrustify
authoruncrustify <david@tethera.net>
Sat, 13 Mar 2021 12:45:34 +0000 (08:45 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 13 Mar 2021 12:45:34 +0000 (08:45 -0400)
This is the result of running

     $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h *.cc

in the lib directory

17 files changed:
lib/config.cc
lib/database.cc
lib/directory.cc
lib/features.cc
lib/index.cc
lib/indexopts.c
lib/message-file.c
lib/message-property.cc
lib/message.cc
lib/notmuch-private.h
lib/notmuch.h
lib/open.cc
lib/parse-time-vrp.cc
lib/prefix.cc
lib/string-map.c
lib/thread-fp.cc
lib/thread.cc

index 948751bc84b35fd7e2de04ccba14af13e6694ad1..e6b660a9e65c163307aa4c28c7d2246e2d2b5b86 100644 (file)
@@ -38,7 +38,7 @@ struct _notmuch_config_values {
     void *children; /* talloc_context */
 };
 
-static const char * _notmuch_config_key_to_string (notmuch_config_key_t key);
+static const char *_notmuch_config_key_to_string (notmuch_config_key_t key);
 
 static int
 _notmuch_config_list_destroy (notmuch_config_list_t *list)
@@ -104,7 +104,7 @@ notmuch_database_get_config (notmuch_database_t *notmuch,
                             const char *key,
                             char **value)
 {
-    const charstored_val;
+    const char *stored_val;
     notmuch_status_t status;
 
     if (! notmuch->config) {
@@ -119,7 +119,7 @@ notmuch_database_get_config (notmuch_database_t *notmuch,
     if (! stored_val) {
        /* XXX in principle this API should be fixed so empty string
         * is distinguished from not found */
-       *value = strdup("");
+       *value = strdup ("");
     } else {
        *value = strdup (stored_val);
     }
@@ -152,7 +152,8 @@ notmuch_database_get_config_list (notmuch_database_t *notmuch,
        talloc_set_destructor (list, _notmuch_config_list_destroy);
 
     } catch (const Xapian::Error &error) {
-       _notmuch_database_log (notmuch, "A Xapian exception occurred getting metadata iterator: %s.\n",
+       _notmuch_database_log (notmuch,
+                              "A Xapian exception occurred getting metadata iterator: %s.\n",
                               error.get_msg ().c_str ());
        notmuch->exception_reported = true;
        status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
@@ -167,7 +168,7 @@ notmuch_database_get_config_list (notmuch_database_t *notmuch,
            if (status != NOTMUCH_STATUS_XAPIAN_EXCEPTION)
                _notmuch_config_list_destroy (list);
        }
-    }  else {
+    } else {
        talloc_set_destructor (list, _notmuch_config_list_destroy);
     }
 
@@ -183,7 +184,9 @@ notmuch_config_list_valid (notmuch_config_list_t *metadata)
     return true;
 }
 
-static inline char * _key_from_iterator (notmuch_config_list_t *list) {
+static inline char *
+_key_from_iterator (notmuch_config_list_t *list)
+{
     return talloc_strdup (list, (*list->iterator).c_str () + CONFIG_PREFIX.length ());
 }
 
@@ -239,7 +242,7 @@ _notmuch_config_load_from_database (notmuch_database_t *notmuch)
     if (notmuch->config == NULL)
        notmuch->config = _notmuch_string_map_create (notmuch);
 
-    if (unlikely(notmuch->config == NULL))
+    if (unlikely (notmuch->config == NULL))
        return NOTMUCH_STATUS_OUT_OF_MEMORY;
 
     status = notmuch_database_get_config_list (notmuch, "", &list);
@@ -267,7 +270,7 @@ notmuch_config_get_values (notmuch_database_t *notmuch, notmuch_config_key_t key
        goto DONE;
 
     values = talloc (notmuch, notmuch_config_values_t);
-    if (unlikely(! values))
+    if (unlikely (! values))
        goto DONE;
 
     values->children = talloc_new (values);
@@ -279,17 +282,18 @@ notmuch_config_get_values (notmuch_database_t *notmuch, notmuch_config_key_t key
     values->iterator = strsplit_len (values->string, ';', &(values->tok_len));
     ok = true;
 
- DONE:
-    if (!ok) {
 DONE:
+    if (! ok) {
        if (values)
-           talloc_free(values);
+           talloc_free (values);
        return NULL;
     }
     return values;
 }
 
 notmuch_bool_t
-notmuch_config_values_valid (notmuch_config_values_t *values) {
+notmuch_config_values_valid (notmuch_config_values_t *values)
+{
     if (! values)
        return false;
 
@@ -297,12 +301,14 @@ notmuch_config_values_valid (notmuch_config_values_t *values) {
 }
 
 const char *
-notmuch_config_values_get (notmuch_config_values_t *values) {
+notmuch_config_values_get (notmuch_config_values_t *values)
+{
     return talloc_strndup (values, values->iterator, values->tok_len);
 }
 
 void
-notmuch_config_values_start (notmuch_config_values_t *values) {
+notmuch_config_values_start (notmuch_config_values_t *values)
+{
     if (values == NULL)
        return;
     if (values->children) {
@@ -315,13 +321,15 @@ notmuch_config_values_start (notmuch_config_values_t *values) {
 }
 
 void
-notmuch_config_values_move_to_next (notmuch_config_values_t *values) {
+notmuch_config_values_move_to_next (notmuch_config_values_t *values)
+{
     values->iterator += values->tok_len;
     values->iterator = strsplit_len (values->iterator, ';', &(values->tok_len));
 }
 
 void
-notmuch_config_values_destroy (notmuch_config_values_t *values) {
+notmuch_config_values_destroy (notmuch_config_values_t *values)
+{
     talloc_free (values);
 }
 
@@ -335,14 +343,14 @@ _notmuch_config_load_from_file (notmuch_database_t *notmuch,
     if (notmuch->config == NULL)
        notmuch->config = _notmuch_string_map_create (notmuch);
 
-    if (unlikely(notmuch->config == NULL)) {
+    if (unlikely (notmuch->config == NULL)) {
        status = NOTMUCH_STATUS_OUT_OF_MEMORY;
        goto DONE;
     }
 
     for (groups = g_key_file_get_groups (file, NULL); *groups; groups++) {
        for (keys = g_key_file_get_keys (file, *groups, NULL, NULL); *keys; keys++) {
-           char *absolute_key = talloc_asprintf(notmuch, "%s.%s", *groups,  *keys);
+           char *absolute_key = talloc_asprintf (notmuch, "%s.%s", *groups,  *keys);
            val = g_key_file_get_value (file, *groups, *keys, NULL);
            if (! val) {
                status = NOTMUCH_STATUS_FILE_ERROR;
@@ -355,7 +363,7 @@ _notmuch_config_load_from_file (notmuch_database_t *notmuch,
        }
     }
 
- DONE:
 DONE:
     return status;
 }
 
@@ -386,7 +394,8 @@ notmuch_config_get_bool (notmuch_database_t *notmuch, notmuch_config_key_t key,
 }
 
 static const char *
-_notmuch_config_key_to_string (notmuch_config_key_t key) {
+_notmuch_config_key_to_string (notmuch_config_key_t key)
+{
     switch (key) {
     case NOTMUCH_CONFIG_DATABASE_PATH:
        return "database.path";
@@ -412,7 +421,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key) {
 }
 
 static const char *
-_notmuch_config_default (void *ctx, notmuch_config_key_t key) {
+_notmuch_config_default (void *ctx, notmuch_config_key_t key)
+{
     char *path;
 
     switch (key) {
@@ -439,39 +449,45 @@ _notmuch_config_default (void *ctx, notmuch_config_key_t key) {
     default:
     case NOTMUCH_CONFIG_LAST:
        INTERNAL_ERROR ("illegal key enum %d", key);
-   }
+    }
 }
 
 notmuch_status_t
-_notmuch_config_load_defaults (notmuch_database_t *notmuch) {
+_notmuch_config_load_defaults (notmuch_database_t *notmuch)
+{
     notmuch_config_key_t key;
+
     for (key = NOTMUCH_CONFIG_FIRST;
         key < NOTMUCH_CONFIG_LAST;
-        key = notmuch_config_key_t(key + 1)) {
+        key = notmuch_config_key_t (key + 1)) {
        const char *val = notmuch_config_get (notmuch, key);
        const char *key_string = _notmuch_config_key_to_string (key);
 
        val = _notmuch_string_map_get (notmuch->config, key_string);
        if (! val) {
-           _notmuch_string_map_set (notmuch->config, key_string, _notmuch_config_default (notmuch, key));
+           _notmuch_string_map_set (notmuch->config, key_string, _notmuch_config_default (notmuch,
+                                                                                          key));
        }
     }
     return NOTMUCH_STATUS_SUCCESS;
 }
 
 const char *
-notmuch_config_get (notmuch_database_t *notmuch, notmuch_config_key_t key) {
+notmuch_config_get (notmuch_database_t *notmuch, notmuch_config_key_t key)
+{
 
     return _notmuch_string_map_get (notmuch->config, _notmuch_config_key_to_string (key));
 }
 
 notmuch_status_t
-notmuch_config_set (notmuch_database_t *notmuch, notmuch_config_key_t key, const char *val) {
+notmuch_config_set (notmuch_database_t *notmuch, notmuch_config_key_t key, const char *val)
+{
 
     return notmuch_database_set_config (notmuch, _notmuch_config_key_to_string (key), val);
 }
 
 void
-_notmuch_config_cache (notmuch_database_t *notmuch, notmuch_config_key_t key, const char *val) {
+_notmuch_config_cache (notmuch_database_t *notmuch, notmuch_config_key_t key, const char *val)
+{
     _notmuch_string_map_set (notmuch->config, _notmuch_config_key_to_string (key), val);
 }
index f96ba7c004bd6338d0c0a92bb5ad94464a3d7f50..f27616da32d60e7a7c8c067198883b88770d565d 100644 (file)
@@ -49,7 +49,8 @@ typedef struct {
 #define LOG_XAPIAN_EXCEPTION(message, error) _log_xapian_exception (__location__, message, error)
 
 static void
-_log_xapian_exception (const char *where, notmuch_database_t *notmuch,  const Xapian::Error error) {
+_log_xapian_exception (const char *where, notmuch_database_t *notmuch,  const Xapian::Error error)
+{
     _notmuch_database_log (notmuch,
                           "A Xapian exception occurred at %s: %s\n",
                           where,
@@ -506,7 +507,8 @@ notmuch_database_close (notmuch_database_t *notmuch)
        } catch (const Xapian::Error &error) {
            status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
            if (! notmuch->exception_reported) {
-               _notmuch_database_log (notmuch, "Error: A Xapian exception occurred closing database: %s\n",
+               _notmuch_database_log (notmuch,
+                                      "Error: A Xapian exception occurred closing database: %s\n",
                                       error.get_msg ().c_str ());
            }
        }
@@ -627,10 +629,11 @@ notmuch_status_t
 notmuch_database_compact_db (notmuch_database_t *notmuch,
                             const char *backup_path,
                             notmuch_compact_status_cb_t status_cb,
-                            void *closure) {
+                            void *closure)
+{
     void *local;
     char *notmuch_path, *xapian_path, *compact_xapian_path;
-    const charpath;
+    const char *path;
     notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
     struct stat statbuf;
     bool keep_backup;
@@ -692,7 +695,8 @@ notmuch_database_compact_db (notmuch_database_t *notmuch,
 
     try {
        NotmuchCompactor compactor (status_cb, closure);
-       notmuch->xapian_db->compact (compact_xapian_path, Xapian::DBCOMPACT_NO_RENUMBER, 0, compactor);
+       notmuch->xapian_db->compact (compact_xapian_path, Xapian::DBCOMPACT_NO_RENUMBER, 0,
+                                    compactor);
     } catch (const Xapian::Error &error) {
        _notmuch_database_log (notmuch, "Error while compacting: %s\n", error.get_msg ().c_str ());
        ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
@@ -840,8 +844,8 @@ handle_sigalrm (unused (int signal))
  */
 notmuch_status_t
 notmuch_database_upgrade (notmuch_database_t *notmuch,
-                         void (*progress_notify) (void *closure,
-                                                  double progress),
+                         void (*progress_notify)(void *closure,
+                                                 double progress),
                          void *closure)
 {
     void *local = talloc_new (NULL);
@@ -1065,7 +1069,8 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
            if (private_status) {
                _notmuch_database_log (notmuch,
                                       "Upgrade failed while creating ghost messages.\n");
-               status = COERCE_STATUS (private_status, "Unexpected status from _notmuch_message_initialize_ghost");
+               status = COERCE_STATUS (private_status,
+                                       "Unexpected status from _notmuch_message_initialize_ghost");
                goto DONE;
            }
 
@@ -1498,7 +1503,8 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch,
                status = NOTMUCH_STATUS_OUT_OF_MEMORY;
        }
     } catch (const Xapian::Error &error) {
-       _notmuch_database_log (notmuch, "Error: A Xapian exception occurred finding message by filename: %s\n",
+       _notmuch_database_log (notmuch,
+                              "Error: A Xapian exception occurred finding message by filename: %s\n",
                               error.get_msg ().c_str ());
        notmuch->exception_reported = true;
        status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
index eee8254e7a842e18cce933907ccddeac19356474..5cf64d7fc4021748b8d686cf36ed758741161db0 100644 (file)
@@ -52,8 +52,10 @@ struct _notmuch_directory {
 #define LOG_XAPIAN_EXCEPTION(directory, error) _log_xapian_exception (__location__, directory, error)
 
 static void
-_log_xapian_exception (const char *where, notmuch_directory_t *dir,  const Xapian::Error error) {
+_log_xapian_exception (const char *where, notmuch_directory_t *dir,  const Xapian::Error error)
+{
     notmuch_database_t *notmuch = dir->notmuch;
+
     _notmuch_database_log (notmuch,
                           "A Xapian exception occurred at %s: %s\n",
                           where,
index 8def2461af63b29fd7ba19c134e1409745842e1d..cf0196c86ffb8ec8778e1d68e1a7b5b09bf85b34 100644 (file)
@@ -64,7 +64,7 @@ _notmuch_database_print_features (const void *ctx, unsigned int features)
  */
 _notmuch_features
 _notmuch_database_parse_features (const void *ctx, const char *features, unsigned int version,
-                char mode, char **incompat_out)
+                                 char mode, char **incompat_out)
 {
     _notmuch_features res = static_cast<_notmuch_features>(0);
     unsigned int namelen, i;
index 826aa341d678b2345962cb944becee6b8b50f202..55c8372e3aa1c146913222369f7185cb6805531a 100644 (file)
@@ -260,7 +260,8 @@ notmuch_filter_discard_non_term_new (GMimeContentType *content_type)
            .value_table = NULL,
        };
 
-       type = g_type_register_static (GMIME_TYPE_FILTER, "NotmuchFilterDiscardNonTerm", &info, (GTypeFlags) 0);
+       type = g_type_register_static (GMIME_TYPE_FILTER, "NotmuchFilterDiscardNonTerm", &info,
+                                      (GTypeFlags) 0);
     }
 
     filter = (NotmuchFilterDiscardNonTerm *) g_object_new (type, NULL);
@@ -455,7 +456,8 @@ _index_mime_part (notmuch_message_t *message,
                msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL) {
                toindex = _notmuch_repair_crypto_payload_skip_legacy_display (child);
                if (toindex != child)
-                   notmuch_message_add_property (message, "index.repaired", "skip-protected-headers-legacy-display");
+                   notmuch_message_add_property (message, "index.repaired",
+                                                 "skip-protected-headers-legacy-display");
            }
            _index_mime_part (message, indexopts, toindex, msg_crypto);
        }
@@ -467,7 +469,8 @@ _index_mime_part (notmuch_message_t *message,
 
        mime_message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (part));
 
-       _index_mime_part (message, indexopts, g_mime_message_get_mime_part (mime_message), msg_crypto);
+       _index_mime_part (message, indexopts, g_mime_message_get_mime_part (mime_message),
+                         msg_crypto);
 
        goto DONE;
     }
@@ -567,6 +570,7 @@ _index_encrypted_mime_part (notmuch_message_t *message,
     bool attempted = false;
     GMimeDecryptResult *decrypt_result = NULL;
     bool get_sk = (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_TRUE);
+
     clear = _notmuch_crypto_decrypt (&attempted, notmuch_indexopts_get_decrypt_policy (indexopts),
                                     message, encrypted_data, get_sk ? &decrypt_result : NULL, &err);
     if (! attempted)
@@ -595,7 +599,8 @@ _index_encrypted_mime_part (notmuch_message_t *message,
                                          notmuch_status_to_string (status));
        if (get_sk) {
            status = notmuch_message_add_property (message, "session-key",
-                                                  g_mime_decrypt_result_get_session_key (decrypt_result));
+                                                  g_mime_decrypt_result_get_session_key (
+                                                      decrypt_result));
            if (status)
                _notmuch_database_log (notmuch, "failed to add session-key "
                                       "property (%d)\n", status);
@@ -603,11 +608,14 @@ _index_encrypted_mime_part (notmuch_message_t *message,
        g_object_unref (decrypt_result);
     }
     GMimeObject *toindex = clear;
-    if (_notmuch_message_crypto_potential_payload (msg_crypto, clear, encrypted_data, GMIME_MULTIPART_ENCRYPTED_CONTENT) &&
+
+    if (_notmuch_message_crypto_potential_payload (msg_crypto, clear, encrypted_data,
+                                                  GMIME_MULTIPART_ENCRYPTED_CONTENT) &&
        msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL) {
        toindex = _notmuch_repair_crypto_payload_skip_legacy_display (clear);
        if (toindex != clear)
-           notmuch_message_add_property (message, "index.repaired", "skip-protected-headers-legacy-display");
+           notmuch_message_add_property (message, "index.repaired",
+                                         "skip-protected-headers-legacy-display");
     }
     _index_mime_part (message, indexopts, toindex, msg_crypto);
     g_object_unref (clear);
@@ -640,7 +648,8 @@ _index_pkcs7_part (notmuch_message_t *message,
     if (p7type == GMIME_SECURE_MIME_TYPE_SIGNED_DATA) {
        sigs = g_mime_application_pkcs7_mime_verify (pkcs7, GMIME_VERIFY_NONE, &mimeobj, &err);
        if (sigs == NULL) {
-           _notmuch_database_log (notmuch, "Failed to verify PKCS#7 SignedData during indexing. (%d:%d) [%s]\n",
+           _notmuch_database_log (notmuch,
+                                  "Failed to verify PKCS#7 SignedData during indexing. (%d:%d) [%s]\n",
                                   err->domain, err->code, err->message);
            g_error_free (err);
            goto DONE;
@@ -651,7 +660,8 @@ _index_pkcs7_part (notmuch_message_t *message,
            msg_crypto->decryption_status == NOTMUCH_MESSAGE_DECRYPTED_FULL) {
            toindex = _notmuch_repair_crypto_payload_skip_legacy_display (mimeobj);
            if (toindex != mimeobj)
-               notmuch_message_add_property (message, "index.repaired", "skip-protected-headers-legacy-display");
+               notmuch_message_add_property (message, "index.repaired",
+                                             "skip-protected-headers-legacy-display");
        }
        _index_mime_part (message, indexopts, toindex, msg_crypto);
     } else if (p7type == GMIME_SECURE_MIME_TYPE_ENVELOPED_DATA) {
@@ -663,7 +673,7 @@ _index_pkcs7_part (notmuch_message_t *message,
        _notmuch_database_log (notmuch, "Cannot currently handle PKCS#7 smime-type '%s'\n",
                               g_mime_object_get_content_type_parameter (part, "smime-type"));
     }
- DONE:
 DONE:
     if (mimeobj)
        g_object_unref (mimeobj);
     if (sigs)
index 82a0026f0d46b47d46e94407d2271df978bd90db..4a8608586a356c083ed8ad35e70fe8882fa21a25 100644 (file)
@@ -31,6 +31,7 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
 
     char *decrypt_policy;
     notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt_policy);
+
     if (err)
        return NULL;
 
index 311bd478b0cfff13620ba653795ccb9cd62246bf..15b0bfad2e63772c314f4545eb0a3ffa19a15b2c 100644 (file)
@@ -65,11 +65,12 @@ _notmuch_message_file_open_ctx (notmuch_database_t *notmuch,
        return NULL;
 
     const char *prefix = notmuch_database_get_path (notmuch);
+
     if (prefix == NULL)
        goto FAIL;
 
     if (*filename == '/') {
-       if (strncmp (filename, prefix, strlen(prefix)) != 0) {
+       if (strncmp (filename, prefix, strlen (prefix)) != 0) {
            _notmuch_database_log (notmuch, "Error opening %s: path outside mail root\n",
                                   filename);
            errno = 0;
@@ -77,7 +78,7 @@ _notmuch_message_file_open_ctx (notmuch_database_t *notmuch,
        }
        message->filename = talloc_strdup (message, filename);
     } else {
-       message->filename = talloc_asprintf(message, "%s/%s", prefix, filename);
+       message->filename = talloc_asprintf (message, "%s/%s", prefix, filename);
     }
 
     if (message->filename == NULL)
index ecf7e140108d08b07e43afeb78c636d6085de46f..d5afa30c8e2a3e4d74d50a02efa15659febafbaf 100644 (file)
@@ -43,11 +43,13 @@ notmuch_message_count_properties (notmuch_message_t *message, const char *key, u
        return NOTMUCH_STATUS_NULL_POINTER;
 
     notmuch_string_map_t *map;
+
     map = _notmuch_message_property_map (message);
     if (! map)
        return NOTMUCH_STATUS_NULL_POINTER;
 
     notmuch_string_map_iterator_t *matcher = _notmuch_string_map_iterator_create (map, key, true);
+
     if (! matcher)
        return NOTMUCH_STATUS_OUT_OF_MEMORY;
 
index fca99082a8483cba035fba37f9a1bc1ebaab0b4e..dc4b47dcd92784543f18c4640276ee5a1a1557f2 100644 (file)
@@ -93,8 +93,10 @@ _notmuch_message_destructor (notmuch_message_t *message)
 #define LOG_XAPIAN_EXCEPTION(message, error) _log_xapian_exception (__location__, message, error)
 
 static void
-_log_xapian_exception (const char *where, notmuch_message_t *message,  const Xapian::Error error) {
+_log_xapian_exception (const char *where, notmuch_message_t *message,  const Xapian::Error error)
+{
     notmuch_database_t *notmuch = notmuch_message_get_database (message);
+
     _notmuch_database_log (notmuch,
                           "A Xapian exception occurred at %s: %s\n",
                           where,
@@ -286,7 +288,8 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
 
        doc_id = _notmuch_database_generate_doc_id (notmuch);
     } catch (const Xapian::Error &error) {
-       _notmuch_database_log (notmuch_message_get_database (message), "A Xapian exception occurred creating message: %s\n",
+       _notmuch_database_log (notmuch_message_get_database (message),
+                              "A Xapian exception occurred creating message: %s\n",
                               error.get_msg ().c_str ());
        notmuch->exception_reported = true;
        *status_ret = NOTMUCH_PRIVATE_STATUS_XAPIAN_EXCEPTION;
@@ -318,6 +321,7 @@ _notmuch_message_get_term (notmuch_message_t *message,
        return NULL;
 
     const std::string &term = *i;
+
     if (strncmp (term.c_str (), prefix, prefix_len))
        return NULL;
 
@@ -1765,6 +1769,7 @@ notmuch_message_has_maildir_flag (notmuch_message_t *message, char flag)
 {
     notmuch_status_t status;
     notmuch_bool_t ret;
+
     status = notmuch_message_has_maildir_flag_st (message, flag, &ret);
     if (status)
        return FALSE;
@@ -1778,14 +1783,14 @@ notmuch_message_has_maildir_flag_st (notmuch_message_t *message,
                                     notmuch_bool_t *is_set)
 {
     notmuch_status_t status;
-    
+
     if (! is_set)
        return NOTMUCH_STATUS_NULL_POINTER;
 
     status = _ensure_maildir_flags (message, false);
     if (status)
        return status;
-    
+
     *is_set =  message->maildir_flags && (strchr (message->maildir_flags, flag) != NULL);
     return NOTMUCH_STATUS_SUCCESS;
 }
@@ -2079,8 +2084,8 @@ notmuch_message_remove_all_tags (notmuch_message_t *message)
        private_status = _notmuch_message_remove_term (message, "tag", tag);
        if (private_status) {
            return COERCE_STATUS (private_status,
-                                  "_notmuch_message_remove_term return unexpected value: %d\n",
-                                  private_status);
+                                 "_notmuch_message_remove_term return unexpected value: %d\n",
+                                 private_status);
        }
     }
 
@@ -2202,8 +2207,8 @@ notmuch_message_reindex (notmuch_message_t *message,
     orig_thread_id = notmuch_message_get_thread_id (message);
     if (! orig_thread_id) {
        /* the following is correct as long as there is only one reason
-          n_m_get_thread_id returns NULL
-       */
+        * n_m_get_thread_id returns NULL
+        */
        return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
     }
 
index 750a242c61bc9ec098fb98df0bbbe61ed59047d2..3c52cfc2c262fedce56d73ed3c0942f247f3cdfd 100644 (file)
@@ -716,16 +716,16 @@ struct _notmuch_indexopts {
 
 /* config.cc */
 notmuch_status_t
-_notmuch_config_load_from_database (notmuch_database_t * db);
+_notmuch_config_load_from_database (notmuch_database_t *db);
 
 notmuch_status_t
-_notmuch_config_load_from_file (notmuch_database_t * db, GKeyFile *file);
+_notmuch_config_load_from_file (notmuch_database_t *db, GKeyFile *file);
 
 notmuch_status_t
-_notmuch_config_load_defaults (notmuch_database_t * db);
+_notmuch_config_load_defaults (notmuch_database_t *db);
 
 void
-_notmuch_config_cache (notmuch_database_t *db, notmuch_config_key_t key, const charval);
+_notmuch_config_cache (notmuch_database_t *db, notmuch_config_key_t key, const char *val);
 
 NOTMUCH_END_DECLS
 
index 5a5d99c0f750e2e7db2d824eea1c07263dc576e8..58c568d5a927ccab66c44a3d736037333456062c 100644 (file)
@@ -1631,7 +1631,7 @@ typedef enum _notmuch_message_flag {
  * @deprecated Deprecated as of libnotmuch 5.3 (notmuch 0.31). Please
  * use notmuch_message_get_flag_st instead.
  */
-NOTMUCH_DEPRECATED(5,3)
+NOTMUCH_DEPRECATED (5, 3)
 notmuch_bool_t
 notmuch_message_get_flag (notmuch_message_t *message,
                          notmuch_message_flag_t flag);
@@ -1826,7 +1826,7 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message);
  * @returns FALSE in case of error
  * @deprecated libnotmuch 5.3 (notmuch 0.31)
  */
-NOTMUCH_DEPRECATED(5, 3)
+NOTMUCH_DEPRECATED (5, 3)
 notmuch_bool_t
 notmuch_message_has_maildir_flag (notmuch_message_t *message, char flag);
 
@@ -2403,7 +2403,8 @@ notmuch_database_get_config (notmuch_database_t *db, const char *key, char **val
  * @since libnotmuch 4.4 (notmuch 0.23)
  */
 notmuch_status_t
-notmuch_database_get_config_list (notmuch_database_t *db, const char *prefix, notmuch_config_list_t **out);
+notmuch_database_get_config_list (notmuch_database_t *db, const char *prefix,
+                                 notmuch_config_list_t **out);
 
 /**
  * Is 'config_list' iterator valid (i.e. _key, _value, _move_to_next can be called).
index 3b86065be12de36874756e8e06ec82aa1dc912cd..6b717c1c13606de32e902f63b96a6718ecf82131 100644 (file)
@@ -85,7 +85,7 @@ _choose_hook_dir (notmuch_database_t *notmuch,
 
     config = _xdg_dir (notmuch, "XDG_CONFIG_HOME", ".config", profile);
     if (! config)
-       return  NOTMUCH_STATUS_PATH_ERROR;
+       return NOTMUCH_STATUS_PATH_ERROR;
 
     hook_dir = talloc_asprintf (notmuch, "%s/hooks", config);
 
@@ -125,7 +125,7 @@ _load_key_file (const char *path,
 
        if (dir) {
            path = talloc_asprintf (local, "%s/config", dir);
-           if (access (path, R_OK) !=0)
+           if (access (path, R_OK) != 0)
                path = NULL;
        }
     }
@@ -147,7 +147,7 @@ _load_key_file (const char *path,
        status = NOTMUCH_STATUS_NO_CONFIG;
     }
 
-DONE:
+  DONE:
     talloc_free (local);
     return status;
 }
@@ -161,7 +161,7 @@ _choose_database_path (const char *config_path,
 {
     notmuch_status_t status;
 
-    status =_load_key_file (config_path, profile, key_file);
+    status = _load_key_file (config_path, profile, key_file);
     if (status) {
        *message = strdup ("Error: cannot load config file.\n");
        return status;
@@ -319,8 +319,10 @@ notmuch_database_open_with_config (const char *database_path,
        notmuch->term_gen = new Xapian::TermGenerator;
        notmuch->term_gen->set_stemmer (Xapian::Stem ("english"));
        notmuch->value_range_processor = new Xapian::NumberRangeProcessor (NOTMUCH_VALUE_TIMESTAMP);
-       notmuch->date_range_processor = new ParseTimeRangeProcessor (NOTMUCH_VALUE_TIMESTAMP, "date:");
-       notmuch->last_mod_range_processor = new Xapian::NumberRangeProcessor (NOTMUCH_VALUE_LAST_MOD, "lastmod:");
+       notmuch->date_range_processor = new ParseTimeRangeProcessor (NOTMUCH_VALUE_TIMESTAMP,
+                                                                    "date:");
+       notmuch->last_mod_range_processor = new Xapian::NumberRangeProcessor (NOTMUCH_VALUE_LAST_MOD,
+                                                                             "lastmod:");
        notmuch->query_parser->set_default_op (Xapian::Query::OP_AND);
        notmuch->query_parser->set_database (*notmuch->xapian_db);
        notmuch->query_parser->set_stemmer (Xapian::Stem ("english"));
index 10809aa37453306ef9fc117c3d24f34fa52af581..22bf2ab5336980f8cbd9660e3ae4eb58bd7a9b97 100644 (file)
@@ -35,14 +35,14 @@ ParseTimeRangeProcessor::operator() (const std::string &begin, const std::string
     if (time (&now) == (time_t) -1)
        throw Xapian::QueryParserError ("unable to get current time");
 
-    if (!begin.empty ()) {
+    if (! begin.empty ()) {
        if (parse_time_string (begin.c_str (), &parsed_time, &now, PARSE_TIME_ROUND_DOWN))
            throw Xapian::QueryParserError ("Didn't understand date specification '" + begin + "'");
        else
            from = (double) parsed_time;
     }
 
-    if (!end.empty ()) {
+    if (! end.empty ()) {
        if (end == "!" && ! begin.empty ())
            str = begin;
        else
index 71a7699189d147b3c43ee5c74c9f73b9da15560d..0d92bdd7ddaecfc75801afd2f6f41bf1fac8621a 100644 (file)
@@ -133,8 +133,8 @@ _setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch)
        Xapian::FieldProcessor *fp;
 
        if (STRNCMP_LITERAL (prefix->name, "date") == 0)
-           fp = (new DateFieldProcessor(NOTMUCH_VALUE_TIMESTAMP))->release ();
-       else if (STRNCMP_LITERAL(prefix->name, "query") == 0)
+           fp = (new DateFieldProcessor (NOTMUCH_VALUE_TIMESTAMP))->release ();
+       else if (STRNCMP_LITERAL (prefix->name, "query") == 0)
            fp = (new QueryFieldProcessor (*notmuch->query_parser, notmuch))->release ();
        else if (STRNCMP_LITERAL (prefix->name, "thread") == 0)
            fp = (new ThreadFieldProcessor (*notmuch->query_parser, notmuch))->release ();
index 71eac6349a896ef49fe1cbfea3378a308951e1a4..e3a81b4fe1457a030154fb3cb05cfc59cd3bb059 100644 (file)
@@ -154,10 +154,10 @@ _notmuch_string_map_set (notmuch_string_map_t *map,
     _notmuch_string_map_sort (map);
     pair = bsearch_first (map->pairs, map->length, key, true);
     if (! pair)
-       _notmuch_string_map_append (map, key, val);
+       _notmuch_string_map_append (map, key, val);
     else {
-       talloc_free (pair->value);
-       pair->value = talloc_strdup (map->pairs, val);
+       talloc_free (pair->value);
+       pair->value = talloc_strdup (map->pairs, val);
     }
 }
 
index 97a65211992654b629269a74bdde0d6bbf82504f..06708ef291852f8ab5e1888c7e5755c18921f288 100644 (file)
@@ -40,11 +40,13 @@ ThreadFieldProcessor::operator() (const std::string & str)
            std::set<std::string> terms;
 
            if (! subquery)
-               throw Xapian::QueryParserError ("failed to create subquery for '" + subquery_str + "'");
+               throw Xapian::QueryParserError ("failed to create subquery for '" + subquery_str +
+                                               "'");
 
            status = notmuch_query_search_messages (subquery, &messages);
            if (status)
-               throw Xapian::QueryParserError ("failed to search messages for '" + subquery_str + "'");
+               throw Xapian::QueryParserError ("failed to search messages for '" + subquery_str +
+                                               "'");
 
            for (; notmuch_messages_valid (messages); notmuch_messages_move_to_next (messages)) {
                std::string term = thread_prefix;
index 173460084e2ce31cb8e31fc878c0377b1676f9e2..46a50e80cb5992729875d7d56698743ddcf8c3c3 100644 (file)
@@ -505,7 +505,8 @@ _resolve_thread_relationships (notmuch_thread_t *thread)
         notmuch_messages_valid (roots);
         notmuch_messages_move_to_next (roots)) {
        notmuch_message_t *message = notmuch_messages_get (roots);
-       if (_notmuch_messages_has_next (roots) || ! _notmuch_message_list_empty (thread->toplevel_list))
+       if (_notmuch_messages_has_next (roots) || ! _notmuch_message_list_empty (
+               thread->toplevel_list))
            _parent_or_toplevel (thread, message);
        else
            _notmuch_message_list_add_message (thread->toplevel_list, message);