aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2011-05-11 12:34:13 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-05-11 13:27:14 -0700
commit2f3a76c569e5efad54520613315c0d29512ce69c (patch)
tree0cd7c18c8f692a6b27fca5c8c1ec92b7f487b322
parent7c58326d62fd742a303e4c22356158c0fad87a83 (diff)
Remove some variables which were set but not used.
gcc (at least as of version 4.6.0) is kind enough to point these out to us, (when given -Wunused-but-set-variable explicitly or implicitly via -Wunused or -Wall). One of these cases was a legitimately unused variable. Two were simply variables (named ignored) we were assigning only to squelch a warning about unused function return values. I don't seem to be getting those warnings even without setting the ignored variable. And the gcc docs. say that the correct way to squelch that warning is with a cast to (void) anyway.
-rw-r--r--lib/message.cc2
-rw-r--r--notmuch-new.c3
-rw-r--r--notmuch-tag.c4
3 files changed, 2 insertions, 7 deletions
diff --git a/lib/message.cc b/lib/message.cc
index ecda75af..a5a65e21 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -213,7 +213,6 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
{
notmuch_message_t *message;
Xapian::Document doc;
- Xapian::WritableDatabase *db;
unsigned int doc_id;
char *term;
@@ -233,7 +232,6 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
if (notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY)
INTERNAL_ERROR ("Failure to ensure database is writable.");
- db = static_cast<Xapian::WritableDatabase *> (notmuch->xapian_db);
try {
doc.add_term (term, 0);
talloc_free (term);
diff --git a/notmuch-new.c b/notmuch-new.c
index 4874a1c1..744f4ca3 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -64,10 +64,9 @@ static volatile sig_atomic_t interrupted;
static void
handle_sigint (unused (int sig))
{
- ssize_t ignored;
static char msg[] = "Stopping... \n";
- ignored = write(2, msg, sizeof(msg)-1);
+ write(2, msg, sizeof(msg)-1);
interrupted = 1;
}
diff --git a/notmuch-tag.c b/notmuch-tag.c
index 60e21e0d..6204ae3c 100644
--- a/notmuch-tag.c
+++ b/notmuch-tag.c
@@ -25,10 +25,8 @@ static volatile sig_atomic_t interrupted;
static void
handle_sigint (unused (int sig))
{
- ssize_t ignored;
-
static char msg[] = "Stopping... \n";
- ignored = write(2, msg, sizeof(msg)-1);
+ write(2, msg, sizeof(msg)-1);
interrupted = 1;
}