--- /dev/null
+Return-Path: <too@guru-group.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 DFEEC431FC7\r
+ for <notmuch@notmuchmail.org>; Wed, 13 Nov 2013 09:03:14 -0800 (PST)\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 kQDGE-eCXsEI for <notmuch@notmuchmail.org>;\r
+ Wed, 13 Nov 2013 09:03:09 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 8578A431E62\r
+ for <notmuch@notmuchmail.org>; Wed, 13 Nov 2013 09:02:59 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id AAB2F1000E5; Wed, 13 Nov 2013 19:02:50 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 1/5] compact: tidy formatting\r
+Date: Wed, 13 Nov 2013 19:02:43 +0200\r
+Message-Id: <1384362167-12740-2-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <1384362167-12740-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1384362167-12740-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: tomi.ollila@iki.fi\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: Wed, 13 Nov 2013 17:03:15 -0000\r
+\r
+Notmuch compact code whitespace changes to match devel/STYLE.\r
+---\r
+ lib/database.cc | 62 ++++++++++++++++++++++++++++---------------------------\r
+ notmuch-compact.c | 4 ++--\r
+ 2 files changed, 34 insertions(+), 32 deletions(-)\r
+\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index a021bf1..3c008d6 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -805,17 +805,19 @@ notmuch_database_close (notmuch_database_t *notmuch)\r
+ }\r
+ \r
+ #if HAVE_XAPIAN_COMPACT\r
+-static int unlink_cb (const char *path,\r
+- unused (const struct stat *sb),\r
+- unused (int type),\r
+- unused (struct FTW *ftw))\r
++static int\r
++unlink_cb (const char *path,\r
++ unused (const struct stat *sb),\r
++ unused (int type),\r
++ unused (struct FTW *ftw))\r
+ {\r
+- return remove(path);\r
++ return remove (path);\r
+ }\r
+ \r
+-static int rmtree (const char *path)\r
++static int\r
++rmtree (const char *path)\r
+ {\r
+- return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);\r
++ return nftw (path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);\r
+ }\r
+ \r
+ class NotmuchCompactor : public Xapian::Compactor\r
+@@ -825,17 +827,17 @@ class NotmuchCompactor : public Xapian::Compactor\r
+ \r
+ public:\r
+ NotmuchCompactor(notmuch_compact_status_cb_t cb, void *closure) :\r
+- status_cb(cb), status_closure(closure) { }\r
++ status_cb (cb), status_closure (closure) { }\r
+ \r
+ virtual void\r
+ set_status (const std::string &table, const std::string &status)\r
+ {\r
+- char* msg;\r
++ char *msg;\r
+ \r
+ if (status_cb == NULL)\r
+ return;\r
+ \r
+- if (status.length() == 0)\r
++ if (status.length () == 0)\r
+ msg = talloc_asprintf (NULL, "compacting table %s", table.c_str());\r
+ else\r
+ msg = talloc_asprintf (NULL, " %s", status.c_str());\r
+@@ -844,8 +846,8 @@ public:\r
+ return;\r
+ }\r
+ \r
+- status_cb(msg, status_closure);\r
+- talloc_free(msg);\r
++ status_cb (msg, status_closure);\r
++ talloc_free (msg);\r
+ }\r
+ };\r
+ \r
+@@ -861,8 +863,8 @@ public:\r
+ * compaction process to protect data integrity.\r
+ */\r
+ notmuch_status_t\r
+-notmuch_database_compact (const char* path,\r
+- const char* backup_path,\r
++notmuch_database_compact (const char *path,\r
++ const char *backup_path,\r
+ notmuch_compact_status_cb_t status_cb,\r
+ void *closure)\r
+ {\r
+@@ -876,7 +878,7 @@ notmuch_database_compact (const char* path,\r
+ if (! local)\r
+ return NOTMUCH_STATUS_OUT_OF_MEMORY;\r
+ \r
+- ret = notmuch_database_open(path, NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much);\r
++ ret = notmuch_database_open (path, NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much);\r
+ if (ret) {\r
+ goto DONE;\r
+ }\r
+@@ -897,25 +899,25 @@ notmuch_database_compact (const char* path,\r
+ }\r
+ \r
+ if (backup_path != NULL) {\r
+- if (stat(backup_path, &statbuf) != -1) {\r
++ if (stat (backup_path, &statbuf) != -1) {\r
+ fprintf (stderr, "Backup path already exists: %s\n", backup_path);\r
+ ret = NOTMUCH_STATUS_FILE_ERROR;\r
+ goto DONE;\r
+ }\r
+ if (errno != ENOENT) {\r
+ fprintf (stderr, "Unknown error while stat()ing backup path: %s\n",\r
+- strerror(errno));\r
++ strerror (errno));\r
+ goto DONE;\r
+ }\r
+ }\r
+ \r
+ try {\r
+- NotmuchCompactor compactor(status_cb, closure);\r
++ NotmuchCompactor compactor (status_cb, closure);\r
+ \r
+- compactor.set_renumber(false);\r
+- compactor.add_source(xapian_path);\r
+- compactor.set_destdir(compact_xapian_path);\r
+- compactor.compact();\r
++ compactor.set_renumber (false);\r
++ compactor.add_source (xapian_path);\r
++ compactor.set_destdir (compact_xapian_path);\r
++ compactor.compact ();\r
+ } catch (Xapian::InvalidArgumentError e) {\r
+ fprintf (stderr, "Error while compacting: %s\n", e.get_msg().c_str());\r
+ ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION;\r
+@@ -923,33 +925,33 @@ notmuch_database_compact (const char* path,\r
+ }\r
+ \r
+ if (backup_path) {\r
+- if (rename(xapian_path, backup_path)) {\r
++ if (rename (xapian_path, backup_path)) {\r
+ fprintf (stderr, "Error moving old database out of the way\n");\r
+ ret = NOTMUCH_STATUS_FILE_ERROR;\r
+ goto DONE;\r
+ }\r
+ } else {\r
+- rmtree(xapian_path);\r
++ rmtree (xapian_path);\r
+ }\r
+ \r
+- if (rename(compact_xapian_path, xapian_path)) {\r
++ if (rename (compact_xapian_path, xapian_path)) {\r
+ fprintf (stderr, "Error moving compacted database\n");\r
+ ret = NOTMUCH_STATUS_FILE_ERROR;\r
+ goto DONE;\r
+ }\r
+ \r
+-DONE:\r
++ DONE:\r
+ if (notmuch)\r
+ notmuch_database_destroy (notmuch);\r
+ \r
+- talloc_free(local);\r
++ talloc_free (local);\r
+ \r
+ return ret;\r
+ }\r
+ #else\r
+ notmuch_status_t\r
+-notmuch_database_compact (unused (const char* path),\r
+- unused (const char* backup_path),\r
++notmuch_database_compact (unused (const char *path),\r
++ unused (const char *backup_path),\r
+ unused (notmuch_compact_status_cb_t status_cb),\r
+ unused (void *closure))\r
+ {\r
+@@ -1538,7 +1540,7 @@ _notmuch_database_generate_doc_id (notmuch_database_t *notmuch)\r
+ notmuch->last_doc_id++;\r
+ \r
+ if (notmuch->last_doc_id == 0)\r
+- INTERNAL_ERROR ("Xapian document IDs are exhausted.\n"); \r
++ INTERNAL_ERROR ("Xapian document IDs are exhausted.\n");\r
+ \r
+ return notmuch->last_doc_id;\r
+ }\r
+diff --git a/notmuch-compact.c b/notmuch-compact.c\r
+index 8022dfe..8b820c0 100644\r
+--- a/notmuch-compact.c\r
++++ b/notmuch-compact.c\r
+@@ -23,7 +23,7 @@\r
+ static void\r
+ status_update_cb (const char *msg, unused (void *closure))\r
+ {\r
+- printf("%s\n", msg);\r
++ printf ("%s\n", msg);\r
+ }\r
+ \r
+ int\r
+@@ -49,7 +49,7 @@ notmuch_compact_command (notmuch_config_t *config, int argc, char *argv[])\r
+ ret = notmuch_database_compact (path, backup_path,\r
+ quiet ? NULL : status_update_cb, NULL);\r
+ if (ret) {\r
+- fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string(ret));\r
++ fprintf (stderr, "Compaction failed: %s\n", notmuch_status_to_string (ret));\r
+ return 1;\r
+ }\r
+ \r
+-- \r
+1.8.3.1\r
+\r