Module Name:    src
Committed By:   dholland
Date:           Thu Aug 27 00:31:12 UTC 2009

Modified Files:
        src/games/quiz: quiz.c rxp.c

Log Message:
ANSIfy function definitions


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/games/quiz/quiz.c
cvs rdiff -u -r1.12 -r1.13 src/games/quiz/rxp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/quiz/quiz.c
diff -u src/games/quiz/quiz.c:1.25 src/games/quiz/quiz.c:1.26
--- src/games/quiz/quiz.c:1.25	Thu Aug 27 00:24:11 2009
+++ src/games/quiz/quiz.c	Thu Aug 27 00:31:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: quiz.c,v 1.25 2009/08/27 00:24:11 dholland Exp $	*/
+/*	$NetBSD: quiz.c,v 1.26 2009/08/27 00:31:12 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)quiz.c	8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: quiz.c,v 1.25 2009/08/27 00:24:11 dholland Exp $");
+__RCSID("$NetBSD: quiz.c,v 1.26 2009/08/27 00:31:12 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -64,7 +64,6 @@
 static int catone, cattwo, tflag;
 static unsigned qsize;
 
-int	 main(int, char *[]);
 static char *appdstr(char *, const char *, size_t);
 static void downcase(char *);
 static void get_cats(char *, char *);
@@ -76,9 +75,7 @@
 static void usage(void) __dead;
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	int ch;
 	const char *indexfile;
@@ -119,8 +116,7 @@
 }
 
 static void
-get_file(file)
-	const char *file;
+get_file(const char *file)
 {
 	FILE *fp;
 	QE *qp;
@@ -159,7 +155,7 @@
 }
 
 static void
-show_index()
+show_index(void)
 {
 	QE *qp;
 	const char *p, *s;
@@ -192,8 +188,7 @@
 }
 
 static void
-get_cats(cat1, cat2)
-	char *cat1, *cat2;
+get_cats(char *cat1, char *cat2)
 {
 	QE *qp;
 	int i;
@@ -225,7 +220,7 @@
 }
 
 static void
-quiz()
+quiz(void)
 {
 	QE *qp;
 	int i;
@@ -308,8 +303,7 @@
 }
 
 static const char *
-next_cat(s)
-	const char *	s;
+next_cat(const char *s)
 {
 	int esc;
 
@@ -332,10 +326,7 @@
 }
 
 static char *
-appdstr(s, tp, len)
-	char *s;
-	const char *tp;
-	size_t len;
+appdstr(char *s, const char *tp, size_t len)
 {
 	char *mp;
 	const char *sp;
@@ -359,8 +350,7 @@
 }
 
 static void
-score(r, w, g)
-	unsigned r, w, g;
+score(unsigned r, unsigned w, unsigned g)
 {
 	(void)printf("Rights %d, wrongs %d,", r, w);
 	if (g)
@@ -369,8 +359,7 @@
 }
 
 static void
-downcase(p)
-	char *p;
+downcase(char *p)
 {
 	int ch;
 
@@ -380,7 +369,7 @@
 }
 
 static void
-usage()
+usage(void)
 {
 	(void)fprintf(stderr, "quiz [-t] [-i file] category1 category2\n");
 	exit(1);

Index: src/games/quiz/rxp.c
diff -u src/games/quiz/rxp.c:1.12 src/games/quiz/rxp.c:1.13
--- src/games/quiz/rxp.c:1.12	Tue Jan 27 20:30:30 2004
+++ src/games/quiz/rxp.c	Thu Aug 27 00:31:12 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: rxp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $	*/
+/*	$NetBSD: rxp.c,v 1.13 2009/08/27 00:31:12 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)rxp.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: rxp.c,v 1.12 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: rxp.c,v 1.13 2009/08/27 00:31:12 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -87,16 +87,13 @@
 static int	 rxp__match(const char *, int, Rxp_t *, Rxp_t *, const char *);
 
 int
-rxp_compile(s)
-	const char *	s;
+rxp_compile(const char *s)
 {
 	return (rxp__compile(s, TRUE));
 }
 
 static int
-rxp__compile(s, first)
-	const char *s;
-	int first;
+rxp__compile(const char *s, int first)
 {
 	static Rxp_t *rp;
 	static const char *sp;
@@ -192,19 +189,17 @@
  * match string against compiled regular expression
  */
 int
-rxp_match(s)
-	const char *	s;
+rxp_match(const char *s)
 {
 	return (rxp__match(s, TRUE, NULL, NULL, NULL));
 }
 
 static int
-rxp__match(s, first, j_succ, j_fail, sp_fail)
-	const char *s;
-	int first;
-	Rxp_t *j_succ;		/* jump here on successful alt match */
-	Rxp_t *j_fail;		/* jump here on failed match */
-	const char *sp_fail;		/* reset sp to here on failed match */
+rxp__match(const char *s,
+	   int first,
+	   Rxp_t *j_succ,		/* jump here on successful alt match */
+	   Rxp_t *j_fail,		/* jump here on failed match */
+	   const char *sp_fail)		/* reset sp to here on failed match */
 {
 	static Rxp_t *rp;
 	static const char *sp;
@@ -262,14 +257,13 @@
  * Reverse engineer the regular expression, by picking first of all alternates.
  */
 char *
-rxp_expand()
+rxp_expand(void)
 {
 	return (rxp__expand(TRUE));
 }
 
 static char *
-rxp__expand(first)
-	int first;
+rxp__expand(int first)
 {
 	static char buf[RXP_LINE_SZ/2];
 	static Rxp_t *rp;

Reply via email to