]> granicus.if.org Git - neomutt/commitdiff
trivial ()s and NUL
authorRichard Russon <rich@flatcap.org>
Mon, 11 Mar 2019 19:54:10 +0000 (19:54 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 16 Mar 2019 12:56:55 +0000 (12:56 +0000)
mutt/memory.h
mutt/message.h
mutt/string2.h
mutt_curses.h

index 3ac897d1d754d969a6bd3f11dc6382c3d92a00d2..4268e27b32c53c11ab08617dcbca497f444b45e6 100644 (file)
@@ -27,8 +27,8 @@
 
 #undef MAX
 #undef MIN
-#define MAX(a, b) ((a) < (b) ? (b) : (a))
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
+#define MAX(a, b) (((a) < (b)) ? (b) : (a))
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
 
 #define mutt_array_size(x) (sizeof(x) / sizeof((x)[0]))
 
index 8c325b9584b970e3cc30c69f6f5501c78aadb693..bf146b99fa0d22539c313289ecd8696998179964 100644 (file)
@@ -34,7 +34,7 @@
 #else
 #define _(a) (a)
 #define N_(a) a
-#define ngettext(x, xs, n) ((n) == 1 ? (x) : (xs))
+#define ngettext(x, xs, n) (((n) == 1) ? (x) : (xs))
 #endif
 
 #endif /* MUTT_LIB_MESSAGE_H */
index 9e42c07e4aedde457fd7a80e07358284c632f988..25cf1344d28dca791e460af214abe3d08888dad2 100644 (file)
@@ -33,7 +33,7 @@
 
 #define STR_COMMAND 8192  ///< Enough space for a long command line
 
-#define NONULL(x) (x ? x : "")
+#define NONULL(x) ((x) ? (x) : "")
 #define ISSPACE(ch) isspace((unsigned char) ch)
 #define EMAIL_WSP " \t\r\n"
 
@@ -51,9 +51,9 @@
   do                                                                           \
   {                                                                            \
     if ((strlen) < (buflen))                                                   \
-      str[(strlen)] = 0;                                                       \
+      str[(strlen)] = '\0';                                                    \
     else                                                                       \
-      str[(buflen)] = 0;                                                       \
+      str[(buflen)] = '\0';                                                    \
   } while (false)
 
 #define terminate_buffer(str, strlen) terminate_string(str, strlen, sizeof(str) - 1)
index 265b4e7dd3f08b36b98e8679eb50ce22524e86ed..8735299af5035ec801e3d85db76ae4c65fc0e81d 100644 (file)
@@ -96,9 +96,9 @@ void mutt_curs_set(int cursor);
 #define ctrl(ch) ((ch) - '@')
 
 #ifdef KEY_ENTER
-#define CI_is_return(ch) ((ch) == '\r' || (ch) == '\n' || (ch) == KEY_ENTER)
+#define CI_is_return(ch) (((ch) == '\r') || ((ch) == '\n') || ((ch) == KEY_ENTER))
 #else
-#define CI_is_return(ch) ((ch) == '\r' || (ch) == '\n')
+#define CI_is_return(ch) (((ch) == '\r') || ((ch) == '\n'))
 #endif
 
 /**