diff options
author | Jani Nikula <jani@nikula.org> | 2017-10-07 11:44:04 +0300 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2017-10-09 22:24:02 -0300 |
commit | 0f314c0c99befea599a68bea51d759b4133efef6 (patch) | |
tree | 6d7fa97122e87bf6dcdb221267ac052f48331f59 /notmuch-search.c | |
parent | 54aef071590cb23f61da943daa29080cf7446696 (diff) |
cli: convert notmuch_bool_t to stdbool
C99 stdbool turned 18 this year. There really is no reason to use our
own, except in the library interface for backward
compatibility. Convert the cli and test binaries to stdbool.
Diffstat (limited to 'notmuch-search.c')
-rw-r--r-- | notmuch-search.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/notmuch-search.c b/notmuch-search.c index 2ea658d3..0abac08e 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -163,7 +163,7 @@ do_search_threads (search_context_t *ctx) int files = notmuch_thread_get_total_files (thread); int total = notmuch_thread_get_total_messages (thread); const char *relative_date = NULL; - notmuch_bool_t first_tag = TRUE; + bool first_tag = true; format->begin_map (format); @@ -243,7 +243,7 @@ do_search_threads (search_context_t *ctx) if (format->is_text_printer) { /* Special case for the text formatter */ if (first_tag) - first_tag = FALSE; + first_tag = false; else fputc (' ', stdout); fputs (tag, stdout); @@ -295,9 +295,9 @@ static int mailbox_compare (const void *v1, const void *v2) return ret; } -/* Returns TRUE iff name and addr is duplicate. If not, stores the +/* Returns true iff name and addr is duplicate. If not, stores the * name/addr pair in order to detect subsequent duplicates. */ -static notmuch_bool_t +static bool is_duplicate (const search_context_t *ctx, const char *name, const char *addr) { char *key; @@ -315,12 +315,12 @@ is_duplicate (const search_context_t *ctx, const char *name, const char *addr) if (l) { mailbox = l->data; mailbox->count++; - return TRUE; + return true; } mailbox = new_mailbox (ctx->format, name, addr); if (! mailbox) - return FALSE; + return false; /* * XXX: It would be more efficient to prepend to the list, but @@ -331,24 +331,24 @@ is_duplicate (const search_context_t *ctx, const char *name, const char *addr) if (list != g_list_append (list, mailbox)) INTERNAL_ERROR ("appending to list changed list head\n"); - return FALSE; + return false; } key = talloc_strdup (ctx->format, addr); if (! key) - return FALSE; + return false; mailbox = new_mailbox (ctx->format, name, addr); if (! mailbox) - return FALSE; + return false; list = g_list_append (NULL, mailbox); if (! list) - return FALSE; + return false; g_hash_table_insert (ctx->addresses, key, list); - return FALSE; + return false; } static void @@ -363,7 +363,7 @@ print_mailbox (const search_context_t *ctx, const mailbox_t *mailbox) /* name_addr has the name part quoted if necessary. Compare * 'John Doe <john@doe.com>' vs. '"Doe, John" <john@doe.com>' */ - name_addr = internet_address_to_string (ia, FALSE); + name_addr = internet_address_to_string (ia, false); if (format->is_text_printer) { if (ctx->output & OUTPUT_COUNT) { |