summaryrefslogtreecommitdiff
path: root/sbin/pdisk
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-01-17 19:15:56 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-01-17 19:15:56 +0000
commitff8fd7eba7ea4fe90f1132a0ce39b7cee592d14c (patch)
tree60b0161964f24032ab54c51a642e3ea19351df5a /sbin/pdisk
parent5db06af4f824eff841d51c1fc857f885f1ebaa43 (diff)
Kill leading, imbedded, trailing whitespace.
Diffstat (limited to 'sbin/pdisk')
-rw-r--r--sbin/pdisk/dpme.h24
-rw-r--r--sbin/pdisk/dump.c46
-rw-r--r--sbin/pdisk/io.c4
-rw-r--r--sbin/pdisk/partition_map.c10
-rw-r--r--sbin/pdisk/pdisk.c18
-rw-r--r--sbin/pdisk/validate.c12
6 files changed, 57 insertions, 57 deletions
diff --git a/sbin/pdisk/dpme.h b/sbin/pdisk/dpme.h
index ee916ebb145..63ab6cf7da6 100644
--- a/sbin/pdisk/dpme.h
+++ b/sbin/pdisk/dpme.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dpme.h,v 1.14 2016/01/17 18:57:52 krw Exp $ */
+/* $OpenBSD: dpme.h,v 1.15 2016/01/17 19:15:55 krw Exp $ */
//
// dpme.h - Disk Partition Map Entry (dpme)
@@ -48,22 +48,22 @@
#define DPME_SIGNATURE 0x504D /* i.e. 'PM' */
struct block0 {
- uint16_t sbSig; /* unique value for SCSI block 0 */
- uint16_t sbBlkSize; /* block size of device */
- uint32_t sbBlkCount; /* number of blocks on device */
- uint16_t sbDevType; /* device type */
- uint16_t sbDevId; /* device id */
- uint32_t sbData; /* not used */
- uint16_t sbDrvrCount; /* driver descriptor count */
- uint16_t sbMap[247]; /* descriptor map */
+ uint16_t sbSig; /* unique value for SCSI block 0 */
+ uint16_t sbBlkSize; /* block size of device */
+ uint32_t sbBlkCount; /* number of blocks on device */
+ uint16_t sbDevType; /* device type */
+ uint16_t sbDevId; /* device id */
+ uint32_t sbData; /* not used */
+ uint16_t sbDrvrCount; /* driver descriptor count */
+ uint16_t sbMap[247]; /* descriptor map */
};
// Where &sbMap[0] is actually an array struct ddmap[sbDrvrCount]
// kludge to get around alignment junk
struct ddmap {
- uint32_t ddBlock; /* 1st driver's starting block (in sbBlkSize blocks!) */
- uint16_t ddSize; /* size of 1st driver (512-byte blks) */
- uint16_t ddType; /* system type (1 for Mac+) */
+ uint32_t ddBlock; /* 1st driver's starting block (in sbBlkSize blocks!) */
+ uint16_t ddSize; /* size of 1st driver (512-byte blks) */
+ uint16_t ddType; /* system type (1 for Mac+) */
};
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c
index c1bebeecdb7..acd37304e21 100644
--- a/sbin/pdisk/dump.c
+++ b/sbin/pdisk/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.31 2016/01/17 18:57:52 krw Exp $ */
+/* $OpenBSD: dump.c,v 1.32 2016/01/17 19:15:55 krw Exp $ */
//
// dump.c - dumping partition maps
@@ -386,10 +386,10 @@ full_dump_partition_entry(struct partition_map_header *map, int ix)
if (p->dpme_flags & DPME_OS_PIC_CODE) printf("pic ");
t = p->dpme_flags >> 7;
for (i = 7; i <= 31; i++) {
- if (t & 0x1) {
- printf("%d ", i);
- }
- t = t >> 1;
+ if (t & 0x1) {
+ printf("%d ", i);
+ }
+ t = t >> 1;
}
printf("\n");
@@ -423,14 +423,14 @@ dump_block(unsigned char *addr, int len)
#define OTHER_LEN 8
for (i = 0; i < len; i = limit) {
- limit1 = i + LINE_LEN;
- if (limit1 > len) {
- limit = len;
- } else {
- limit = limit1;
- }
+ limit1 = i + LINE_LEN;
+ if (limit1 > len) {
+ limit = len;
+ } else {
+ limit = limit1;
+ }
printf("\n%03x: ", i);
- for (j = i; j < limit1; j++) {
+ for (j = i; j < limit1; j++) {
if (j % UNIT_LEN == 0) {
printf(" ");
}
@@ -439,18 +439,18 @@ dump_block(unsigned char *addr, int len)
} else {
printf(" ");
}
- }
+ }
printf(" ");
- for (j = i; j < limit; j++) {
+ for (j = i; j < limit; j++) {
if (j % OTHER_LEN == 0) {
printf(" ");
}
- if (addr[j] < ' ') {
- printf(".");
- } else {
- printf("%c", addr[j]);
- }
- }
+ if (addr[j] < ' ') {
+ printf(".");
+ } else {
+ printf("%c", addr[j]);
+ }
+ }
}
printf("\n");
}
@@ -482,9 +482,9 @@ full_dump_block_zero(struct partition_map_header *map)
printf(" driver count: %u\n", zp->sbDrvrCount);
m = (struct ddmap *) zp->sbMap;
for (i = 0; &m[i].ddType < &zp->sbMap[247]; i++) {
- if (m[i].ddBlock == 0 && m[i].ddSize == 0 && m[i].ddType == 0) {
- break;
- }
+ if (m[i].ddBlock == 0 && m[i].ddSize == 0 && m[i].ddType == 0) {
+ break;
+ }
printf(" driver %3u block: %u\n", i+1, m[i].ddBlock);
printf(" size in blocks: %u\n", m[i].ddSize);
printf(" driver type: 0x%x\n", m[i].ddType);
diff --git a/sbin/pdisk/io.c b/sbin/pdisk/io.c
index cb331218e51..08e4966c052 100644
--- a/sbin/pdisk/io.c
+++ b/sbin/pdisk/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.13 2016/01/17 18:57:52 krw Exp $ */
+/* $OpenBSD: io.c,v 1.14 2016/01/17 19:15:55 krw Exp $ */
//
// io.c - simple io and input parsing routines
@@ -377,7 +377,7 @@ get_partition_modifier(void)
c = my_getch();
if (c == 'p' || c == 'P') {
- result = 1;
+ result = 1;
} else if (c > 0) {
my_ungetch(c);
}
diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c
index f40f809c713..8d597304d06 100644
--- a/sbin/pdisk/partition_map.c
+++ b/sbin/pdisk/partition_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.c,v 1.33 2016/01/17 18:57:52 krw Exp $ */
+/* $OpenBSD: partition_map.c,v 1.34 2016/01/17 19:15:55 krw Exp $ */
//
// partition_map.c - partition map routines
@@ -744,7 +744,7 @@ delete_partition_from_map(struct partition_map *entry)
return;
}
if (entry->contains_driver) {
- remove_driver(entry); // update block0 if necessary
+ remove_driver(entry); // update block0 if necessary
}
free(entry->data);
entry->HFS_kind = kHFS_not;
@@ -817,7 +817,7 @@ combine_entry(struct partition_map *entry)
// new end is maximum of two ends
end = p->data->dpme_pblock_start + p->data->dpme_pblocks;
if (end > entry->data->dpme_pblock_start + entry->data->dpme_pblocks) {
- entry->data->dpme_pblocks = end - entry->data->dpme_pblock_start;
+ entry->data->dpme_pblocks = end - entry->data->dpme_pblock_start;
}
entry->data->dpme_lblocks = entry->data->dpme_pblocks;
delete_entry(p);
@@ -1161,7 +1161,7 @@ read_block(struct partition_map_header *map, unsigned long num, char *buf)
{
//printf("read block %d\n", num);
return read_file_media(map->m, ((long long) num) * map->logical_block,
- DEV_BSIZE, (void *)buf);
+ DEV_BSIZE, (void *)buf);
}
@@ -1169,5 +1169,5 @@ int
write_block(struct partition_map_header *map, unsigned long num, char *buf)
{
return write_file_media(map->m, ((long long) num) * map->logical_block,
- DEV_BSIZE, (void *)buf);
+ DEV_BSIZE, (void *)buf);
}
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c
index f4cc2efd6cf..1fc7908b71b 100644
--- a/sbin/pdisk/pdisk.c
+++ b/sbin/pdisk/pdisk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdisk.c,v 1.41 2016/01/17 18:57:52 krw Exp $ */
+/* $OpenBSD: pdisk.c,v 1.42 2016/01/17 19:15:55 krw Exp $ */
//
// pdisk - an editor for Apple format partition tables
@@ -117,7 +117,7 @@ main(int argc, char **argv)
edit(argv[name_index++]);
}
} else {
- usage();
+ usage();
}
return 0;
}
@@ -184,7 +184,7 @@ edit(char *name)
map = open_partition_map(name, &valid_file);
if (!valid_file) {
- return;
+ return;
}
printf("Edit %s -\n", name);
@@ -280,7 +280,7 @@ edit(char *name)
if (!rflag) {
do_write_partition_map(map);
} else {
- goto do_error;
+ goto do_error;
}
break;
default:
@@ -680,7 +680,7 @@ do_display_block(struct partition_map_header *map, char *alt_name)
static long next_number = -1;
if (map != NULL) {
- name = 0;
+ name = 0;
m = map->m;
g = map->logical_block;
} else {
@@ -708,9 +708,9 @@ do_display_block(struct partition_map_header *map, char *alt_name)
goto xit;
}
if (display_block == NULL || display_g < g) {
- if (display_block != NULL) {
- free(display_block);
- display_g = 0;
+ if (display_block != NULL) {
+ free(display_block);
+ display_g = 0;
}
display_block = malloc(g);
if (display_block == NULL) {
@@ -748,7 +748,7 @@ do_display_entry(struct partition_map_header *map)
return;
}
if (number == 0) {
- full_dump_block_zero(map);
+ full_dump_block_zero(map);
} else {
full_dump_partition_entry(map, number);
}
diff --git a/sbin/pdisk/validate.c b/sbin/pdisk/validate.c
index c38863ea1b6..45c61cd5094 100644
--- a/sbin/pdisk/validate.c
+++ b/sbin/pdisk/validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: validate.c,v 1.22 2016/01/17 18:57:52 krw Exp $ */
+/* $OpenBSD: validate.c,v 1.23 2016/01/17 19:15:55 krw Exp $ */
//
// validate.c -
@@ -155,8 +155,8 @@ add_range(struct range_list **list, uint32_t base, uint32_t len, int allocate)
uint32_t high;
if (list == 0 || *list == 0) {
- /* XXX initialized list will always have one element */
- return;
+ /* XXX initialized list will always have one element */
+ return;
}
low = base;
@@ -313,7 +313,7 @@ validate_map(struct partition_map_header *map)
//printf("Validation not implemented yet.\n");
if (map == NULL) {
- the_map = 0;
+ the_map = 0;
if (get_string_argument("Name of device: ", &name, 1) == 0) {
bad_input("Bad name");
return;
@@ -333,7 +333,7 @@ validate_map(struct partition_map_header *map)
}
} else {
- name = 0;
+ name = 0;
the_map = map;
g = map->logical_block;
}
@@ -374,7 +374,7 @@ check_map:
if (limit < 0) {
/* XXX what to use for end of list? */
if (i > 5) {
- break;
+ break;
}
} else if (i > limit) {
break;