From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH] lib/string_map: fix return type of string_cmp
Date: Sat, 2 Mar 2019 14:34:12 -0400 [thread overview]
Message-ID: <20190302183412.6822-1-david@tethera.net> (raw)
I can't figure out how checking the sign of a bool ever worked. The
following program demonstrates the problem (i.e. for me it prints 1).
#include <stdio.h>
#include <stdbool.h>
int main(int argc, char **argv) {
bool x;
x = -1;
printf("x = %d\n", x);
}
This seems to be mandated by the C99 standard 6.3.1.2.
---
I'd like to get this in a new point release ASAP.
lib/string-map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/string-map.c b/lib/string-map.c
index ad818207..a88404c7 100644
--- a/lib/string-map.c
+++ b/lib/string-map.c
@@ -106,7 +106,7 @@ _notmuch_string_map_sort (notmuch_string_map_t *map)
map->sorted = true;
}
-static bool
+static int
string_cmp (const char *a, const char *b, bool exact)
{
if (exact)
--
2.20.1
next reply other threads:[~2019-03-02 18:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-02 18:34 David Bremner [this message]
2019-03-05 1:42 ` [PATCH] lib/string_map: fix return type of string_cmp Matt Armstrong
2019-03-05 19:29 ` David Bremner
2019-03-06 0:45 ` Matt Armstrong
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=20190302183412.6822-1-david@tethera.net \
--to=david@tethera.net \
--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).