From 3aa40fb9dbf5ce28b431281d8296db1820e0ed5f Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sun, 17 Jan 2016 16:07:07 +0000 Subject: The great de-typedef'ification continues. DPME -> struct dpme. --- sbin/pdisk/convert.c | 4 ++-- sbin/pdisk/convert.h | 4 ++-- sbin/pdisk/dpme.h | 3 +-- sbin/pdisk/dump.c | 8 ++++---- sbin/pdisk/partition_map.c | 18 +++++++++--------- sbin/pdisk/partition_map.h | 6 +++--- sbin/pdisk/pdisk.c | 6 +++--- sbin/pdisk/validate.c | 6 +++--- 8 files changed, 27 insertions(+), 28 deletions(-) (limited to 'sbin/pdisk') diff --git a/sbin/pdisk/convert.c b/sbin/pdisk/convert.c index e8f51e3f8a5..c2de3b6f6ea 100644 --- a/sbin/pdisk/convert.c +++ b/sbin/pdisk/convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: convert.c,v 1.9 2016/01/17 14:28:25 krw Exp $ */ +/* $OpenBSD: convert.c,v 1.10 2016/01/17 16:07:06 krw Exp $ */ // // convert.c - Little-endian conversion @@ -66,7 +66,7 @@ void reverse4(u8 *bytes); // Routines // int -convert_dpme(DPME *data, int to_cpu_form) +convert_dpme(struct dpme *data, int to_cpu_form) { #if BYTE_ORDER == LITTLE_ENDIAN // Since we will toss the block if the signature doesn't match diff --git a/sbin/pdisk/convert.h b/sbin/pdisk/convert.h index 2e51db41f5e..033a3f07b36 100644 --- a/sbin/pdisk/convert.h +++ b/sbin/pdisk/convert.h @@ -1,4 +1,4 @@ -/* $OpenBSD: convert.h,v 1.5 2016/01/17 14:28:25 krw Exp $ */ +/* $OpenBSD: convert.h,v 1.6 2016/01/17 16:07:06 krw Exp $ */ // // convert.h - Little-endian conversion @@ -61,6 +61,6 @@ // Forward declarations // int convert_block0(Block0 *data, int to_cpu_form); -int convert_dpme(DPME *data, int to_cpu_form); +int convert_dpme(struct dpme *data, int to_cpu_form); #endif /* __convert__ */ diff --git a/sbin/pdisk/dpme.h b/sbin/pdisk/dpme.h index 64592bf7cbd..26677916ba9 100644 --- a/sbin/pdisk/dpme.h +++ b/sbin/pdisk/dpme.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dpme.h,v 1.7 2016/01/17 14:28:25 krw Exp $ */ +/* $OpenBSD: dpme.h,v 1.8 2016/01/17 16:07:06 krw Exp $ */ // // dpme.h - Disk Partition Map Entry (dpme) @@ -115,7 +115,6 @@ struct dpme { u32 dpme_boot_args[32] ; u32 dpme_reserved_3[62] ; }; -typedef struct dpme DPME; // diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index 2a6efdbcbca..71fb4ec3564 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.23 2016/01/17 15:57:12 krw Exp $ */ +/* $OpenBSD: dump.c,v 1.24 2016/01/17 16:07:06 krw Exp $ */ // // dump.c - dumping partition maps @@ -242,7 +242,7 @@ dump_partition_entry(partition_map *entry, int type_length, int name_length, int { partition_map_header *map; int j; - DPME *p; + struct dpme *p; u32 size; double bytes; int driver; @@ -292,7 +292,7 @@ show_data_structures(partition_map_header *map) DDMap *m; int i; partition_map * entry; - DPME *p; + struct dpme *p; if (map == NULL) { printf("No partition map exists\n"); @@ -386,7 +386,7 @@ void full_dump_partition_entry(partition_map_header *map, int ix) { partition_map * cur; - DPME *p; + struct dpme *p; int i; u32 t; diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c index eb652e5443c..a07407468f9 100644 --- a/sbin/pdisk/partition_map.c +++ b/sbin/pdisk/partition_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.c,v 1.27 2016/01/17 15:57:12 krw Exp $ */ +/* $OpenBSD: partition_map.c,v 1.28 2016/01/17 16:07:06 krw Exp $ */ // // partition_map.c - partition map routines @@ -96,7 +96,7 @@ int coerce_block0(partition_map_header *map); int contains_driver(partition_map *entry); void combine_entry(partition_map *entry); long compute_device_size(char *name); -DPME* create_data(const char *name, const char *dptype, u32 base, u32 length); +struct dpme* create_data(const char *name, const char *dptype, u32 base, u32 length); void delete_entry(partition_map *entry); void insert_in_base_order(partition_map *entry); void insert_in_disk_order(partition_map *entry); @@ -216,7 +216,7 @@ close_partition_map(partition_map_header *map) int read_partition_map(partition_map_header *map) { - DPME *data; + struct dpme *data; u32 limit; int ix; int old_logical; @@ -396,7 +396,7 @@ create_partition_map(char *name, partition_map_header *oldmap) { struct file_media *m; partition_map_header * map; - DPME *data; + struct dpme *data; unsigned long number; long size; @@ -510,7 +510,7 @@ add_partition_to_map(const char *name, const char *dptype, u32 base, u32 length, partition_map_header *map) { partition_map * cur; - DPME *data; + struct dpme *data; enum add_action act; int limit; u32 adjusted_base = 0; @@ -636,10 +636,10 @@ add_partition_to_map(const char *name, const char *dptype, u32 base, u32 length, } -DPME * +struct dpme * create_data(const char *name, const char *dptype, u32 base, u32 length) { - DPME *data; + struct dpme *data; data = calloc(1, DEV_BSIZE); if (data == NULL) { @@ -660,7 +660,7 @@ create_data(const char *name, const char *dptype, u32 base, u32 length) } void -dpme_init_flags(DPME *data) +dpme_init_flags(struct dpme *data) { if (strncasecmp(data->dpme_type, kHFSType, DPISTRLEN) == 0) { /* XXX this is gross, fix it! */ @@ -740,7 +740,7 @@ void delete_partition_from_map(partition_map *entry) { partition_map_header *map; - DPME *data; + struct dpme *data; if (strncasecmp(entry->data->dpme_type, kMapType, DPISTRLEN) == 0) { printf("Can't delete entry for the map itself\n"); diff --git a/sbin/pdisk/partition_map.h b/sbin/pdisk/partition_map.h index 5b324df322a..b0fc1fcad1b 100644 --- a/sbin/pdisk/partition_map.h +++ b/sbin/pdisk/partition_map.h @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.h,v 1.10 2016/01/17 15:57:12 krw Exp $ */ +/* $OpenBSD: partition_map.h,v 1.11 2016/01/17 16:07:06 krw Exp $ */ // // partition_map.h - partition map routines @@ -67,7 +67,7 @@ struct partition_map { long disk_address; struct partition_map_header * the_map; int contains_driver; - DPME *data; + struct dpme *data; int HFS_kind; }; typedef struct partition_map partition_map; @@ -114,6 +114,6 @@ void move_entry_in_map(long, long, partition_map_header *); partition_map_header* open_partition_map(char *name, int *valid_file); void resize_map(long new_size, partition_map_header *map); void write_partition_map(partition_map_header *map); -void dpme_init_flags(DPME *data); +void dpme_init_flags(struct dpme *data); #endif /* __partition_map__ */ diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index b1c5edb2af5..e7af945ee57 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.37 2016/01/17 15:57:12 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.38 2016/01/17 16:07:06 krw Exp $ */ // // pdisk - an editor for Apple format partition tables @@ -121,10 +121,10 @@ main(int argc, char **argv) { int name_index; - if (sizeof(DPME) != DEV_BSIZE) { + if (sizeof(struct dpme) != DEV_BSIZE) { errx(1, "Size of partition map entry (%zu) " "is not equal to block size (%d)\n", - sizeof(DPME), DEV_BSIZE); + sizeof(struct dpme), DEV_BSIZE); } if (sizeof(Block0) != DEV_BSIZE) { errx(1, "Size of block zero structure (%zu) " diff --git a/sbin/pdisk/validate.c b/sbin/pdisk/validate.c index 901ae4370f7..08be343c8ca 100644 --- a/sbin/pdisk/validate.c +++ b/sbin/pdisk/validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: validate.c,v 1.16 2016/01/17 15:57:12 krw Exp $ */ +/* $OpenBSD: validate.c,v 1.17 2016/01/17 16:07:06 krw Exp $ */ // // validate.c - @@ -82,7 +82,7 @@ typedef struct range_list range_list; // static char *buffer; static Block0 *b0; -static DPME *mb; +static struct dpme *mb; static partition_map_header *the_map; static struct file_media *the_media; static int g; @@ -142,7 +142,7 @@ get_block_n(int n) if (read_file_media(the_media, ((long long) n) * g, DEV_BSIZE, (void *)buffer) == 0) { rtn_value = 0; } else { - mb = (DPME *) buffer; + mb = (struct dpme *) buffer; convert_dpme(mb, 1); rtn_value = 1; } -- cgit v1.2.3