Permalink
Browse files

* make mu compile warning-free with clang/clang++

  • Loading branch information...
1 parent 6761f0e commit f02bb34188ec177cd1678272829a6dd46c4cd756 @djcb djcb committed Feb 29, 2012
Showing with 25 additions and 24 deletions.
  1. +5 −4 src/mu-cmd-server.c
  2. +20 −20 src/mu-flags.h
View
@@ -287,7 +287,7 @@ check_param_num (GSList *args, unsigned min, unsigned max)
do { \
if (!check_param_num((ARGS),(MN),(MX))) \
return server_error(NULL,MU_ERROR_IN_PARAMETERS, \
- (USAGE)); \
+ "%s",(USAGE)); \
} while (0)
@@ -362,7 +362,8 @@ cmd_find (MuStore *store, MuQuery *query, GSList *args, GError **err)
return_if_fail_param_num (args, 2, 2, usage);
if ((maxnum = atoi((const char*)args->next->data)) == 0)
- return server_error (NULL, MU_ERROR_IN_PARAMETERS, usage);
+ return server_error (NULL, MU_ERROR_IN_PARAMETERS,
+ "%s", usage);
/* TODO: ask for *all* results, then, get the <maxnum> newest
* ones; it seems we cannot get a sorted list of a subset of
@@ -496,7 +497,7 @@ do_move (MuStore *store, unsigned docid, MuMsg *msg, const char *maildir,
* wel */
rv = mu_store_update_msg (store, docid, msg, err);
if (rv == MU_STORE_INVALID_DOCID)
- return server_error (err, MU_ERROR_XAPIAN,
+ return server_error (err, MU_ERROR_XAPIAN, "%s",
"failed to update message");
sexp = mu_msg_to_sexp (msg, docid, NULL, TRUE);
@@ -589,7 +590,7 @@ cmd_remove (MuStore *store, GSList *args, GError **err)
"no valid doc for docid");
if (unlink (path) != 0)
- return server_error (err, MU_ERROR_FILE_CANNOT_UNLINK,
+ return server_error (err, MU_ERROR_FILE_CANNOT_UNLINK, "%s",
strerror (errno));
if (!mu_store_remove_path (store, path))
View
@@ -31,16 +31,16 @@ enum _MuFlags {
/* next 6 are seen in the file-info part of maildir message
* file names, ie., in a name like "1234345346:2,<fileinfo>",
* <fileinfo> consists of zero or more of the following
- * characters (in ascii order) */
+ * characters (in ascii order) */
MU_FLAG_DRAFT = 1 << 0,
- MU_FLAG_FLAGGED = 1 << 1,
+ MU_FLAG_FLAGGED = 1 << 1,
MU_FLAG_PASSED = 1 << 2,
MU_FLAG_REPLIED = 1 << 3,
MU_FLAG_SEEN = 1 << 4,
MU_FLAG_TRASHED = 1 << 5,
/* decides on cur/ or new/ in the maildir */
- MU_FLAG_NEW = 1 << 6,
+ MU_FLAG_NEW = 1 << 6,
/* content flags -- not visible in the filename, but used for
* searching */
@@ -55,7 +55,7 @@ enum _MuFlags {
};
typedef enum _MuFlags MuFlags;
-#define MU_FLAG_INVALID ((unsigned)-1)
+#define MU_FLAG_INVALID ((MuFlags)-1)
enum _MuFlagType {
MU_FLAG_TYPE_MAILFILE = 1 << 0,
@@ -65,46 +65,46 @@ enum _MuFlagType {
};
typedef enum _MuFlagType MuFlagType;
-#define MU_FLAG_TYPE_ANY ((MuFlags)-1)
+#define MU_FLAG_TYPE_ANY ((MuFlagType)-1)
#define MU_FLAG_TYPE_INVALID ((MuFlagType)-1)
/**
* Get the type of flag (mailfile, maildir, pseudo or content)
- *
+ *
* @param flag a MuFlag
- *
+ *
* @return the flag type or MU_FLAG_TYPE_INVALID in case of error
*/
MuFlagType mu_flag_type (MuFlags flag) G_GNUC_CONST;
/**
* Get the flag character
- *
+ *
* @param flag a MuFlag (single)
- *
+ *
* @return the character, or 0 in case of error
*/
char mu_flag_char (MuFlags flag) G_GNUC_CONST;
/**
- * Get the flag name
- *
+ * Get the flag name
+ *
* @param flag a single MuFlag
- *
+ *
* @return the name (don't free) as string or NULL in case of error
*/
const char* mu_flag_name (MuFlags flag) G_GNUC_CONST;
/**
* Get the string representation of an OR'ed set of flags
- *
+ *
* @param flags MuFlag (OR'ed)
* @param types allowable types (OR'ed) for the result; the rest is ignored
- *
+ *
* @return The string representation (static, don't free), or NULL in
* case of error
*/
@@ -113,10 +113,10 @@ const char* mu_flags_to_str_s (MuFlags flags, MuFlagType types);
/**
* Get the (OR'ed) flags corresponding to a string representation
- *
+ *
* @param str the string representation
* @param types the flag types to acceps (other will be ignored)
- *
+ *
* @return the (OR'ed) flags
*/
MuFlags mu_flags_from_str (const char *str, MuFlagType types);
@@ -129,12 +129,12 @@ MuFlags mu_flags_from_str (const char *str, MuFlagType types);
* which means resp. "add this flag" or "remove this flag" from
* oldflags. So, e.g. "-N+S" would unset the NEW flag and set the
* SEEN flag, without affecting other flags.
- *
+ *
* @param str the string representation
* @param old flags to update
* @param types the flag types to accept (other will be ignored)
- *
- * @return
+ *
+ * @return
*/
MuFlags mu_flags_from_str_delta (const char *str, MuFlags oldflags,
MuFlagType types);
@@ -146,7 +146,7 @@ typedef void (*MuFlagsForeachFunc) (MuFlags flag, gpointer user_data);
/**
* call a function for each available flag
- *
+ *
* @param func a function to call
* @param user_data a user pointer to pass to the function
*/

0 comments on commit f02bb34

Please sign in to comment.