From 17d0d058fc68517ea974e720be7a8d540e9ff6a8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 16 Oct 2009 01:26:46 +0200 Subject: [PATCH] fdisk: use c.h Signed-off-by: Karel Zak --- fdisk/fdisk.h | 4 ++-- fdisk/fdiskbsdlabel.h | 2 +- fdisk/fdisksunlabel.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fdisk/fdisk.h b/fdisk/fdisk.h index 75dd88ec..6ef68b6e 100644 --- a/fdisk/fdisk.h +++ b/fdisk/fdisk.h @@ -2,6 +2,8 @@ fdisk.h */ +#include "c.h" + #define DEFAULT_SECTOR_SIZE 512 #define MAX_SECTOR_SIZE 2048 #define SECTOR_SIZE 512 /* still used in BSD code */ @@ -21,8 +23,6 @@ #define IS_EXTENDED(i) \ ((i) == EXTENDED || (i) == WIN98_EXTENDED || (i) == LINUX_EXTENDED) -#define SIZE(a) (sizeof(a)/sizeof((a)[0])) - #define cround(n) (display_in_cyl_units ? ((n)/units_per_sector)+1 : (n)) #define scround(x) (((x)+units_per_sector-1)/units_per_sector) diff --git a/fdisk/fdiskbsdlabel.h b/fdisk/fdiskbsdlabel.h index 461c2acc..9f9e0918 100644 --- a/fdisk/fdiskbsdlabel.h +++ b/fdisk/fdiskbsdlabel.h @@ -224,7 +224,7 @@ static struct systypes xbsd_fstypes[] = { {BSD_FS_ADVFS, "AdvFS"}, { 0, NULL } }; -#define BSD_FSMAXTYPES (SIZE(xbsd_fstypes)-1) +#define BSD_FSMAXTYPES (ARRAY_SIZE(xbsd_fstypes)-1) #endif diff --git a/fdisk/fdisksunlabel.c b/fdisk/fdisksunlabel.c index 935c92a7..be7b9f6a 100644 --- a/fdisk/fdisksunlabel.c +++ b/fdisk/fdisksunlabel.c @@ -382,7 +382,7 @@ void verify_sun(void) else array[i] = -1; } - qsort(array,SIZE(array),sizeof(array[0]), + qsort(array,ARRAY_SIZE(array),sizeof(array[0]), (int (*)(const void *,const void *)) verify_sun_cmp); if (array[0] == -1) { printf(_("No partitions defined\n")); -- 2.39.5