diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-12-19 02:23:26 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-12-19 02:23:26 -0500 |
commit | 943b06329075865e4453a90f83afcbcfb2151965 (patch) | |
tree | 4b12072e943dcc4a5e542a7c8439cfe5f5460ba6 /src/nvim/syntax.c | |
parent | 5df8bf077bc69eab4e660dc09026878adcf54bb8 (diff) | |
parent | 478c99c128df506479b37d7ffbd1adee3134607f (diff) | |
download | rneovim-943b06329075865e4453a90f83afcbcfb2151965.tar.gz rneovim-943b06329075865e4453a90f83afcbcfb2151965.tar.bz2 rneovim-943b06329075865e4453a90f83afcbcfb2151965.zip |
Merge pull request #1663 from philix/array_size
Define and use the ARRAY_SIZE macro
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 3deda0a8c9..6787ca8080 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -3943,7 +3943,7 @@ get_syn_options ( if (strchr(first_letters, *arg) == NULL) break; - for (fidx = sizeof(flagtab) / sizeof(struct flag); --fidx >= 0; ) { + for (fidx = ARRAY_SIZE(flagtab); --fidx >= 0; ) { p = flagtab[fidx].name; int i; for (i = 0, len = 0; p[i] != NUL; i += 2, ++len) @@ -6295,7 +6295,7 @@ do_highlight ( attr = 0; off = 0; while (arg[off] != NUL) { - for (i = sizeof(hl_attr_table) / sizeof(int); --i >= 0; ) { + for (i = ARRAY_SIZE(hl_attr_table); --i >= 0; ) { len = (int)STRLEN(hl_name_table[i]); if (STRNICMP(arg + off, hl_name_table[i], len) == 0) { attr |= hl_attr_table[i]; @@ -6416,7 +6416,7 @@ do_highlight ( /* reduce calls to STRICMP a bit, it can be slow */ off = TOUPPER_ASC(*arg); - for (i = (sizeof(color_names) / sizeof(char *)); --i >= 0; ) + for (i = ARRAY_SIZE(color_names); --i >= 0; ) if (off == color_names[i][0] && STRICMP(arg + 1, color_names[i] + 1) == 0) break; |