summaryrefslogtreecommitdiff
path: root/sbin/pdisk/convert.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/pdisk/convert.c')
-rw-r--r--sbin/pdisk/convert.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/sbin/pdisk/convert.c b/sbin/pdisk/convert.c
index 5793eb73800..42c2c77366b 100644
--- a/sbin/pdisk/convert.c
+++ b/sbin/pdisk/convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: convert.c,v 1.18 2016/01/18 14:49:24 krw Exp $ */
+/* $OpenBSD: convert.c,v 1.19 2016/01/22 17:49:07 krw Exp $ */
/*
* convert.c - Little-endian conversion
@@ -34,42 +34,42 @@
#include "convert.h"
-void reverse2 (uint8_t *);
-void reverse4 (uint8_t *);
+void reverse2 (uint8_t *);
+void reverse4 (uint8_t *);
int
-convert_dpme(struct 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
* we don't need to check the signature down here.
*/
- reverse2((uint8_t *) & data->dpme_signature);
- reverse2((uint8_t *) & data->dpme_reserved_1);
- reverse4((uint8_t *) & data->dpme_map_entries);
- reverse4((uint8_t *) & data->dpme_pblock_start);
- reverse4((uint8_t *) & data->dpme_pblocks);
- reverse4((uint8_t *) & data->dpme_lblock_start);
- reverse4((uint8_t *) & data->dpme_lblocks);
- reverse4((uint8_t *) & data->dpme_flags);
- reverse4((uint8_t *) & data->dpme_boot_block);
- reverse4((uint8_t *) & data->dpme_boot_bytes);
- reverse4((uint8_t *) & data->dpme_load_addr);
- reverse4((uint8_t *) & data->dpme_load_addr_2);
- reverse4((uint8_t *) & data->dpme_goto_addr);
- reverse4((uint8_t *) & data->dpme_goto_addr_2);
- reverse4((uint8_t *) & data->dpme_checksum);
+ reverse2((uint8_t *)&data->dpme_signature);
+ reverse2((uint8_t *)&data->dpme_reserved_1);
+ reverse4((uint8_t *)&data->dpme_map_entries);
+ reverse4((uint8_t *)&data->dpme_pblock_start);
+ reverse4((uint8_t *)&data->dpme_pblocks);
+ reverse4((uint8_t *)&data->dpme_lblock_start);
+ reverse4((uint8_t *)&data->dpme_lblocks);
+ reverse4((uint8_t *)&data->dpme_flags);
+ reverse4((uint8_t *)&data->dpme_boot_block);
+ reverse4((uint8_t *)&data->dpme_boot_bytes);
+ reverse4((uint8_t *)&data->dpme_load_addr);
+ reverse4((uint8_t *)&data->dpme_load_addr_2);
+ reverse4((uint8_t *)&data->dpme_goto_addr);
+ reverse4((uint8_t *)&data->dpme_goto_addr_2);
+ reverse4((uint8_t *)&data->dpme_checksum);
#endif
return 0;
}
int
-convert_block0(struct block0 * data, int to_cpu_form)
+convert_block0(struct block0 *data, int to_cpu_form)
{
#if BYTE_ORDER == LITTLE_ENDIAN
- struct ddmap *m;
+ struct ddmap *m;
uint16_t count;
int i;
@@ -80,9 +80,9 @@ convert_block0(struct block0 * data, int to_cpu_form)
* the count to use.
*/
if (to_cpu_form) {
- reverse2((uint8_t *) & data->sbSig);
+ reverse2((uint8_t *)&data->sbSig);
if (data->sbSig != BLOCK0_SIGNATURE) {
- reverse2((uint8_t *) & data->sbSig);
+ reverse2((uint8_t *)&data->sbSig);
if (data->sbSig != BLOCK0_SIGNATURE) {
return 0;
}
@@ -91,27 +91,27 @@ convert_block0(struct block0 * data, int to_cpu_form)
if (data->sbSig != BLOCK0_SIGNATURE) {
return 0;
}
- reverse2((uint8_t *) & data->sbSig);
+ reverse2((uint8_t *)&data->sbSig);
}
- reverse2((uint8_t *) & data->sbBlkSize);
- reverse4((uint8_t *) & data->sbBlkCount);
- reverse2((uint8_t *) & data->sbDevType);
- reverse2((uint8_t *) & data->sbDevId);
- reverse4((uint8_t *) & data->sbData);
+ reverse2((uint8_t *)&data->sbBlkSize);
+ reverse4((uint8_t *)&data->sbBlkCount);
+ reverse2((uint8_t *)&data->sbDevType);
+ reverse2((uint8_t *)&data->sbDevId);
+ reverse4((uint8_t *)&data->sbData);
if (to_cpu_form) {
- reverse2((uint8_t *) & data->sbDrvrCount);
+ reverse2((uint8_t *)&data->sbDrvrCount);
count = data->sbDrvrCount;
} else {
count = data->sbDrvrCount;
- reverse2((uint8_t *) & data->sbDrvrCount);
+ reverse2((uint8_t *)&data->sbDrvrCount);
}
if (count > 0) {
m = (struct ddmap *) data->sbMap;
for (i = 0; i < count; i++) {
- reverse4((uint8_t *) & m[i].ddBlock);
- reverse2((uint8_t *) & m[i].ddSize);
- reverse2((uint8_t *) & m[i].ddType);
+ reverse4((uint8_t *)&m[i].ddBlock);
+ reverse2((uint8_t *)&m[i].ddSize);
+ reverse2((uint8_t *)&m[i].ddType);
}
}
#endif
@@ -120,7 +120,7 @@ convert_block0(struct block0 * data, int to_cpu_form)
void
-reverse2(uint8_t * bytes)
+reverse2(uint8_t *bytes)
{
uint8_t t;
@@ -131,7 +131,7 @@ reverse2(uint8_t * bytes)
void
-reverse4(uint8_t * bytes)
+reverse4(uint8_t *bytes)
{
uint8_t t;