Mon May 25 23:44:04 2009 UTC ()
We don't need a private #define "unsgn" for "unsigned", especially since
it was used exactly once.


(dholland)
diff -r1.12 -r1.13 src/games/mille/comp.c
diff -r1.15 -r1.16 src/games/mille/mille.h

cvs diff -r1.12 -r1.13 src/games/mille/comp.c (expand / switch to unified diff)

--- src/games/mille/comp.c 2009/05/25 23:34:50 1.12
+++ src/games/mille/comp.c 2009/05/25 23:44:04 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: comp.c,v 1.12 2009/05/25 23:34:50 dholland Exp $ */ 1/* $NetBSD: comp.c,v 1.13 2009/05/25 23:44:04 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1993 4 * Copyright (c) 1982, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -24,46 +24,46 @@ @@ -24,46 +24,46 @@
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#ifndef lint 33#ifndef lint
34#if 0 34#if 0
35static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93"; 35static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
36#else 36#else
37__RCSID("$NetBSD: comp.c,v 1.12 2009/05/25 23:34:50 dholland Exp $"); 37__RCSID("$NetBSD: comp.c,v 1.13 2009/05/25 23:44:04 dholland Exp $");
38#endif 38#endif
39#endif /* not lint */ 39#endif /* not lint */
40 40
41#include "mille.h" 41#include "mille.h"
42 42
43/* 43/*
44 * @(#)comp.c 1.1 (Berkeley) 4/1/82 44 * @(#)comp.c 1.1 (Berkeley) 4/1/82
45 */ 45 */
46 46
47#define V_VALUABLE 40 47#define V_VALUABLE 40
48 48
49void 49void
50calcmove(void) 50calcmove(void)
51{ 51{
52 CARD card; 52 CARD card;
53 int *value; 53 int *value;
54 PLAY *pp, *op; 54 PLAY *pp, *op;
55 bool foundend, cango, canstop, foundlow; 55 bool foundend, cango, canstop, foundlow;
56 unsgn int i, count200, badcount, nummin, nummax, diff; 56 unsigned int i, count200, badcount, nummin, nummax, diff;
57 int curmin, curmax; 57 int curmin, curmax;
58 CARD safe, oppos; 58 CARD safe, oppos;
59 int valbuf[HAND_SZ], count[NUM_CARDS]; 59 int valbuf[HAND_SZ], count[NUM_CARDS];
60 bool playit[HAND_SZ]; 60 bool playit[HAND_SZ];
61 61
62 wmove(Score, ERR_Y, ERR_X); /* get rid of error messages */ 62 wmove(Score, ERR_Y, ERR_X); /* get rid of error messages */
63 wclrtoeol(Score); 63 wclrtoeol(Score);
64 pp = &Player[COMP]; 64 pp = &Player[COMP];
65 op = &Player[PLAYER]; 65 op = &Player[PLAYER];
66 safe = 0; 66 safe = 0;
67 cango = 0; 67 cango = 0;
68 canstop = FALSE; 68 canstop = FALSE;
69 foundend = FALSE; 69 foundend = FALSE;

cvs diff -r1.15 -r1.16 src/games/mille/mille.h (expand / switch to unified diff)

--- src/games/mille/mille.h 2009/05/25 23:34:50 1.15
+++ src/games/mille/mille.h 2009/05/25 23:44:04 1.16
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mille.h,v 1.15 2009/05/25 23:34:50 dholland Exp $ */ 1/* $NetBSD: mille.h,v 1.16 2009/05/25 23:44:04 dholland Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1982, 1993 4 * Copyright (c) 1982, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -42,27 +42,26 @@ @@ -42,27 +42,26 @@
42#include <stdlib.h> 42#include <stdlib.h>
43#include <string.h> 43#include <string.h>
44#include <termios.h> 44#include <termios.h>
45#include <unistd.h> 45#include <unistd.h>
46 46
47/* 47/*
48 * @(#)mille.h 1.1 (Berkeley) 4/1/82 48 * @(#)mille.h 1.1 (Berkeley) 4/1/82
49 */ 49 */
50 50
51/* 51/*
52 * Miscellaneous constants 52 * Miscellaneous constants
53 */ 53 */
54 54
55#define unsgn unsigned 
56#define CARD short 55#define CARD short
57 56
58#define HAND_SZ 7 /* number of cards in a hand */ 57#define HAND_SZ 7 /* number of cards in a hand */
59#define DECK_SZ 101 /* number of cards in decks */ 58#define DECK_SZ 101 /* number of cards in decks */
60#define NUM_SAFE 4 /* number of saftey cards */ 59#define NUM_SAFE 4 /* number of saftey cards */
61#define NUM_MILES 5 /* number of milestones types */ 60#define NUM_MILES 5 /* number of milestones types */
62#define NUM_CARDS 20 /* number of types of cards */ 61#define NUM_CARDS 20 /* number of types of cards */
63#define BOARD_Y 17 /* size of board screen */ 62#define BOARD_Y 17 /* size of board screen */
64#define BOARD_X 40 63#define BOARD_X 40
65#define MILES_Y 7 /* size of mileage screen */ 64#define MILES_Y 7 /* size of mileage screen */
66#define MILES_X 80 65#define MILES_X 80
67#define SCORE_Y 17 /* size of score screen */ 66#define SCORE_Y 17 /* size of score screen */
68#define SCORE_X 40 67#define SCORE_X 40