aboutsummaryrefslogtreecommitdiff
path: root/notmuch.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-25 16:03:45 -0700
committerCarl Worth <cworth@cworth.org>2009-10-25 16:03:45 -0700
commit3bd4a2eaaa81380fdf8c6130cf636dacefb926fe (patch)
tree1f3e9c2821bac506b52f00a4b0d3da83a8f787fb /notmuch.c
parentc7482b4dce114b1c09cbac2f4ef6d0defdb23258 (diff)
Add -Wswitch-enum and fix warnings.
Having to enumerate all the enum values at every switch is annoying, but this warning actually found a bug, (missing support for NOTMUCH_STATUS_OUT_OF_MEMORY in notmuch_status_to_string).
Diffstat (limited to 'notmuch.c')
-rw-r--r--notmuch.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/notmuch.c b/notmuch.c
index ef93ded..fbd773d 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -267,10 +267,16 @@ add_files_recursive (notmuch_database_t *notmuch,
break;
/* Fatal issues. Don't process anymore. */
case NOTMUCH_STATUS_XAPIAN_EXCEPTION:
- fprintf (stderr, "A Xapian error was encountered. Halting processing.\n");
+ case NOTMUCH_STATUS_OUT_OF_MEMORY:
+ fprintf (stderr, "Error: %s. Halting processing.\n",
+ notmuch_status_to_string (status));
ret = status;
goto DONE;
default:
+ case NOTMUCH_STATUS_FILE_ERROR:
+ case NOTMUCH_STATUS_NULL_POINTER:
+ case NOTMUCH_STATUS_TAG_TOO_LONG:
+ case NOTMUCH_STATUS_LAST_STATUS:
INTERNAL_ERROR ("add_message returned unexpected value: %d", status);
goto DONE;
}