unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: Carl Worth <cworth@cworth.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Switch from random to sequential thread identifiers.
Date: Tue, 09 Feb 2010 15:40:00 +0100	[thread overview]
Message-ID: <87r5oua2wv.fsf@steelpick.localdomain> (raw)
In-Reply-To: <87eikvpfzl.fsf@yoom.home.cworth.org>

On Mon, 08 Feb 2010 13:36:14 -0800, Carl Worth <cworth@cworth.org> wrote:
> The sequential identifiers have the advantage of being guaranteed to
> be unique (until we overflow a 64-bit unsigned integer), and also take
> up half as much space in the "notmuch search" output (16 columns
> rather than 32).
>  [...]

On amd64 I get:
lib/database.cc: In function ‘const char* _notmuch_database_generate_thread_id(notmuch_database_t*)’:
lib/database.cc:1309: warning: format ‘%016llx’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’

What about the following? This could also fix Sebastian's problem.

---- 8< ----
From afcc07ae03ae40cf7e1c33d8632fba0a9fc0b4c8 Mon Sep 17 00:00:00 2001
From: Michal Sojka <sojkam1@fel.cvut.cz>
Date: Tue, 9 Feb 2010 15:35:39 +0100
Subject: [PATCH] Suppress warning on amd64

---
 lib/database.cc |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index 8641321..20a4c72 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -26,6 +26,9 @@
 #include <signal.h>
 #include <xapian.h>

+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
 #include <glib.h> /* g_free, GPtrArray, GHashTable */

 using namespace std;
@@ -1306,7 +1309,7 @@ _notmuch_database_generate_thread_id (notmuch_database_t *notmuch)

     notmuch->last_thread_id++;

-    sprintf (thread_id, "%016llx", notmuch->last_thread_id);
+    sprintf (thread_id, "%016"PRIx64, notmuch->last_thread_id);

     db->set_metadata ("last_thread_id", thread_id);

  parent reply	other threads:[~2010-02-09 14:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 19:42 [PATCH] Switch from random to sequential thread identifiers Carl Worth
2010-02-08 21:36 ` Carl Worth
2010-02-09  9:58   ` Sebastian Spaeth
2010-02-09 10:07     ` Sebastian Spaeth
2010-02-09 10:35   ` Sebastian Spaeth
2010-02-09 19:22     ` Carl Worth
2010-02-09 14:40   ` Michal Sojka [this message]
2010-02-09 19:19     ` Carl Worth
2010-02-09 19:30       ` Jed Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r5oua2wv.fsf@steelpick.localdomain \
    --to=sojkam1@fel.cvut.cz \
    --cc=cworth@cworth.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).