From: Karel Zak Date: Thu, 26 Jul 2012 15:56:39 +0000 (+0200) Subject: fdisk: mac: remove magic maclabel macro, mark unused parameters X-Git-Tag: v2.22-rc1~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0a5b91d2efe26093326b0d328dbb0179bf8c604;p=thirdparty%2Futil-linux.git fdisk: mac: remove magic maclabel macro, mark unused parameters Signed-off-by: Karel Zak --- diff --git a/fdisks/fdiskmaclabel.c b/fdisks/fdiskmaclabel.c index f3909ec1b8..34db9d62d6 100644 --- a/fdisks/fdiskmaclabel.c +++ b/fdisks/fdiskmaclabel.c @@ -41,6 +41,8 @@ mac_info( void ) { void mac_nolabel(struct fdisk_context *cxt) { + struct mac_partition *maclabel = (struct mac_partition *) cxt->firstsector; + maclabel->magic = 0; partitions = 4; fdisk_zeroize_firstsector(cxt); @@ -50,6 +52,8 @@ mac_nolabel(struct fdisk_context *cxt) static int mac_probe_label(struct fdisk_context *cxt) { + struct mac_partition *maclabel = (struct mac_partition *) cxt->firstsector; + /* Conversion: only 16 bit should compared e.g.: HFS Label is only 16bit long @@ -80,7 +84,10 @@ IS_MAC: return 1; } -static void mac_add_partition(struct fdisk_context *cxt, int partnum, int parttype) +static void mac_add_partition( + struct fdisk_context *cxt __attribute__ ((__unused__)), + int partnum __attribute__ ((__unused__)), + int parttype __attribute__ ((__unused__))) { printf(_("\tSorry - this fdisk cannot handle Mac disk labels." "\n\tIf you want to add DOS-type partitions, create" diff --git a/fdisks/fdiskmaclabel.h b/fdisks/fdiskmaclabel.h index cd1e1bd5f2..4aaaadd1c6 100644 --- a/fdisks/fdiskmaclabel.h +++ b/fdisks/fdiskmaclabel.h @@ -8,12 +8,12 @@ * the terms of the GNU Public License. */ -typedef struct { +struct mac_partition { unsigned int magic; /* expect MAC_LABEL_MAGIC */ unsigned int fillbytes1[124]; unsigned int physical_volume_id; unsigned int fillbytes2[124]; -} mac_partition; +}; /* MAC magic number only 16bits, do I always know that there are 0200 * following? Problem, after magic the uint16_t res1; follows, I donnno know @@ -27,9 +27,6 @@ typedef struct { #define MAC_LABEL_MAGIC_2_SWAPPED 0x00003505 #define MAC_LABEL_MAGIC_3_SWAPPED 0x0000d405 -/* fdisk.c */ -#define maclabel ((mac_partition *)cxt->firstsector) - /* fdiskmaclabel.c */ extern struct systypes mac_sys_types[]; extern void mac_nolabel(struct fdisk_context *cxt);