diff options
author | jhb <jhb@FreeBSD.org> | 2006-02-28 21:49:33 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-02-28 21:49:33 +0000 |
commit | 1ec49d602a80028377023a0fdc8f11d6281a3b18 (patch) | |
tree | 29ca37782709cff55cee2300ecd6319423660211 /usr.sbin/sade | |
parent | 6dd5abcf92dd9a747d9ec038a372392b97daf728 (diff) | |
download | FreeBSD-src-1ec49d602a80028377023a0fdc8f11d6281a3b18.zip FreeBSD-src-1ec49d602a80028377023a0fdc8f11d6281a3b18.tar.gz |
Fix numerous warnings. Aside from menu items in system.c and menu.c
this now compiles on i386 with WARNS?= 3. Most of the fixes included
adding missing 'static' keywords to internal functions, using fully-defined
terminators in statically defined arrays of structs, and various
signed vs unsigned mismatches. Also G/C'd unused configSecurity()
function.
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r-- | usr.sbin/sade/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/sade/config.c | 13 | ||||
-rw-r--r-- | usr.sbin/sade/disks.c | 2 | ||||
-rw-r--r-- | usr.sbin/sade/dmenu.c | 2 | ||||
-rw-r--r-- | usr.sbin/sade/label.c | 1 | ||||
-rw-r--r-- | usr.sbin/sade/sade.h | 5 | ||||
-rw-r--r-- | usr.sbin/sade/wizard.c | 4 |
7 files changed, 10 insertions, 19 deletions
diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile index 5ce9b34..751d10c 100644 --- a/usr.sbin/sade/Makefile +++ b/usr.sbin/sade/Makefile @@ -96,7 +96,7 @@ keymap.h: echo -n ' { "'$$map'", ' >> keymap.tmp ; \ echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \ done - ( echo " { 0 }"; echo "};" ; echo "" ) >> keymap.tmp + ( echo " { NULL, NULL }"; echo "};" ; echo "" ) >> keymap.tmp mv keymap.tmp keymap.h countries.h: ${.CURDIR}/../../share/misc/iso3166 diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index 632c242..ba8e1cd 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/config.c @@ -268,7 +268,7 @@ configFstab(dialogMenuItem *self) * returns number of lines read. line contents * are malloc'd and must be freed by the caller. */ -int +static int readConfig(char *config, char **lines, int max) { FILE *fp; @@ -606,17 +606,6 @@ configSecurelevelNetworkSecure(dialogMenuItem *self) } int -configSecurity(dialogMenuItem *self) -{ - WINDOW *w = savescr(); - - dialog_clear_norefresh(); - dmenuOpenSimple(&MenuSecurity, FALSE); - restorescr(w); - return DITEM_SUCCESS; -} - -int configResolv(dialogMenuItem *ditem) { FILE *fp; diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index b60012f..68dd987 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -180,7 +180,7 @@ print_chunks(Disk *d, int u) } static void -print_command_summary() +print_command_summary(void) { mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice F = `DD' mode"); diff --git a/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c index aed89d8..a197188 100644 --- a/usr.sbin/sade/dmenu.c +++ b/usr.sbin/sade/dmenu.c @@ -261,7 +261,7 @@ dmenuVarsCheck(dialogMenuItem *item) int dmenuRadioCheck(dialogMenuItem *item) { - return (*((unsigned int *)item->data) == item->aux); + return (*((int *)item->data) == item->aux); } static int diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index 3b2cee2..2a432da 100644 --- a/usr.sbin/sade/label.c +++ b/usr.sbin/sade/label.c @@ -837,7 +837,6 @@ print_command_summary(void) static void clear_wins(void) { - extern void print_label_chunks(); clear(); print_label_chunks(); } diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index d3a24c0..9940392 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -268,6 +268,9 @@ typedef struct _layout { void *obj; /* The obj pointer returned by libdialog */ } Layout; +/* Layout array terminator. */ +#define LAYOUT_END { 0, 0, 0, 0, NULL, NULL, NULL, 0, NULL } + typedef enum { DEVICE_TYPE_NONE, DEVICE_TYPE_DISK, @@ -355,7 +358,7 @@ typedef struct _opt { enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; void *data; void *aux; - char *(*check)(); + char *(*check)(struct _opt *); } Option; /* Weird index nodey things we use for keeping track of package information */ diff --git a/usr.sbin/sade/wizard.c b/usr.sbin/sade/wizard.c index 98e0a5c..c221e55 100644 --- a/usr.sbin/sade/wizard.c +++ b/usr.sbin/sade/wizard.c @@ -15,7 +15,7 @@ #include <err.h> #include <libdisk.h> -int +static int scan_block(int fd, daddr_t block) { u_char foo[512]; @@ -27,7 +27,7 @@ scan_block(int fd, daddr_t block) return 0; } -void +static void Scan_Disk(Disk *d) { char device[64]; |