diff src/dosinst.c @ 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 b97112a4e3e4
children 5f6167685bbb
line wrap: on
line diff
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -59,7 +59,7 @@ struct choice
 struct choice	choices[30];		// choices the user can make
 int		choice_count = 0;	// number of choices available
 
-#define TABLE_SIZE(s)	(int)(sizeof(s) / sizeof(*s))
+#define TABLE_SIZE(s)	(int)ARRAYSIZE(s)
 
 enum
 {
@@ -1527,8 +1527,7 @@ register_openwith(
 		"*\\OpenWithList\\gvim.exe",
 	};
 
-	for (i = 0; ERROR_SUCCESS == lRet
-			   && i < sizeof(openwith) / sizeof(openwith[0]); i++)
+	for (i = 0; ERROR_SUCCESS == lRet && i < ARRAYSIZE(openwith); i++)
 	    lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag);
     }