comparison 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
comparison
equal deleted inserted replaced
24767:00b56eac455d 24768:7334bf933510
57 }; 57 };
58 58
59 struct choice choices[30]; // choices the user can make 59 struct choice choices[30]; // choices the user can make
60 int choice_count = 0; // number of choices available 60 int choice_count = 0; // number of choices available
61 61
62 #define TABLE_SIZE(s) (int)(sizeof(s) / sizeof(*s)) 62 #define TABLE_SIZE(s) (int)ARRAYSIZE(s)
63 63
64 enum 64 enum
65 { 65 {
66 compat_vi = 1, 66 compat_vi = 1,
67 compat_vim, 67 compat_vim,
1525 ".htm\\OpenWithList\\gvim.exe", 1525 ".htm\\OpenWithList\\gvim.exe",
1526 ".vim\\OpenWithList\\gvim.exe", 1526 ".vim\\OpenWithList\\gvim.exe",
1527 "*\\OpenWithList\\gvim.exe", 1527 "*\\OpenWithList\\gvim.exe",
1528 }; 1528 };
1529 1529
1530 for (i = 0; ERROR_SUCCESS == lRet 1530 for (i = 0; ERROR_SUCCESS == lRet && i < ARRAYSIZE(openwith); i++)
1531 && i < sizeof(openwith) / sizeof(openwith[0]); i++)
1532 lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag); 1531 lRet = reg_create_key_and_value(hRootKey, openwith[i], NULL, "", flag);
1533 } 1532 }
1534 1533
1535 return lRet; 1534 return lRet;
1536 } 1535 }