DragonFly BSD
DragonFly submit List (threaded) for 2005-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[PATCH] games/piano cleanup


From: Peter Avalos <pavalos@xxxxxxxxxxxx>
Date: Sun, 1 May 2005 03:43:47 -0700

WARNS6 for games/piano:

http://www.theshell.com/~pavalos/wip/piano.patch

Index: Makefile
===================================================================
RCS file: /ftp/pub/DragonFly/dcvs/src/games/piano/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile	17 Jun 2003 04:25:24 -0000	1.2
+++ Makefile	30 Apr 2005 04:02:30 -0000
@@ -6,5 +6,6 @@
 MAN=	piano.6
 DPADD=	${LIBCURSES} ${LIBTERMCAP}
 LDADD=	-lcurses -ltermcap
+WARNS?=	6
 
 .include <bsd.prog.mk>
Index: piano.c
===================================================================
RCS file: /ftp/pub/DragonFly/dcvs/src/games/piano/piano.c,v
retrieving revision 1.2
diff -u -r1.2 piano.c
--- piano.c	17 Jun 2003 04:25:24 -0000	1.2
+++ piano.c	30 Apr 2005 04:16:29 -0000
@@ -14,9 +14,9 @@
 
 char *myname;
 int verbose;
-static char *initcmd = "t160 o1 l16 ml";
+static const char *initcmd = "t160 o1 l16 ml";
 
-static char usage_msg[] =
+static const char usage_msg[] =
 	"simple keyboard player V0.8086\n"
 	"usage: %s [-v][-i str]\n"
 	"\t-i str defaults 't160 o1 l16 ml'\n"
@@ -28,10 +28,10 @@
 
 struct kdef_t {
 	int ch;
-	char *str;
+	const char *str;
 };
 
-static char *kstr[256];
+static const char *kstr[256];
 
 static struct kdef_t kdef[] = {
 	/* white key */
@@ -81,12 +81,13 @@
 }/* init_kstr */
 
 static int
-fdputs(const char *s, int fd, int echo)
+fdputs(const char *s, int fd, int p_echo)
 {
-	int err, len = strlen(s);
+	int err;
+	size_t len = strlen(s);
 	write(fd, s, len);
 	err = write(fd, "\n", 1);
-	if (echo) {
+	if (p_echo) {
 		fputs(s, stdout);
 	}
 	return err;

Attachment: pgp00001.pgp
Description: PGP signature



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]