summaryrefslogtreecommitdiff
path: root/src/highlight.c
diff options
context:
space:
mode:
authorkylo252 <59826753+kylo252@users.noreply.github.com>2022-02-16 19:24:07 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-16 19:24:07 +0000
commitae6f1d8b14c2f63811ee83ef14e32086fb3e9b83 (patch)
tree4982335c2afa3ef8515860dabea038acbc2af406 /src/highlight.c
parentd288eaad846f0e07e0141226f97d858dcf96cb78 (diff)
downloadvim-git-ae6f1d8b14c2f63811ee83ef14e32086fb3e9b83.tar.gz
patch 8.2.4402: missing parenthesis may cause unexpected problemsv8.2.4402
Problem: Missing parenthesis may cause unexpected problems. Solution: Add more parenthesis is macros. (closes #9788)
Diffstat (limited to 'src/highlight.c')
-rw-r--r--src/highlight.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/highlight.c b/src/highlight.c
index a8af2b18c..6add298b0 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -29,7 +29,7 @@ static char *(hl_name_table[]) =
"italic", "reverse", "inverse", "nocombine", "strikethrough", "NONE"};
static int hl_attr_table[] =
{HL_BOLD, HL_STANDOUT, HL_UNDERLINE, HL_UNDERCURL, HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_NOCOMBINE, HL_STRIKETHROUGH, 0};
-#define ATTR_COMBINE(attr_a, attr_b) ((((attr_b) & HL_NOCOMBINE) ? attr_b : (attr_a)) | (attr_b))
+#define ATTR_COMBINE(attr_a, attr_b) ((((attr_b) & HL_NOCOMBINE) ? (attr_b) : (attr_a)) | (attr_b))
/*
* Structure that stores information about a highlight group.
@@ -2260,7 +2260,7 @@ color_name2handle(char_u *name)
# undef RGB
# endif
# ifndef RGB
-# define RGB(r, g, b) ((r<<16) | (g<<8) | (b))
+# define RGB(r, g, b) (((r)<<16) | ((g)<<8) | (b))
# endif
# ifdef VIMDLL