From: Karel Zak Date: Thu, 15 Oct 2009 23:05:45 +0000 (+0200) Subject: blockdev: use c.h X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=515422fdb3b0bb9473fc6c67f8654b6246240da8;p=util-linux blockdev: use c.h Signed-off-by: Karel Zak --- 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;