unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* cleanups / fixes from olly betts
@ 2018-03-20  1:38 David Bremner
  2018-03-20 17:56 ` Tomi Ollila
  2018-05-13 16:17 ` [PATCH 1/2] drop use of register keyword David Bremner
  0 siblings, 2 replies; 6+ messages in thread
From: David Bremner @ 2018-03-20  1:38 UTC (permalink / raw)
  To: notmuch


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 */

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: cleanups / fixes from olly betts
  2018-03-20  1:38 cleanups / fixes from olly betts David Bremner
@ 2018-03-20 17:56 ` Tomi Ollila
  2018-05-13 16:17 ` [PATCH 1/2] drop use of register keyword David Bremner
  1 sibling, 0 replies; 6+ messages in thread
From: Tomi Ollila @ 2018-03-20 17:56 UTC (permalink / raw)
  To: David Bremner, notmuch

On Mon, Mar 19 2018, David Bremner wrote:

> 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.

AFAIU LGTM.

>
> 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 */
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] drop use of register keyword
  2018-03-20  1:38 cleanups / fixes from olly betts David Bremner
  2018-03-20 17:56 ` Tomi Ollila
@ 2018-05-13 16:17 ` David Bremner
  2018-05-13 16:17   ` [PATCH 2/2] bindings: clean extra file created by ruby extension build system David Bremner
  2018-05-13 18:19   ` [PATCH 1/2] drop use of register keyword Tomi Ollila
  1 sibling, 2 replies; 6+ messages in thread
From: David Bremner @ 2018-05-13 16:17 UTC (permalink / raw)
  To: David Bremner, notmuch

The performance benefits are dubious, and it's deprecated in C++11.
---
 gmime-filter-reply.c | 2 +-
 lib/index.cc         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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/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;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] bindings: clean extra file created by ruby extension build system
  2018-05-13 16:17 ` [PATCH 1/2] drop use of register keyword David Bremner
@ 2018-05-13 16:17   ` David Bremner
  2018-05-13 18:19   ` [PATCH 1/2] drop use of register keyword Tomi Ollila
  1 sibling, 0 replies; 6+ messages in thread
From: David Bremner @ 2018-05-13 16:17 UTC (permalink / raw)
  To: David Bremner, notmuch

Noticed by dkg; this file seems to be created by building the debian
package, and perhaps by other distro package builds.
---
 bindings/Makefile.local | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 2ba2775c..18f95835 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -18,3 +18,5 @@ CLEAN += $(patsubst %,$(dir)/ruby/%, \
 	Makefile database.o directory.o filenames.o\
 	init.o message.o messages.o mkmf.log notmuch.so query.o \
 	status.o tags.o thread.o threads.o)
+
+CLEAN += bindings/ruby/.vendorarchdir.time
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drop use of register keyword
  2018-05-13 16:17 ` [PATCH 1/2] drop use of register keyword David Bremner
  2018-05-13 16:17   ` [PATCH 2/2] bindings: clean extra file created by ruby extension build system David Bremner
@ 2018-05-13 18:19   ` Tomi Ollila
  2018-05-15  1:22     ` David Bremner
  1 sibling, 1 reply; 6+ messages in thread
From: Tomi Ollila @ 2018-05-13 18:19 UTC (permalink / raw)
  To: David Bremner, David Bremner, notmuch

On Sun, May 13 2018, David Bremner wrote:

> The performance benefits are dubious, and it's deprecated in C++11.

series +1

Tomi

> ---
>  gmime-filter-reply.c | 2 +-
>  lib/index.cc         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> 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/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;
>  
> -- 
> 2.17.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] drop use of register keyword
  2018-05-13 18:19   ` [PATCH 1/2] drop use of register keyword Tomi Ollila
@ 2018-05-15  1:22     ` David Bremner
  0 siblings, 0 replies; 6+ messages in thread
From: David Bremner @ 2018-05-15  1:22 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Sun, May 13 2018, David Bremner wrote:
>
>> The performance benefits are dubious, and it's deprecated in C++11.
>
> series +1

pushed to master.

d

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-05-15  1:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20  1:38 cleanups / fixes from olly betts David Bremner
2018-03-20 17:56 ` Tomi Ollila
2018-05-13 16:17 ` [PATCH 1/2] drop use of register keyword David Bremner
2018-05-13 16:17   ` [PATCH 2/2] bindings: clean extra file created by ruby extension build system David Bremner
2018-05-13 18:19   ` [PATCH 1/2] drop use of register keyword Tomi Ollila
2018-05-15  1:22     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).