]> git.notmuchmail.org Git - notmuch/commitdiff
lib/string_map: fix return type of string_cmp
authorDavid Bremner <david@tethera.net>
Sat, 2 Mar 2019 18:10:51 +0000 (14:10 -0400)
committerDavid Bremner <david@tethera.net>
Wed, 6 Mar 2019 01:46:41 +0000 (21:46 -0400)
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.

lib/string-map.c
test/T610-message-property.sh

index ad818207f5d4a91450336a99af2518ffcd2b8bc3..a88404c734ff5a93ab98349bcc7913229bd19e47 100644 (file)
@@ -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)
index 04f0c9be967af5e2e07e2ad89415b1584158d15e..53a0be3bdf3c3cb170ad59fe9c8fc6b9dffa780e 100755 (executable)
@@ -101,7 +101,6 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "testing string map binary search (via message properties)"
-test_subtest_known_broken
 cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
 {
    char *keys[] = {"a", "b", "c", "d", "e", NULL};