diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-05-04 17:11:33 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-05-04 20:32:26 +0200 |
commit | ce93fa8adbeb31d160cba198e50e3f828e8def50 (patch) | |
tree | 8380e143ab3fec663f284a9e6d958996c2561b75 /src/wins.c | |
parent | 370c4031be9c921ae54ccb7cafff71d0a2c9b790 (diff) | |
download | calcurse-ce93fa8adbeb31d160cba198e50e3f828e8def50.zip |
Use a macro to determine the size of arrays
Use following macro instead of "sizeof(x) / sizeof(x[0])" everywhere:
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/wins.c')
-rw-r--r-- | src/wins.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -678,18 +678,15 @@ void wins_status_bar(void) switch (active_panel) { case CAL: bindings = bindings_cal; - bindings_size = - sizeof(bindings_cal) / sizeof(bindings_cal[0]); + bindings_size = ARRAY_SIZE(bindings_cal); break; case APP: bindings = bindings_apoint; - bindings_size = - sizeof(bindings_apoint) / sizeof(bindings_apoint[0]); + bindings_size = ARRAY_SIZE(bindings_apoint); break; case TOD: bindings = bindings_todo; - bindings_size = - sizeof(bindings_todo) / sizeof(bindings_todo[0]); + bindings_size = ARRAY_SIZE(bindings_todo); break; default: EXIT(_("unknown panel")); |