From 319097faa5bb37caea0e46b8ddcf36ea46b8d932 Mon Sep 17 00:00:00 2001 From: Mike Heffner Date: Sun, 9 Dec 2001 18:40:56 +0000 Subject: [PATCH] WARNS=2 cleanup. PR: bin/32646 MFC after: 2 weeks --- usr.sbin/cdcontrol/Makefile | 2 ++ usr.sbin/cdcontrol/cdcontrol.c | 28 ++++++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/usr.sbin/cdcontrol/Makefile b/usr.sbin/cdcontrol/Makefile index a505e3a3e4a2..ce790340ad45 100644 --- a/usr.sbin/cdcontrol/Makefile +++ b/usr.sbin/cdcontrol/Makefile @@ -5,4 +5,6 @@ PROG= cdcontrol DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap +WARNS?= 2 + .include diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 3e272d3f66f7..f5dc3fc3fce9 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -78,9 +78,9 @@ static const char rcsid[] = struct cmdtab { int command; - char *name; - unsigned min; - char *args; + const char *name; + unsigned min; + const char *args; } cmdtab[] = { { CMD_CLOSE, "close", 1, "" }, { CMD_DEBUG, "debug", 1, "on | off" }, @@ -103,7 +103,7 @@ struct cmdtab { { CMD_STOP, "stop", 3, "" }, { CMD_VOLUME, "volume", 1, " | left | right | mute | mono | stereo" }, { CMD_CDID, "cdid", 2, "" }, -{ 0, } +{ 0, NULL, 0, NULL } }; struct cd_toc_entry toc_buffer[100]; @@ -133,11 +133,18 @@ unsigned int msf2lba __P((u_char m, u_char s, u_char f)); int play_blocks __P((int blk, int len)); int run __P((int cmd, char *arg)); char *parse __P((char *buf, int *cmd)); +void help __P((void)); +void usage __P((void)); +char *use_cdrom_instead __P((const char *)); +__const char *strstatus __P((int)); +static u_int dbprog_discid __P((void)); +__const char *cdcontrol_prompt __P((void)); void help () { struct cmdtab *c; - char *s, n; + const char *s; + char n; int i; for (c=cmdtab; c->name; ++c) { @@ -165,7 +172,7 @@ void usage () exit (1); } -char *use_cdrom_instead(char *old_envvar) +char *use_cdrom_instead(const char *old_envvar) { char *device; @@ -427,7 +434,8 @@ int run (int cmd, char *arg) int play (char *arg) { struct ioc_toc_header h; - int rc, n, start, end = 0, istart = 1, iend = 1; + unsigned int n; + int rc, start, end = 0, istart = 1, iend = 1; rc = ioctl (fd, CDIOREADTOCHEADER, &h); @@ -736,7 +744,7 @@ int next_prev (char *arg, int cmd) return (play_track (trk, 1, n, 1)); } -char *strstatus (int sts) +const char *strstatus (int sts) { switch (sts) { case ASTS_INVALID: return ("invalid"); @@ -905,7 +913,7 @@ int cdid () return id ? 0 : 1; } -int info (char *arg) +int info (char *arg __unused) { struct ioc_toc_header h; int rc, i, n; @@ -1146,7 +1154,7 @@ char *parse (char *buf, int *cmd) { struct cmdtab *c; char *p; - int len; + unsigned int len; for (p=buf; isspace (*p); p++) continue;