unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] lib/string_map: fix return type of string_cmp
@ 2019-03-02 18:34 David Bremner
  2019-03-05  1:42 ` Matt Armstrong
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2019-03-02 18:34 UTC (permalink / raw)
  To: notmuch

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

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

end of thread, other threads:[~2019-03-06  0:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02 18:34 [PATCH] lib/string_map: fix return type of string_cmp David Bremner
2019-03-05  1:42 ` Matt Armstrong
2019-03-05 19:29   ` David Bremner
2019-03-06  0:45     ` Matt Armstrong

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