summaryrefslogtreecommitdiff
path: root/games/netmaj/patches/patch-am
blob: 95187fefc1980afc85b17a6295620fa2d4a28345 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
$NetBSD: patch-am,v 1.2 2013/02/26 10:29:34 joerg Exp $

--- cui.c.orig	1996-08-06 17:24:30.000000000 +0000
+++ cui.c
@@ -178,7 +178,7 @@ char talk_messages[9][60] = {
 };
 #endif
 
-extern FILE *log;
+extern FILE *logp;
 extern int play_speed;
 extern int auto_stop;
 extern int auto_play;
@@ -207,6 +207,16 @@ int help_index;
 int key_mac[100];
 int key_mac_cnt=0;
 
+#ifndef u_char
+#define u_char unsigned char
+#endif
+
+static void execute_help(global_t *gp);
+static void draw_player(global_t *gp, int who);
+static void draw_river(global_t *gp, int who);
+static void draw_status(global_t *gp);
+static void draw_hand(global_t *gp, int who);
+
 ungetstrx(str) unsigned char *str; {
 	int len;
 	int i;
@@ -361,7 +371,7 @@ retry:
 	return ret;
 }
 
-ui_event_wait(gp,time_out) global_t *gp; {
+void ui_event_wait(global_t *gp, int time_out) {
 	fd_set fds;
 	struct timeval to,*top;
 	int fd,fd2;
@@ -380,7 +390,7 @@ ui_event_wait(gp,time_out) global_t *gp;
 		return;	
 	}
 	if (fd == -1) {
-		return 1;
+		return;
 	}
 
 	FD_ZERO( &fds );
@@ -462,7 +472,7 @@ ui_message_gend(gp) global_t *gp; {
 			fclose(fp);
 		}
 	}
-	if (log) log_game(gp,log);
+	if (logp) log_game(gp,logp);
 }
 
 ui_message_player(gp) global_t *gp; {
@@ -721,7 +731,7 @@ ui_draw(gp,redraw) global_t *gp; {
 	ch_play = 0;
 }
 
-draw_status(gp) global_t *gp; {
+static void draw_status(global_t *gp) {
 
 	if (!ch_dora && !ch_play) return;
 	ch_dora = 0;
@@ -768,7 +778,7 @@ draw_status(gp) global_t *gp; {
 }
 
 
-draw_player(gp,who) global_t *gp; {
+static void draw_player(global_t *gp, int who) {
 	int i;
 	int pp;
 
@@ -791,7 +801,7 @@ draw_player(gp,who) global_t *gp; {
 	printw("  %7d ",player[pp].ppoint);
 }
 
-draw_river(gp,who) global_t *gp; {
+static void draw_river(global_t *gp, int who) {
 	int i,pai;
 	int pp;
 	int max;
@@ -832,7 +842,7 @@ draw_river(gp,who) global_t *gp; {
 	clrtoeol();
 }
 
-draw_hand(gp,who) global_t *gp; {
+static void draw_hand(global_t *gp, int who) {
 	int i,j,k,n;
 	int pp,pai,naki;
 
@@ -978,7 +988,7 @@ retry:
 	return R_TIE;
 }
 
-ui_choice(gp) global_t *gp; {
+void ui_choice(global_t *gp) {
 	int i,j,n,ret,pai,oldpai,kan;
 	char *args[25];
 	int pais[25];
@@ -1087,7 +1097,7 @@ ui_result(gp) global_t *gp; {
 			fclose(fp);
 		}
 	}
-	if (log) log_play(gp,log);
+	if (logp) log_play(gp,logp);
 }
 
 
@@ -1447,7 +1457,7 @@ cleanup_wstack() {
 	wstack_cnt = 0;
 }
 
-execute_help(gp) global_t *gp; {
+static void execute_help(global_t *gp) {
 	extern char *program;
 	static char *pages[500];
 	static int page_num;