Fix gcc80 -Wmultistatement-macros.
authorSascha Wildner <saw@online.de>
Tue, 23 Jan 2018 09:13:06 +0000 (10:13 +0100)
committerSascha Wildner <saw@online.de>
Tue, 23 Jan 2018 09:35:08 +0000 (10:35 +0100)
contrib/ncurses/ncurses/curses.priv.h
libexec/dma/net.c
usr.sbin/nscd/hashtable.h

index d2b5b1b..c75c8f7 100644 (file)
@@ -1553,9 +1553,11 @@ extern NCURSES_EXPORT_VAR(SIG_ATOMIC_T) _nc_have_sigwinch;
  * tries to limp along after a failure.
  */
 #define TYPE_MALLOC(type, size, name) \
-       name = typeMalloc(type, size); \
-       if (name == 0) \
-           _nc_err_abort(MSG_NO_MEMORY)
+       do {
+           name = typeMalloc(type, size); \
+           if (name == 0) \
+               _nc_err_abort(MSG_NO_MEMORY) \
+       } while (0)
 
 #define TYPE_REALLOC(type, size, name) \
        name = typeRealloc(type, size, name); \
index 26935a8..43b103b 100644 (file)
@@ -366,18 +366,20 @@ deliver_to_host(struct qitem *it, struct mx_hostentry *host)
                return (1);
 
 #define READ_REMOTE_CHECK(c, exp)      \
-       res = read_remote(fd, 0, NULL); \
-       if (res == 5) { \
-               syslog(LOG_ERR, "remote delivery to %s [%s] failed after %s: %s", \
-                      host->host, host->addr, c, neterr); \
-               snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \
-                        host->host, host->addr, c, neterr); \
-               return (-1); \
-       } else if (res != exp) { \
-               syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \
-                      host->host, host->addr, c, neterr); \
-               return (1); \
-       }
+       do { \
+               res = read_remote(fd, 0, NULL); \
+               if (res == 5) { \
+                       syslog(LOG_ERR, "remote delivery to %s [%s] failed after %s: %s", \
+                              host->host, host->addr, c, neterr); \
+                       snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \
+                                host->host, host->addr, c, neterr); \
+                       return (-1); \
+               } else if (res != exp) { \
+                       syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \
+                              host->host, host->addr, c, neterr); \
+                       return (1); \
+               } \
+       while (0)
 
        /* Check first reply from remote host */
        if ((config.features & SECURETRANS) == 0 ||
index ad2df80..682db86 100644 (file)
@@ -128,9 +128,11 @@ typedef int hashtable_index_t;
        ((entry)->field.capacity)
 
 #define HASHTABLE_ENTRY_CAPACITY_INCREASE(entry, field, type)          \
-       (entry)->field.capacity *= 2;                                   \
-       (entry)->field.values = (type *)realloc((entry)->field.values,  \
-               (entry)->field.capacity * sizeof(type));
+       do {                                                            \
+               (entry)->field.capacity *= 2;                           \
+               (entry)->field.values = (type *)realloc((entry)->field.values, \
+                       (entry)->field.capacity * sizeof(type));        \
+       while (0)
 
 #define HASHTABLE_ENTRY_CAPACITY_DECREASE(entry, field, type)          \
        (entry)->field.capacity /= 2;                                   \