svn commit: r201608 - head/usr.sbin/cdcontrol

David Malone dwmalone at FreeBSD.org
Tue Jan 5 20:40:41 UTC 2010


Author: dwmalone
Date: Tue Jan  5 20:40:40 2010
New Revision: 201608
URL: http://svn.freebsd.org/changeset/base/201608

Log:
  New style function definitions.
  Fix constness problem - don't know that pstatus won't change a string with no
  whitespace.

Modified:
  head/usr.sbin/cdcontrol/cdcontrol.c

Modified: head/usr.sbin/cdcontrol/cdcontrol.c
==============================================================================
--- head/usr.sbin/cdcontrol/cdcontrol.c	Tue Jan  5 20:38:59 2010	(r201607)
+++ head/usr.sbin/cdcontrol/cdcontrol.c	Tue Jan  5 20:40:40 2010	(r201608)
@@ -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
 }
 
 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;


More information about the svn-src-head mailing list