From 515422fdb3b0bb9473fc6c67f8654b6246240da8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 16 Oct 2009 01:05:45 +0200 Subject: [PATCH] blockdev: use c.h Signed-off-by: Karel Zak --- disk-utils/blockdev.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index b20c052f..288c102d 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -11,6 +11,7 @@ #include #include +#include "c.h" #include "nls.h" #include "blkdev.h" @@ -171,8 +172,6 @@ struct bdc bdcms[] = } }; -#define SIZE(a) (sizeof(a)/sizeof((a)[0])) - static void usage(void) { int i; @@ -186,7 +185,7 @@ usage(void) { fprintf(stderr, _("Available commands:\n")); fprintf(stderr, "\t%-30s %s\n", "--getsz", _("get size in 512-byte sectors")); - for (i = 0; i < SIZE(bdcms); i++) { + for (i = 0; i < ARRAY_SIZE(bdcms); i++) { if (bdcms[i].argname) fprintf(stderr, "\t%s %-*s %s\n", bdcms[i].name, (int) (29 - strlen(bdcms[i].name)), @@ -203,7 +202,7 @@ static int find_cmd(char *s) { int j; - for (j = 0; j < SIZE(bdcms); j++) + for (j = 0; j < ARRAY_SIZE(bdcms); j++) if (!strcmp(s, bdcms[j].name)) return j; return -1; -- 2.39.5