From 5946499218e22314b31bae59a09aaf20ed652f7b Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 10 Jun 2012 12:21:41 +0300 Subject: [PATCH] * silence some more compiler warnings --- emacs/mu4e-actions.el | 3 ++- mu/mu-cmd-server.c | 15 ++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/emacs/mu4e-actions.el b/emacs/mu4e-actions.el index 384b7460..6e0ec8ba 100644 --- a/emacs/mu4e-actions.el +++ b/emacs/mu4e-actions.el @@ -159,7 +159,8 @@ store your org-contacts." (list (list key "contacts" 'entry (list 'file mu4e-org-contacts-file) blurb))))) (message "%S" org-capture-templates) - (org-capture nil key))) + (when (fboundp 'org-capture) + (org-capture nil key)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/mu/mu-cmd-server.c b/mu/mu-cmd-server.c index 1eb404d9..87e6a3a2 100644 --- a/mu/mu-cmd-server.c +++ b/mu/mu-cmd-server.c @@ -96,6 +96,7 @@ print_expr (const char* frm, ...) { char *expr; va_list ap; + ssize_t rv; size_t exprlen, lenlen; char cookie[16]; static int outfd = 0; @@ -120,9 +121,14 @@ print_expr (const char* frm, ...) /* write the cookie, ie. * COOKIE_PRE COOKIE_POST */ - (void)write (outfd, cookie, lenlen + 2); - (void)write (outfd, expr, exprlen); - (void)write (outfd, "\n", 1); + rv = write (outfd, cookie, lenlen + 2); + if (rv != -1) + rv = write (outfd, expr, exprlen); + if (rv != -1) + rv = write (outfd, "\n", 1); + if (rv == -1) + g_warning ("%s: write() failed: %s", + __FUNCTION__, strerror(errno)); g_free (expr); } @@ -699,6 +705,7 @@ get_find_params (GSList *args, gboolean *threads, MuMsgFieldId *sortfield, /* whether to show threads or not */ *threads = get_bool_from_args (args, "threads", TRUE, NULL); + *reverse = get_bool_from_args (args, "reverse", TRUE, NULL); /* field to sort by */ sortfieldstr = get_string_from_args (args, "sortfield", TRUE, NULL); @@ -713,8 +720,6 @@ get_find_params (GSList *args, gboolean *threads, MuMsgFieldId *sortfield, } else *sortfield = MU_MSG_FIELD_ID_DATE; - *reverse = get_bool_from_args (args, "reverse", TRUE, NULL); - return MU_OK; }