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>
This commit is contained in:
Lukas Fleischer
2013-05-04 17:11:33 +02:00
parent 370c4031be
commit ce93fa8adb
5 changed files with 14 additions and 15 deletions

View File

@@ -307,7 +307,7 @@ int utf8_width(char *s)
}
low = 0;
high = sizeof(utf8_widthtab) / sizeof(utf8_widthtab[0]);
high = ARRAY_SIZE(utf8_widthtab);
do {
cur = (low + high) / 2;
if (val >= utf8_widthtab[cur].min) {