diff src/optiondefs.h @ 24768:7334bf933510 v8.2.2922

patch 8.2.2922: computing array length is done in various ways Commit: https://github.com/vim/vim/commit/eeec2548785b2dd245a31ab25d7bde0f88ea1a6d Author: K.Takata <kentkt@csc.jp> Date: Wed Jun 2 13:28:16 2021 +0200 patch 8.2.2922: computing array length is done in various ways Problem: Computing array length is done in various ways. Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes https://github.com/vim/vim/issues/8305)
author Bram Moolenaar <Bram@vim.org>
date Wed, 02 Jun 2021 13:30:05 +0200
parents 9257f3980f4a
children ac88cd21ae88
line wrap: on
line diff
--- a/src/optiondefs.h
+++ b/src/optiondefs.h
@@ -3033,7 +3033,7 @@ static struct vimoption options[] =
     {NULL, NULL, 0, NULL, PV_NONE, {NULL, NULL} SCTX_INIT}
 };
 
-#define OPTION_COUNT (sizeof(options) / sizeof(struct vimoption))
+#define OPTION_COUNT ARRAY_LENGTH(options)
 
 // The following is needed to make the gen_opt_test.vim script work.
 // {"