summaryrefslogtreecommitdiff
path: root/src/wins.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2013-05-04 17:11:33 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2013-05-04 20:32:26 +0200
commitce93fa8adbeb31d160cba198e50e3f828e8def50 (patch)
tree8380e143ab3fec663f284a9e6d958996c2561b75 /src/wins.c
parent370c4031be9c921ae54ccb7cafff71d0a2c9b790 (diff)
downloadcalcurse-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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/wins.c b/src/wins.c
index 0a3f48f..bcc5a90 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -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"));