aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/pre-process.c
diff options
authorNamhyung Kim <namhyung@gmail.com>2010-12-09 20:27:00 +0900
committerChristopher Li <sparse@chrisli.org>2011-01-03 02:18:09 -0800
commitc5e425e5f2f10f11c8d0f17733c87b5194e1f752 (patch)
tree728869bc3b0ab9d3670d2a6e208dd0baa4acae6c /pre-process.c
parent5ecad11b093eb431619aed1b02c1d6d12f77ad97 (diff)
downloadsparse-dev-c5e425e5f2f10f11c8d0f17733c87b5194e1f752.tar.gz
use ARRAY_SIZE() when possible
Convert (sizeof arr / sizeof arr[0]) to ARRAY_SIZE(arr). Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
Diffstat (limited to 'pre-process.c')
-rw-r--r--pre-process.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pre-process.c b/pre-process.c
index 656acaa6..603cc00c 100644
--- a/pre-process.c
+++ b/pre-process.c
@@ -1718,13 +1718,13 @@ static void init_preprocessor(void)
{ "elif", handle_elif },
};
- for (i = 0; i < (sizeof (normal) / sizeof (normal[0])); i++) {
+ for (i = 0; i < ARRAY_SIZE(normal); i++) {
struct symbol *sym;
sym = create_symbol(stream, normal[i].name, SYM_PREPROCESSOR, NS_PREPROCESSOR);
sym->handler = normal[i].handler;
sym->normal = 1;
}
- for (i = 0; i < (sizeof (special) / sizeof (special[0])); i++) {
+ for (i = 0; i < ARRAY_SIZE(special); i++) {
struct symbol *sym;
sym = create_symbol(stream, special[i].name, SYM_PREPROCESSOR, NS_PREPROCESSOR);
sym->handler = special[i].handler;