diff options
Diffstat (limited to 'src/macros.h')
-rw-r--r-- | src/macros.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/macros.h b/src/macros.h index 510be9bdad..571fed0a7e 100644 --- a/src/macros.h +++ b/src/macros.h @@ -32,7 +32,7 @@ ? (a)->col < (b)->col \ : (a)->coladd < (b)->coladd) #define EQUAL_POS(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col) && ((a).coladd == (b).coladd)) -#define CLEAR_POS(a) {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0;} +#define CLEAR_POS(a) do {(a)->lnum = 0; (a)->col = 0; (a)->coladd = 0;} while (0) #define LTOREQ_POS(a, b) (LT_POS(a, b) || EQUAL_POS(a, b)) @@ -240,7 +240,7 @@ /* get length of multi-byte char, not including composing chars */ #define MB_CPTR2LEN(p) (enc_utf8 ? utf_ptr2len(p) : (*mb_ptr2len)(p)) -#define MB_COPY_CHAR(f, t) if (has_mbyte) mb_copy_char(&f, &t); else *t++ = *f++ +#define MB_COPY_CHAR(f, t) do { if (has_mbyte) mb_copy_char(&f, &t); else *t++ = *f++; } while (0) #define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p)) #define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1) #define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p)) @@ -251,7 +251,8 @@ # define DO_AUTOCHDIR do { /**/ } while (0) #endif -#define RESET_BINDING(wp) (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE +#define RESET_BINDING(wp) do { (wp)->w_p_scb = FALSE; (wp)->w_p_crb = FALSE; \ + } while (0) #ifdef FEAT_DIFF # define PLINES_NOFILL(x) plines_nofill(x) |