mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
Merge pull request #17987 from leungbk/vim-patch-4402
vim-patch:8.2.{4639,4402}: missing parenthesis may cause unexpected problems
This commit is contained in:
@@ -45,6 +45,8 @@ a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
||||
38dd53c525054daf83dba27d7d46e90e8b41fa50
|
||||
6059784770c4c88fb6fe528b9f7634192fa1164e
|
||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
||||
|
||||
# typos
|
||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
||||
|
@@ -23,7 +23,7 @@ enum getf_retvalues {
|
||||
GETFILE_ERROR = 1, // normal error
|
||||
GETFILE_NOT_WRITTEN = 2, // "not written" error
|
||||
GETFILE_SAME_FILE = 0, // success, same file
|
||||
GETFILE_OPEN_OTHER = -1, // success, opened another file
|
||||
GETFILE_OPEN_OTHER = (-1), // success, opened another file
|
||||
GETFILE_UNUSED = 8,
|
||||
};
|
||||
|
||||
|
@@ -661,7 +661,7 @@ struct file_buffer {
|
||||
// flags for use of ":lmap" and IM control
|
||||
long b_p_iminsert; // input mode for insert
|
||||
long b_p_imsearch; // input mode for search
|
||||
#define B_IMODE_USE_INSERT -1 // Use b_p_iminsert value for search
|
||||
#define B_IMODE_USE_INSERT (-1) // Use b_p_iminsert value for search
|
||||
#define B_IMODE_NONE 0 // Input via none
|
||||
#define B_IMODE_LMAP 1 // Input via langmap
|
||||
#define B_IMODE_LAST 1
|
||||
@@ -1420,7 +1420,7 @@ struct window_S {
|
||||
int w_briopt_list; // additional indent for lists
|
||||
|
||||
// transform a pointer to a "onebuf" option into a "allbuf" option
|
||||
#define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T))
|
||||
#define GLOBAL_WO(p) ((char *)(p) + sizeof(winopt_T))
|
||||
|
||||
long w_scbind_pos;
|
||||
|
||||
|
@@ -425,9 +425,9 @@ char_u *str_foldcase(char_u *str, int orglen, char_u *buf, int buflen)
|
||||
int len = orglen;
|
||||
|
||||
#define GA_CHAR(i) ((char_u *)ga.ga_data)[i]
|
||||
#define GA_PTR(i) ((char_u *)ga.ga_data + i)
|
||||
#define GA_PTR(i) ((char_u *)ga.ga_data + (i))
|
||||
#define STR_CHAR(i) (buf == NULL ? GA_CHAR(i) : buf[i])
|
||||
#define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + i)
|
||||
#define STR_PTR(i) (buf == NULL ? GA_PTR(i) : buf + (i))
|
||||
|
||||
// Copy "str" into "buf" or allocated memory, unmodified.
|
||||
if (buf == NULL) {
|
||||
|
@@ -6550,7 +6550,7 @@ static inline uint32_t shuffle_xoshiro128starstar(uint32_t *const x, uint32_t *c
|
||||
uint32_t *const z, uint32_t *const w)
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_ALWAYS_INLINE
|
||||
{
|
||||
#define ROTL(x, k) ((x << k) | (x >> (32 - k)))
|
||||
#define ROTL(x, k) (((x) << (k)) | ((x) >> (32 - (k))))
|
||||
const uint32_t result = ROTL(*y * 5, 7) * 9;
|
||||
const uint32_t t = *y << 9;
|
||||
*z ^= *x;
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
||||
// for lnum argument in do_ecmd()
|
||||
#define ECMD_LASTL (linenr_T)0 // use last position in loaded file
|
||||
#define ECMD_LAST (linenr_T)-1 // use last position in all files
|
||||
#define ECMD_LAST ((linenr_T)-1) // use last position in all files
|
||||
#define ECMD_ONE (linenr_T)1 // use first line
|
||||
|
||||
/// Previous :substitute replacement string definition
|
||||
|
@@ -87,8 +87,8 @@ typedef struct exarg exarg_T;
|
||||
|
||||
// behavior for bad character, "++bad=" argument
|
||||
#define BAD_REPLACE '?' // replace it with '?' (default)
|
||||
#define BAD_KEEP -1 // leave it
|
||||
#define BAD_DROP -2 // erase it
|
||||
#define BAD_KEEP (-1) // leave it
|
||||
#define BAD_DROP (-2) // erase it
|
||||
|
||||
typedef void (*ex_func_T)(exarg_T *eap);
|
||||
|
||||
|
@@ -80,7 +80,7 @@
|
||||
#define FIO_ENDIAN_L 0x80 // little endian
|
||||
#define FIO_NOCONVERT 0x2000 // skip encoding conversion
|
||||
#define FIO_UCSBOM 0x4000 // check for BOM at start of file
|
||||
#define FIO_ALL -1 // allow all formats
|
||||
#define FIO_ALL (-1) // allow all formats
|
||||
|
||||
/* When converting, a read() or write() may leave some bytes to be converted
|
||||
* for the next call. The value is guessed... */
|
||||
|
@@ -2753,7 +2753,7 @@ static void truncate_fold(win_T *const wp, fold_T *fp, linenr_T end)
|
||||
#define FOLD_END(fp) ((fp)->fd_top + (fp)->fd_len - 1)
|
||||
#define VALID_FOLD(fp, gap) \
|
||||
((gap)->ga_len > 0 && (fp) < ((fold_T *)(gap)->ga_data + (gap)->ga_len))
|
||||
#define FOLD_INDEX(fp, gap) ((size_t)(fp - ((fold_T *)(gap)->ga_data)))
|
||||
#define FOLD_INDEX(fp, gap) ((size_t)((fp) - ((fold_T *)(gap)->ga_data)))
|
||||
void foldMoveRange(win_T *const wp, garray_T *gap, const linenr_T line1, const linenr_T line2,
|
||||
const linenr_T dest)
|
||||
{
|
||||
|
@@ -2571,7 +2571,7 @@ int inchar(char_u *buf, int maxlen, long wait_time)
|
||||
// Don't use buf[] here, closescript() may have freed typebuf.tb_buf[]
|
||||
// and buf may be pointing inside typebuf.tb_buf[].
|
||||
if (got_int) {
|
||||
#define DUM_LEN MAXMAPLEN * 3 + 3
|
||||
#define DUM_LEN (MAXMAPLEN * 3 + 3)
|
||||
char_u dum[DUM_LEN + 1];
|
||||
|
||||
for (;;) {
|
||||
|
@@ -61,8 +61,8 @@ typedef struct map_arguments MapArguments;
|
||||
#define MAP_ARGUMENTS_INIT { false, false, false, false, false, false, false, \
|
||||
{ 0 }, 0, NULL, 0, LUA_NOREF, false, NULL, 0, NULL }
|
||||
|
||||
#define KEYLEN_PART_KEY -1 // keylen value for incomplete key-code
|
||||
#define KEYLEN_PART_MAP -2 // keylen value for incomplete mapping
|
||||
#define KEYLEN_PART_KEY (-1) // keylen value for incomplete key-code
|
||||
#define KEYLEN_PART_MAP (-2) // keylen value for incomplete mapping
|
||||
|
||||
/// Maximum number of streams to read script from
|
||||
enum { NSCRIPT = 15, };
|
||||
|
@@ -430,7 +430,7 @@ EXTERN win_T *lastwin; // last window
|
||||
EXTERN win_T *prevwin INIT(= NULL); // previous window
|
||||
#define ONE_WINDOW (firstwin == lastwin)
|
||||
#define FOR_ALL_FRAMES(frp, first_frame) \
|
||||
for (frp = first_frame; frp != NULL; frp = frp->fr_next) // NOLINT
|
||||
for ((frp) = first_frame; (frp) != NULL; (frp) = (frp)->fr_next) // NOLINT
|
||||
|
||||
// When using this macro "break" only breaks out of the inner loop. Use "goto"
|
||||
// to break out of the tabpage loop.
|
||||
@@ -461,7 +461,7 @@ EXTERN tabpage_T *lastused_tabpage;
|
||||
EXTERN bool redraw_tabline INIT(= false); // need to redraw tabline
|
||||
|
||||
// Iterates over all tabs in the tab list
|
||||
#define FOR_ALL_TABS(tp) for (tabpage_T *tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
#define FOR_ALL_TABS(tp) for (tabpage_T *(tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next)
|
||||
|
||||
// All buffers are linked in a list. 'firstbuf' points to the first entry,
|
||||
// 'lastbuf' to the last entry and 'curbuf' to the currently active buffer.
|
||||
@@ -477,7 +477,7 @@ EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
|
||||
|
||||
// Iterate through all the signs placed in a buffer
|
||||
#define FOR_ALL_SIGNS_IN_BUF(buf, sign) \
|
||||
for (sign = buf->b_signlist; sign != NULL; sign = sign->se_next) // NOLINT
|
||||
for ((sign) = (buf)->b_signlist; (sign) != NULL; (sign) = (sign)->se_next) // NOLINT
|
||||
|
||||
|
||||
// List of files being edited (global argument list). curwin->w_alist points
|
||||
@@ -618,7 +618,7 @@ EXTERN int inhibit_delete_count INIT(= 0);
|
||||
#define DBCS_CHT 950 // taiwan
|
||||
#define DBCS_CHTU 9950 // euc-tw
|
||||
#define DBCS_2BYTE 1 // 2byte-
|
||||
#define DBCS_DEBUG -1
|
||||
#define DBCS_DEBUG (-1)
|
||||
|
||||
/// Encoding used when 'fencs' is set to "default"
|
||||
EXTERN char_u *fenc_default INIT(= NULL);
|
||||
|
@@ -103,7 +103,7 @@
|
||||
// MB_PTR_BACK(): backup a pointer to the previous character, taking care of
|
||||
// multi-byte characters if needed. Only use with "p" > "s" !
|
||||
#define MB_PTR_BACK(s, p) \
|
||||
(p -= utf_head_off((char_u *)s, (char_u *)p - 1) + 1)
|
||||
(p -= utf_head_off((char_u *)(s), (char_u *)(p) - 1) + 1)
|
||||
|
||||
// MB_CHAR2BYTES(): convert character to bytes and advance pointer to bytes
|
||||
#define MB_CHAR2BYTES(c, b) ((b) += utf_char2bytes((c), (b)))
|
||||
@@ -133,7 +133,7 @@
|
||||
#define ARRAY_LAST_ENTRY(arr) (arr)[ARRAY_SIZE(arr) - 1]
|
||||
|
||||
// Duplicated in os/win_defs.h to avoid include-order sensitivity.
|
||||
#define RGB_(r, g, b) ((r << 16) | (g << 8) | b)
|
||||
#define RGB_(r, g, b) (((r) << 16) | ((g) << 8) | (b))
|
||||
|
||||
#define STR_(x) #x
|
||||
#define STR(x) STR_(x)
|
||||
|
@@ -230,7 +230,7 @@ static linenr_T lowest_marked = 0;
|
||||
#define ML_INSERT 0x12 // insert line
|
||||
#define ML_FIND 0x13 // just find the line
|
||||
#define ML_FLUSH 0x02 // flush locked block
|
||||
#define ML_SIMPLE(x) (x & 0x10) // DEL, INS or FIND
|
||||
#define ML_SIMPLE(x) ((x) & 0x10) // DEL, INS or FIND
|
||||
|
||||
// argument for ml_upd_block0()
|
||||
typedef enum {
|
||||
|
@@ -38,8 +38,8 @@
|
||||
// Direction for nv_mousescroll() and ins_mousescroll()
|
||||
#define MSCR_DOWN 0 // DOWN must be FALSE
|
||||
#define MSCR_UP 1
|
||||
#define MSCR_LEFT -1
|
||||
#define MSCR_RIGHT -2
|
||||
#define MSCR_LEFT (-1)
|
||||
#define MSCR_RIGHT (-2)
|
||||
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
|
@@ -2616,7 +2616,7 @@ void may_clear_cmdline(void)
|
||||
}
|
||||
|
||||
// Routines for displaying a partly typed command
|
||||
#define SHOWCMD_BUFLEN SHOWCMD_COLS + 1 + 30
|
||||
#define SHOWCMD_BUFLEN (SHOWCMD_COLS + 1 + 30)
|
||||
static char_u showcmd_buf[SHOWCMD_BUFLEN];
|
||||
static char_u old_showcmd_buf[SHOWCMD_BUFLEN]; // For push_showcmd()
|
||||
static bool showcmd_is_clear = true;
|
||||
|
@@ -57,7 +57,7 @@
|
||||
#define ENC_DFLT "utf-8"
|
||||
|
||||
// end-of-line style
|
||||
#define EOL_UNKNOWN -1 // not defined yet
|
||||
#define EOL_UNKNOWN (-1) // not defined yet
|
||||
#define EOL_UNIX 0 // NL
|
||||
#define EOL_DOS 1 // CR NL
|
||||
#define EOL_MAC 2 // CR
|
||||
@@ -899,7 +899,7 @@ enum {
|
||||
};
|
||||
|
||||
// Value for b_p_ul indicating the global value must be used.
|
||||
#define NO_LOCAL_UNDOLEVEL -123456
|
||||
#define NO_LOCAL_UNDOLEVEL (-123456)
|
||||
|
||||
#define SB_MAX 100000 // Maximum 'scrollback' value.
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
// Windows defines a RGB macro that produces 0x00bbggrr color values for use
|
||||
// with GDI. Our macro is different, and we don't use GDI.
|
||||
// Duplicated from macros.h to avoid include-order sensitivity.
|
||||
#define RGB_(r, g, b) ((r << 16) | (g << 8) | b)
|
||||
#define RGB_(r, g, b) (((r) << 16) | ((g) << 8) | (b))
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# ifndef inline
|
||||
|
@@ -229,28 +229,28 @@ typedef struct vgr_args_S {
|
||||
static char_u *e_no_more_items = (char_u *)N_("E553: No more items");
|
||||
|
||||
// Quickfix window check helper macro
|
||||
#define IS_QF_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL)
|
||||
#define IS_QF_WINDOW(wp) (bt_quickfix((wp)->w_buffer) && (wp)->w_llist_ref == NULL)
|
||||
// Location list window check helper macro
|
||||
#define IS_LL_WINDOW(wp) (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL)
|
||||
#define IS_LL_WINDOW(wp) (bt_quickfix((wp)->w_buffer) && (wp)->w_llist_ref != NULL)
|
||||
|
||||
// Quickfix and location list stack check helper macros
|
||||
#define IS_QF_STACK(qi) (qi->qfl_type == QFLT_QUICKFIX)
|
||||
#define IS_LL_STACK(qi) (qi->qfl_type == QFLT_LOCATION)
|
||||
#define IS_QF_LIST(qfl) (qfl->qfl_type == QFLT_QUICKFIX)
|
||||
#define IS_LL_LIST(qfl) (qfl->qfl_type == QFLT_LOCATION)
|
||||
#define IS_QF_STACK(qi) ((qi)->qfl_type == QFLT_QUICKFIX)
|
||||
#define IS_LL_STACK(qi) ((qi)->qfl_type == QFLT_LOCATION)
|
||||
#define IS_QF_LIST(qfl) ((qfl)->qfl_type == QFLT_QUICKFIX)
|
||||
#define IS_LL_LIST(qfl) ((qfl)->qfl_type == QFLT_LOCATION)
|
||||
|
||||
//
|
||||
// Return location list for window 'wp'
|
||||
// For location list window, return the referenced location list
|
||||
//
|
||||
#define GET_LOC_LIST(wp) (IS_LL_WINDOW(wp) ? wp->w_llist_ref : wp->w_llist)
|
||||
#define GET_LOC_LIST(wp) (IS_LL_WINDOW(wp) ? (wp)->w_llist_ref : (wp)->w_llist)
|
||||
|
||||
// Macro to loop through all the items in a quickfix list
|
||||
// Quickfix item index starts from 1, so i below starts at 1
|
||||
#define FOR_ALL_QFL_ITEMS(qfl, qfp, i) \
|
||||
for (i = 1, qfp = qfl->qf_start; /* NOLINT(readability/braces) */ \
|
||||
!got_int && i <= qfl->qf_count && qfp != NULL; \
|
||||
i++, qfp = qfp->qf_next)
|
||||
for ((i) = 1, (qfp) = (qfl)->qf_start; /* NOLINT(readability/braces) */ \
|
||||
!got_int && (i) <= (qfl)->qf_count && (qfp) != NULL; \
|
||||
(i)++, (qfp) = (qfp)->qf_next)
|
||||
|
||||
|
||||
// Looking up a buffer can be slow if there are many. Remember the last one
|
||||
|
@@ -279,15 +279,15 @@ static void init_class_tab(void)
|
||||
done = true;
|
||||
}
|
||||
|
||||
# define ri_digit(c) (c < 0x100 && (class_tab[c] & RI_DIGIT))
|
||||
# define ri_hex(c) (c < 0x100 && (class_tab[c] & RI_HEX))
|
||||
# define ri_octal(c) (c < 0x100 && (class_tab[c] & RI_OCTAL))
|
||||
# define ri_word(c) (c < 0x100 && (class_tab[c] & RI_WORD))
|
||||
# define ri_head(c) (c < 0x100 && (class_tab[c] & RI_HEAD))
|
||||
# define ri_alpha(c) (c < 0x100 && (class_tab[c] & RI_ALPHA))
|
||||
# define ri_lower(c) (c < 0x100 && (class_tab[c] & RI_LOWER))
|
||||
# define ri_upper(c) (c < 0x100 && (class_tab[c] & RI_UPPER))
|
||||
# define ri_white(c) (c < 0x100 && (class_tab[c] & RI_WHITE))
|
||||
# define ri_digit(c) ((c) < 0x100 && (class_tab[c] & RI_DIGIT))
|
||||
# define ri_hex(c) ((c) < 0x100 && (class_tab[c] & RI_HEX))
|
||||
# define ri_octal(c) ((c) < 0x100 && (class_tab[c] & RI_OCTAL))
|
||||
# define ri_word(c) ((c) < 0x100 && (class_tab[c] & RI_WORD))
|
||||
# define ri_head(c) ((c) < 0x100 && (class_tab[c] & RI_HEAD))
|
||||
# define ri_alpha(c) ((c) < 0x100 && (class_tab[c] & RI_ALPHA))
|
||||
# define ri_lower(c) ((c) < 0x100 && (class_tab[c] & RI_LOWER))
|
||||
# define ri_upper(c) ((c) < 0x100 && (class_tab[c] & RI_UPPER))
|
||||
# define ri_white(c) ((c) < 0x100 && (class_tab[c] & RI_WHITE))
|
||||
|
||||
// flags for regflags
|
||||
#define RF_ICASE 1 // ignore case
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
// In the NFA engine: how many states are allowed.
|
||||
#define NFA_MAX_STATES 100000
|
||||
#define NFA_TOO_EXPENSIVE -1
|
||||
#define NFA_TOO_EXPENSIVE (-1)
|
||||
|
||||
// Which regexp engine to use? Needed for vim_regcomp().
|
||||
// Must match with 'regexpengine'.
|
||||
|
@@ -2119,13 +2119,13 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
||||
|
||||
// draw_state: items that are drawn in sequence:
|
||||
#define WL_START 0 // nothing done yet
|
||||
#define WL_CMDLINE WL_START + 1 // cmdline window column
|
||||
#define WL_FOLD WL_CMDLINE + 1 // 'foldcolumn'
|
||||
#define WL_SIGN WL_FOLD + 1 // column for signs
|
||||
#define WL_NR WL_SIGN + 1 // line number
|
||||
#define WL_BRI WL_NR + 1 // 'breakindent'
|
||||
#define WL_SBR WL_BRI + 1 // 'showbreak' or 'diff'
|
||||
#define WL_LINE WL_SBR + 1 // text in the line
|
||||
#define WL_CMDLINE (WL_START + 1) // cmdline window column
|
||||
#define WL_FOLD (WL_CMDLINE + 1) // 'foldcolumn'
|
||||
#define WL_SIGN (WL_FOLD + 1) // column for signs
|
||||
#define WL_NR (WL_SIGN + 1) // line number
|
||||
#define WL_BRI (WL_NR + 1) // 'breakindent'
|
||||
#define WL_SBR (WL_BRI + 1) // 'showbreak' or 'diff'
|
||||
#define WL_LINE (WL_SBR + 1) // text in the line
|
||||
int draw_state = WL_START; // what to draw next
|
||||
|
||||
int syntax_flags = 0;
|
||||
|
@@ -65,8 +65,8 @@ extern StlClickDefinition *tab_page_click_defs;
|
||||
/// Size of the tab_page_click_defs array
|
||||
extern long tab_page_click_defs_size;
|
||||
|
||||
#define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
|
||||
#define W_ENDROW(wp) (wp->w_winrow + wp->w_height)
|
||||
#define W_ENDCOL(wp) ((wp)->w_wincol + (wp)->w_width)
|
||||
#define W_ENDROW(wp) ((wp)->w_winrow + (wp)->w_height)
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "screen.h.generated.h"
|
||||
|
@@ -4830,15 +4830,15 @@ typedef struct {
|
||||
/// bonus if the first letter is matched
|
||||
#define FIRST_LETTER_BONUS 15
|
||||
/// penalty applied for every letter in str before the first match
|
||||
#define LEADING_LETTER_PENALTY -5
|
||||
#define LEADING_LETTER_PENALTY (-5)
|
||||
/// maximum penalty for leading letters
|
||||
#define MAX_LEADING_LETTER_PENALTY -15
|
||||
#define MAX_LEADING_LETTER_PENALTY (-15)
|
||||
/// penalty for every letter that doesn't match
|
||||
#define UNMATCHED_LETTER_PENALTY -1
|
||||
#define UNMATCHED_LETTER_PENALTY (-1)
|
||||
/// penalty for gap in matching positions (-2 * k)
|
||||
#define GAP_PENALTY -2
|
||||
#define GAP_PENALTY (-2)
|
||||
/// Score for a string that doesn't fuzzy match the pattern
|
||||
#define SCORE_NONE -9999
|
||||
#define SCORE_NONE (-9999)
|
||||
|
||||
#define FUZZY_MATCH_RECURSION_LIMIT 10
|
||||
|
||||
|
@@ -73,8 +73,8 @@ static void sha256_process(context_sha256_T *ctx, const char_u data[SHA256_BUFFE
|
||||
GET_UINT32(W[14], data, 56);
|
||||
GET_UINT32(W[15], data, 60);
|
||||
|
||||
#define SHR(x, n) ((x & 0xFFFFFFFF) >> n)
|
||||
#define ROTR(x, n) (SHR(x, n) | (x << (32 - n)))
|
||||
#define SHR(x, n) (((x) & 0xFFFFFFFF) >> (n))
|
||||
#define ROTR(x, n) (SHR(x, n) | ((x) << (32 - (n))))
|
||||
|
||||
#define S0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))
|
||||
#define S1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))
|
||||
@@ -82,17 +82,16 @@ static void sha256_process(context_sha256_T *ctx, const char_u data[SHA256_BUFFE
|
||||
#define S2(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
|
||||
#define S3(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
|
||||
|
||||
#define F0(x, y, z) ((x & y) | (z & (x | y)))
|
||||
#define F1(x, y, z) (z ^ (x & (y ^ z)))
|
||||
#define F0(x, y, z) (((x) & (y)) | ((z) & ((x) | (y))))
|
||||
#define F1(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
|
||||
|
||||
#define R(t) \
|
||||
(W[t] = S1(W[t - 2]) + W[t - 7] + \
|
||||
S0(W[t - 15]) + W[t - 16])
|
||||
(W[t] = S1(W[(t) - 2]) + W[(t) - 7] + S0(W[(t) - 15]) + W[(t) - 16])
|
||||
|
||||
#define P(a, b, c, d, e, f, g, h, x, K) { \
|
||||
temp1 = h + S3(e) + F1(e, f, g) + K + x; \
|
||||
temp1 = (h) + S3(e) + F1(e, f, g) + (K) + (x); \
|
||||
temp2 = S2(a) + F0(a, b, c); \
|
||||
d += temp1; h = temp1 + temp2; \
|
||||
(d) += temp1; (h) = temp1 + temp2; \
|
||||
}
|
||||
|
||||
A = ctx->state[0];
|
||||
|
@@ -62,11 +62,11 @@
|
||||
// Disadvantage: When "the" is typed as "hte" it sounds quite different ("@"
|
||||
// vs "ht") and goes down in the list.
|
||||
// Used when 'spellsuggest' is set to "best".
|
||||
#define RESCORE(word_score, sound_score) ((3 * word_score + sound_score) / 4)
|
||||
#define RESCORE(word_score, sound_score) ((3 * (word_score) + (sound_score)) / 4)
|
||||
|
||||
// Do the opposite: based on a maximum end score and a known sound score,
|
||||
// compute the maximum word score that can be used.
|
||||
#define MAXSCORE(word_score, sound_score) ((4 * word_score - sound_score) / 3)
|
||||
#define MAXSCORE(word_score, sound_score) ((4 * (word_score) - (sound_score)) / 3)
|
||||
|
||||
#include <assert.h>
|
||||
#include <inttypes.h>
|
||||
@@ -122,7 +122,7 @@
|
||||
#define WF_CAPMASK (WF_ONECAP | WF_ALLCAP | WF_KEEPCAP | WF_FIXCAP)
|
||||
|
||||
// Result values. Lower number is accepted over higher one.
|
||||
#define SP_BANNED -1
|
||||
#define SP_BANNED (-1)
|
||||
#define SP_RARE 0
|
||||
#define SP_OK 1
|
||||
#define SP_LOCAL 2
|
||||
@@ -176,7 +176,7 @@ typedef struct {
|
||||
#define SUG(ga, i) (((suggest_T *)(ga).ga_data)[i])
|
||||
|
||||
// True if a word appears in the list of banned words.
|
||||
#define WAS_BANNED(su, word) (!HASHITEM_EMPTY(hash_find(&su->su_banned, word)))
|
||||
#define WAS_BANNED(su, word) (!HASHITEM_EMPTY(hash_find(&(su)->su_banned, word)))
|
||||
|
||||
// Number of suggestions kept when cleaning up. We need to keep more than
|
||||
// what is displayed, because when rescore_suggestions() is called the score
|
||||
@@ -225,7 +225,7 @@ typedef struct {
|
||||
#define SCORE_SFMAX2 300 // maximum score for second try
|
||||
#define SCORE_SFMAX3 400 // maximum score for third try
|
||||
|
||||
#define SCORE_BIG SCORE_INS * 3 // big difference
|
||||
#define SCORE_BIG (SCORE_INS * 3) // big difference
|
||||
#define SCORE_MAXMAX 999999 // accept any score
|
||||
#define SCORE_LIMITMAX 350 // for spell_edit_score_limit()
|
||||
|
||||
@@ -5284,7 +5284,7 @@ static int stp_sal_score(suggest_T *stp, suginfo_T *su, slang_T *slang, char_u *
|
||||
}
|
||||
|
||||
static sftword_T dumsft;
|
||||
#define HIKEY2SFT(p) ((sftword_T *)(p - (dumsft.sft_word - (char_u *)&dumsft)))
|
||||
#define HIKEY2SFT(p) ((sftword_T *)((p) - (dumsft.sft_word - (char_u *)&dumsft)))
|
||||
#define HI2SFT(hi) HIKEY2SFT((hi)->hi_key)
|
||||
|
||||
// Prepare for calling suggest_try_soundalike().
|
||||
|
@@ -93,9 +93,9 @@ typedef int salfirst_T;
|
||||
|
||||
// Values for SP_*ERROR are negative, positive values are used by
|
||||
// read_cnt_string().
|
||||
#define SP_TRUNCERROR -1 // spell file truncated error
|
||||
#define SP_FORMERROR -2 // format error in spell file
|
||||
#define SP_OTHERERROR -3 // other error while reading spell file
|
||||
#define SP_TRUNCERROR (-1) // spell file truncated error
|
||||
#define SP_FORMERROR (-2) // format error in spell file
|
||||
#define SP_OTHERERROR (-3) // other error while reading spell file
|
||||
|
||||
// Structure used to store words and other info for one language, loaded from
|
||||
// a .spl file.
|
||||
|
@@ -1850,7 +1850,7 @@ static void spell_reload_one(char_u *fname, bool added_word)
|
||||
// In the postponed prefixes tree wn_flags is used to store the WFP_ flags,
|
||||
// but it must be negative to indicate the prefix tree to tree_add_word().
|
||||
// Use a negative number with the lower 8 bits zero.
|
||||
#define PFX_FLAGS -256
|
||||
#define PFX_FLAGS (-256)
|
||||
|
||||
// flags for "condit" argument of store_aff_word()
|
||||
#define CONDIT_COMB 1 // affix must combine
|
||||
|
@@ -181,7 +181,7 @@ static char *(spo_name_tab[SPO_COUNT]) =
|
||||
|
||||
#define SYN_ITEMS(buf) ((synpat_T *)((buf)->b_syn_patterns.ga_data))
|
||||
|
||||
#define NONE_IDX -2 // value of sp_sync_idx for "NONE"
|
||||
#define NONE_IDX (-2) // value of sp_sync_idx for "NONE"
|
||||
|
||||
/*
|
||||
* Flags for b_syn_sync_flags:
|
||||
@@ -267,9 +267,9 @@ static int keepend_level = -1;
|
||||
static char msg_no_items[] = N_("No Syntax items defined for this buffer");
|
||||
|
||||
// value of si_idx for keywords
|
||||
#define KEYWORD_IDX -1
|
||||
#define KEYWORD_IDX (-1)
|
||||
// valid of si_cont_list for containing all but contained groups
|
||||
#define ID_LIST_ALL (int16_t *)-1
|
||||
#define ID_LIST_ALL ((int16_t *)-1)
|
||||
|
||||
static int next_seqnr = 1; // value to use for si_seqnr
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#define SST_MAX_ENTRIES 1000 // maximal size for state stack array
|
||||
#define SST_FIX_STATES 7 // size of sst_stack[].
|
||||
#define SST_DIST 16 // normal distance between entries
|
||||
#define SST_INVALID (synstate_T *)-1 // invalid syn_state pointer
|
||||
#define SST_INVALID ((synstate_T *)-1) // invalid syn_state pointer
|
||||
|
||||
typedef struct syn_state synstate_T;
|
||||
|
||||
|
@@ -264,7 +264,7 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext()
|
||||
|
||||
// Prefer using semsg(), because perror() may send the output to the wrong
|
||||
// destination and mess up the screen.
|
||||
#define PERROR(msg) (void)semsg("%s: %s", msg, strerror(errno))
|
||||
#define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno))
|
||||
|
||||
#define SHOWCMD_COLS 10 // columns needed by shown command
|
||||
|
||||
@@ -319,7 +319,7 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext()
|
||||
#endif
|
||||
|
||||
// Replacement for nchar used by nv_replace().
|
||||
#define REPLACE_CR_NCHAR -1
|
||||
#define REPLACE_NL_NCHAR -2
|
||||
#define REPLACE_CR_NCHAR (-1)
|
||||
#define REPLACE_NL_NCHAR (-2)
|
||||
|
||||
#endif // NVIM_VIM_H
|
||||
|
@@ -59,7 +59,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define NOWIN (win_T *)-1 // non-existing window
|
||||
#define NOWIN ((win_T *)-1) // non-existing window
|
||||
|
||||
#define ROWS_AVAIL (Rows - p_ch - tabline_height() - global_stl_height())
|
||||
|
||||
|
Reference in New Issue
Block a user