summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-01-23 23:25:59 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-01-23 23:25:59 +0000
commita248861f9f102bd6e21bfea260fd70f319b06d76 (patch)
tree044099788373062817779ce7e80e175d9e82f6c4 /sbin
parent0eeb4117b4bb956f7a79d66ab2af45d87d9ca322 (diff)
Nuke unused kPatchType. Nuke kStringNot and use " not' where needed.
Nuke kStringEmpty and use "" where needed. Nuke unused static 'g'. Eliminate #include's in *.h files. Some whitespace fixes.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pdisk/convert.c3
-rw-r--r--sbin/pdisk/convert.h4
-rw-r--r--sbin/pdisk/dump.c14
-rw-r--r--sbin/pdisk/dump.h4
-rw-r--r--sbin/pdisk/partition_map.c4
-rw-r--r--sbin/pdisk/partition_map.h5
-rw-r--r--sbin/pdisk/pdisk.c3
-rw-r--r--sbin/pdisk/validate.c28
-rw-r--r--sbin/pdisk/validate.h4
9 files changed, 30 insertions, 39 deletions
diff --git a/sbin/pdisk/convert.c b/sbin/pdisk/convert.c
index 5f5c8b88d10..13782840540 100644
--- a/sbin/pdisk/convert.c
+++ b/sbin/pdisk/convert.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: convert.c,v 1.22 2016/01/22 18:57:42 krw Exp $ */
+/* $OpenBSD: convert.c,v 1.23 2016/01/23 23:25:58 krw Exp $ */
/*
* convert.c - Little-endian conversion
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <endian.h>
+#include "dpme.h"
#include "convert.h"
void reverse2 (uint8_t *);
diff --git a/sbin/pdisk/convert.h b/sbin/pdisk/convert.h
index 3b7ef46a9d1..dd6330c1dce 100644
--- a/sbin/pdisk/convert.h
+++ b/sbin/pdisk/convert.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: convert.h,v 1.10 2016/01/17 23:18:19 krw Exp $ */
+/* $OpenBSD: convert.h,v 1.11 2016/01/23 23:25:58 krw Exp $ */
/*
* convert.h - Little-endian conversion
@@ -34,8 +34,6 @@
#ifndef __convert__
#define __convert__
-#include "dpme.h"
-
int convert_block0(struct block0 *, int);
int convert_dpme(struct dpme *, int);
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c
index 8734f20c5cb..3864287da76 100644
--- a/sbin/pdisk/dump.c
+++ b/sbin/pdisk/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.46 2016/01/23 03:46:18 krw Exp $ */
+/* $OpenBSD: dump.c,v 1.47 2016/01/23 23:25:58 krw Exp $ */
/*
* dump.c - dumping partition maps
@@ -31,15 +31,14 @@
#include <stdlib.h>
#include <string.h>
+#include "dpme.h"
#include "file_media.h"
+#include "partition_map.h"
#include "dump.h"
#include "io.h"
#define get_align_long(x) (*(x))
-const char *kStringEmpty = "";
-const char *kStringNot = " not";
-
void adjust_value_and_compute_prefix(double *, int *);
void dump_block_zero(struct partition_map_header *);
void dump_partition_entry(struct partition_map *, int, int, int);
@@ -183,9 +182,8 @@ show_data_structures(struct partition_map_header * map)
printf("map %d blocks out of %d, media %lu blocks (%d byte blocks)\n",
map->blocks_in_map, map->maximum_in_map,
map->media_size, map->logical_block);
- printf("Map is%s writable", rflag ? kStringNot : kStringEmpty);
- printf(" and has%s been changed\n", (map->changed) ? kStringEmpty :
- kStringNot);
+ printf("Map is%s writable", rflag ? " not" : "");
+ printf(" and has%s been changed\n", (map->changed) ? "" : " not");
printf("\n");
zp = map->block0;
@@ -205,7 +203,7 @@ show_data_structures(struct partition_map_header * map)
printf("No drivers\n");
} else {
printf("%u driver%s-\n", zp->sbDrvrCount,
- (zp->sbDrvrCount > 1) ? "s" : kStringEmpty);
+ (zp->sbDrvrCount > 1) ? "s" : "");
m = (struct ddmap *) zp->sbMap;
for (i = 0; i < zp->sbDrvrCount; i++) {
printf("%u: @ %u for %u, type=0x%x\n", i + 1,
diff --git a/sbin/pdisk/dump.h b/sbin/pdisk/dump.h
index 9f66d36296c..3661a477aa2 100644
--- a/sbin/pdisk/dump.h
+++ b/sbin/pdisk/dump.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.h,v 1.13 2016/01/22 00:38:53 krw Exp $ */
+/* $OpenBSD: dump.h,v 1.14 2016/01/23 23:25:58 krw Exp $ */
/*
* dump.h - dumping partition maps
@@ -30,8 +30,6 @@
#ifndef __dump__
#define __dump__
-#include "partition_map.h"
-
void dump_block(unsigned char *, int);
void dump_partition_map(struct partition_map_header *);
void full_dump_partition_entry(struct partition_map_header *, int);
diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c
index 23454ce084d..4537b3716e3 100644
--- a/sbin/pdisk/partition_map.c
+++ b/sbin/pdisk/partition_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.c,v 1.58 2016/01/23 15:05:52 krw Exp $ */
+/* $OpenBSD: partition_map.c,v 1.59 2016/01/23 23:25:58 krw Exp $ */
/*
* partition_map.c - partition map routines
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
+#include "dpme.h"
#include "partition_map.h"
#include "io.h"
#include "convert.h"
@@ -47,7 +48,6 @@ const char *kFreeType = "Apple_Free";
const char *kMapType = "Apple_partition_map";
const char *kUnixType = "OpenBSD";
const char *kHFSType = "Apple_HFS";
-const char *kPatchType = "Apple_Patches";
const char *kFreeName = "Extra";
diff --git a/sbin/pdisk/partition_map.h b/sbin/pdisk/partition_map.h
index 25bcaf7ee53..8f09419e8aa 100644
--- a/sbin/pdisk/partition_map.h
+++ b/sbin/pdisk/partition_map.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.h,v 1.27 2016/01/23 15:05:52 krw Exp $ */
+/* $OpenBSD: partition_map.h,v 1.28 2016/01/23 23:25:58 krw Exp $ */
/*
* partition_map.h - partition map routines
@@ -30,9 +30,6 @@
#ifndef __partition_map__
#define __partition_map__
-#include "dpme.h"
-#include "file_media.h"
-
struct partition_map_header {
char *name;
struct partition_map *disk_order;
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c
index 8965f688ad6..8eeef92ae72 100644
--- a/sbin/pdisk/pdisk.c
+++ b/sbin/pdisk/pdisk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pdisk.c,v 1.64 2016/01/23 22:55:23 krw Exp $ */
+/* $OpenBSD: pdisk.c,v 1.65 2016/01/23 23:25:58 krw Exp $ */
/*
* pdisk - an editor for Apple format partition tables
@@ -43,6 +43,7 @@
#include <unistd.h>
#include <util.h>
+#include "dpme.h"
#include "io.h"
#include "partition_map.h"
#include "dump.h"
diff --git a/sbin/pdisk/validate.c b/sbin/pdisk/validate.c
index d6b594ebd76..0268682db6f 100644
--- a/sbin/pdisk/validate.c
+++ b/sbin/pdisk/validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: validate.c,v 1.34 2016/01/23 03:46:18 krw Exp $ */
+/* $OpenBSD: validate.c,v 1.35 2016/01/23 23:25:58 krw Exp $ */
/*
* validate.c -
@@ -31,6 +31,8 @@
#include <stdio.h>
#include <stdlib.h>
+#include "dpme.h"
+#include "partition_map.h"
#include "validate.h"
#include "convert.h"
#include "io.h"
@@ -43,20 +45,19 @@ enum range_state {
};
struct range_list {
- struct range_list *next;
- struct range_list *prev;
- enum range_state state;
- int valid;
- uint32_t start;
- uint32_t end;
+ struct range_list *next;
+ struct range_list *prev;
+ enum range_state state;
+ int valid;
+ uint32_t start;
+ uint32_t end;
};
-static char *buffer;
-static struct block0 *b0;
-static struct dpme *mb;
-static struct partition_map_header *the_map;
-static int the_fd;
-static int g;
+static struct partition_map_header *the_map;
+static struct block0 *b0;
+static struct dpme *mb;
+static char *buffer;
+static int the_fd;
int get_block_n(int);
struct range_list *new_range_list_item(enum range_state state, int, uint32_t, uint32_t);
@@ -274,7 +275,6 @@ validate_map(struct partition_map_header * map)
uint32_t limit;
the_map = map;
- g = map->logical_block;
initialize_list(&list);
diff --git a/sbin/pdisk/validate.h b/sbin/pdisk/validate.h
index 463939645d7..758ee92de1c 100644
--- a/sbin/pdisk/validate.h
+++ b/sbin/pdisk/validate.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: validate.h,v 1.8 2016/01/17 23:18:19 krw Exp $ */
+/* $OpenBSD: validate.h,v 1.9 2016/01/23 23:25:58 krw Exp $ */
/*
* validate.h -
@@ -30,8 +30,6 @@
#ifndef __validate__
#define __validate__
-#include "partition_map.h"
-
void validate_map(struct partition_map_header *);
#endif /* __validate__ */