cleanups / fixes from olly betts

David Bremner david at tethera.net
Mon Mar 19 18:38:25 PDT 2018


Olly passed me a patch on IRC today. I'm not sure when I'll have a
chance to turn it into proper patches, so here it is so it doesn't get
lost.

diff --git a/gmime-filter-reply.c b/gmime-filter-reply.c
index a1ba4b45..f673c0a2 100644
--- a/gmime-filter-reply.c
+++ b/gmime-filter-reply.c
@@ -113,7 +113,7 @@ filter_filter (GMimeFilter *filter, char *inbuf, size_t inlen, size_t prespace,
 	       char **outbuf, size_t *outlen, size_t *outprespace)
 {
 	GMimeFilterReply *reply = (GMimeFilterReply *) filter;
-	register const char *inptr = inbuf;
+	const char *inptr = inbuf;
 	const char *inend = inbuf + inlen;
 	char *outptr;
 
diff --git a/lib/database.cc b/lib/database.cc
index 02444e09..b3d5bf56 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1185,12 +1185,9 @@ notmuch_database_compact (const char *path,
     (void) rmtree (compact_xapian_path);
 
     try {
+	Xapian::Database db (xapian_path);
 	NotmuchCompactor compactor (status_cb, closure);
-
-	compactor.set_renumber (false);
-	compactor.add_source (xapian_path);
-	compactor.set_destdir (compact_xapian_path);
-	compactor.compact ();
+	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;
diff --git a/lib/index.cc b/lib/index.cc
index 0ad683fa..146a8928 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -176,7 +176,7 @@ filter_filter (GMimeFilter *gmime_filter, char *inbuf, size_t inlen, size_t pres
 {
     NotmuchFilterDiscardNonTerm *filter = (NotmuchFilterDiscardNonTerm *) gmime_filter;
     const scanner_state_t *states = filter->states;
-    register const char *inptr = inbuf;
+    const char *inptr = inbuf;
     const char *inend = inbuf + inlen;
     char *outptr;
 
diff --git a/notmuch-show.c b/notmuch-show.c
index 9871159d..e5280e66 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -326,13 +326,10 @@ signature_status_to_string (GMimeSignatureStatus status)
     if (g_mime_signature_status_bad (status))
 	return "bad";
 
-    if (g_mime_signature_status_error (status))
-	return "error";
-
     if (g_mime_signature_status_good (status))
 	return "good";
 
-    return "unknown";
+    return "error";
 }
 
 /* Print signature flags */


More information about the notmuch mailing list