From d0a5b91d2efe26093326b0d328dbb0179bf8c604 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 26 Jul 2012 17:56:39 +0200 Subject: [PATCH] fdisk: mac: remove magic maclabel macro, mark unused parameters Signed-off-by: Karel Zak --- fdisks/fdiskmaclabel.c | 9 ++++++++- fdisks/fdiskmaclabel.h | 7 ++----- 2 files changed, 10 insertions(+), 6 deletions(-) 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); -- 2.47.3