comparison src/globals.h @ 28226:89c181c99e23 v8.2.4639

patch 8.2.4639: not sufficient parenthesis in preprocessor macros Commit: https://github.com/vim/vim/commit/9dac9b1751dd43c02470cc6a2aecaeea27abcc80 Author: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Sun Mar 27 20:05:17 2022 +0100 patch 8.2.4639: not sufficient parenthesis in preprocessor macros Problem: Not sufficient parenthesis in preprocessor macros. Solution: Add more parenthesis. (closes https://github.com/vim/vim/issues/10031)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Mar 2022 21:15:04 +0200
parents d27a9eed9849
children 66b245d84f37
comparison
equal deleted inserted replaced
28225:584f657538df 28226:89c181c99e23
700 EXTERN win_T *firstwin; // first window 700 EXTERN win_T *firstwin; // first window
701 EXTERN win_T *lastwin; // last window 701 EXTERN win_T *lastwin; // last window
702 EXTERN win_T *prevwin INIT(= NULL); // previous window 702 EXTERN win_T *prevwin INIT(= NULL); // previous window
703 #define ONE_WINDOW (firstwin == lastwin) 703 #define ONE_WINDOW (firstwin == lastwin)
704 #define W_NEXT(wp) ((wp)->w_next) 704 #define W_NEXT(wp) ((wp)->w_next)
705 #define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next) 705 #define FOR_ALL_WINDOWS(wp) for ((wp) = firstwin; (wp) != NULL; (wp) = (wp)->w_next)
706 #define FOR_ALL_FRAMES(frp, first_frame) \ 706 #define FOR_ALL_FRAMES(frp, first_frame) \
707 for (frp = first_frame; frp != NULL; frp = frp->fr_next) 707 for ((frp) = first_frame; (frp) != NULL; (frp) = (frp)->fr_next)
708 #define FOR_ALL_TABPAGES(tp) for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) 708 #define FOR_ALL_TABPAGES(tp) for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next)
709 #define FOR_ALL_WINDOWS_IN_TAB(tp, wp) \ 709 #define FOR_ALL_WINDOWS_IN_TAB(tp, wp) \
710 for ((wp) = ((tp) == NULL || (tp) == curtab) \ 710 for ((wp) = ((tp) == NULL || (tp) == curtab) \
711 ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) 711 ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
712 /* 712 /*
713 * When using this macro "break" only breaks out of the inner loop. Use "goto" 713 * When using this macro "break" only breaks out of the inner loop. Use "goto"
776 #define FOR_ALL_BUF_WININFO(buf, wip) \ 776 #define FOR_ALL_BUF_WININFO(buf, wip) \
777 for ((wip) = (buf)->b_wininfo; (wip) != NULL; (wip) = (wip)->wi_next) 777 for ((wip) = (buf)->b_wininfo; (wip) != NULL; (wip) = (wip)->wi_next)
778 778
779 // Iterate through all the signs placed in a buffer 779 // Iterate through all the signs placed in a buffer
780 #define FOR_ALL_SIGNS_IN_BUF(buf, sign) \ 780 #define FOR_ALL_SIGNS_IN_BUF(buf, sign) \
781 for (sign = buf->b_signlist; sign != NULL; sign = sign->se_next) 781 for ((sign) = (buf)->b_signlist; (sign) != NULL; (sign) = (sign)->se_next)
782 782
783 // Flag that is set when switching off 'swapfile'. It means that all blocks 783 // Flag that is set when switching off 'swapfile'. It means that all blocks
784 // are to be loaded into memory. Shouldn't be global... 784 // are to be loaded into memory. Shouldn't be global...
785 EXTERN int mf_dont_release INIT(= FALSE); // don't release blocks 785 EXTERN int mf_dont_release INIT(= FALSE); // don't release blocks
786 786
998 #define DBCS_CHS 936 // chinese 998 #define DBCS_CHS 936 // chinese
999 #define DBCS_CHSU 9936 // euc-cn 999 #define DBCS_CHSU 9936 // euc-cn
1000 #define DBCS_CHT 950 // taiwan 1000 #define DBCS_CHT 950 // taiwan
1001 #define DBCS_CHTU 9950 // euc-tw 1001 #define DBCS_CHTU 9950 // euc-tw
1002 #define DBCS_2BYTE 1 // 2byte- 1002 #define DBCS_2BYTE 1 // 2byte-
1003 #define DBCS_DEBUG -1 1003 #define DBCS_DEBUG (-1)
1004 1004
1005 EXTERN int enc_dbcs INIT(= 0); // One of DBCS_xxx values if 1005 EXTERN int enc_dbcs INIT(= 0); // One of DBCS_xxx values if
1006 // DBCS encoding 1006 // DBCS encoding
1007 EXTERN int enc_unicode INIT(= 0); // 2: UCS-2 or UTF-16, 4: UCS-4 1007 EXTERN int enc_unicode INIT(= 0); // 2: UCS-2 or UTF-16, 4: UCS-4
1008 EXTERN int enc_utf8 INIT(= FALSE); // UTF-8 encoded Unicode 1008 EXTERN int enc_utf8 INIT(= FALSE); // UTF-8 encoded Unicode