From 6c07ba3af31e5a61bf9dff63e6f848a829b5abbc Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Mon, 11 Mar 2019 19:54:10 +0000 Subject: [PATCH] trivial ()s and NUL --- mutt/memory.h | 4 ++-- mutt/message.h | 2 +- mutt/string2.h | 6 +++--- mutt_curses.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mutt/memory.h b/mutt/memory.h index 3ac897d1d..4268e27b3 100644 --- a/mutt/memory.h +++ b/mutt/memory.h @@ -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])) diff --git a/mutt/message.h b/mutt/message.h index 8c325b958..bf146b99f 100644 --- a/mutt/message.h +++ b/mutt/message.h @@ -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 */ diff --git a/mutt/string2.h b/mutt/string2.h index 9e42c07e4..25cf1344d 100644 --- a/mutt/string2.h +++ b/mutt/string2.h @@ -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) diff --git a/mutt_curses.h b/mutt_curses.h index 265b4e7dd..8735299af 100644 --- a/mutt_curses.h +++ b/mutt_curses.h @@ -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 /** -- 2.40.0