From a0dce5cf22b7c2ceef7a745abd732f54a5447b7c Mon Sep 17 00:00:00 2001 From: dwmalone Date: Tue, 5 Jan 2010 20:40:40 +0000 Subject: New style function definitions. Fix constness problem - don't know that pstatus won't change a string with no whitespace. --- usr.sbin/cdcontrol/cdcontrol.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'usr.sbin/cdcontrol') diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index a4b13d8..526f599 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -152,7 +152,7 @@ __const char *strstatus(int); static u_int dbprog_discid(void); __const char *cdcontrol_prompt(void); -void help () +void help (void) { struct cmdtab *c; const char *s; @@ -178,7 +178,7 @@ void help () printf ("\tThe plain target address is taken as a synonym for play.\n"); } -void usage () +void usage (void) { fprintf (stderr, "usage: cdcontrol [-sv] [-f device] [command ...]\n"); exit (1); @@ -413,8 +413,11 @@ int run (int cmd, char *arg) if (fd < 0 && !open_cd ()) return (0); - if (! strlen (arg)) - return pstatus ("volume"); + if (! strlen (arg)) { + char volume[] = "volume"; + + return pstatus (volume); + } if (! strncasecmp (arg, "left", strlen(arg))) return ioctl (fd, CDIOCSETLEFT); @@ -899,7 +902,7 @@ dbprog_sum(int n) * The integer disc ID. */ static u_int -dbprog_discid() +dbprog_discid(void) { struct ioc_toc_header h; int rc; @@ -930,7 +933,7 @@ dbprog_discid() return((n % 0xff) << 24 | t << 8 | ntr); } -int cdid () +int cdid (void) { u_int id; @@ -1130,7 +1133,7 @@ int status (int *trk, int *min, int *sec, int *frame) } const char * -cdcontrol_prompt() +cdcontrol_prompt(void) { return ("cdcontrol> "); } @@ -1249,7 +1252,7 @@ char *parse (char *buf, int *cmd) return p; } -int open_cd () +int open_cd (void) { char devbuf[MAXPATHLEN]; const char *dev; -- cgit v1.1