summaryrefslogtreecommitdiff
blob: dd5f1c8837c489bf2e107f76a59faf202198bac7 (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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
--- kdots/kdots.cpp.old	2006-04-29 02:10:41.000000000 +0200
+++ kdots/kdots.cpp	2006-04-29 02:14:43.000000000 +0200
@@ -160,39 +160,39 @@
 
 	switch(op)
 	{
-		case proto->msgseat:
+		case KDotsProto::msgseat:
 			proto->getSeat();
 			if(proto->num == 1) emit signalColor(QColor(0, 0, 250));
 			else if(proto->num == 0) emit signalColor(QColor(0, 0, 50));
 			else emit signalColor(QColor(255, 255, 255));
 			break;
-		case proto->msgplayers:
+		case KDotsProto::msgplayers:
 			proto->getPlayers();
 			if(proto->state != proto->statechoose) proto->state = proto->statewait;
 			break;
-		case proto->msgoptions:
+		case KDotsProto::msgoptions:
 			proto->getOptions();
 			dots->resizeBoard(proto->width - 1, proto->height - 1);
 			dots->refreshBoard();
 			break;
-		case proto->reqmove:
+		case KDotsProto::reqmove:
 			emit signalStatus(i18n("Your turn."));
 			proto->state = proto->statemove;
 			proto->turn = proto->num;
 			break;
-		case proto->msgmoveh:
+		case KDotsProto::msgmoveh:
 			proto->getOppMove(proto->sndmoveh);
 			dots->setBorderValue(proto->movex, proto->movey, QDots::right, proto->turn, Dots::move);
 			dots->repaint();
 			if(proto->num < 0) proto->turn = !proto->turn;
 			break;
-		case proto->msgmovev:
+		case KDotsProto::msgmovev:
 			proto->getOppMove(proto->sndmovev);
 			dots->setBorderValue(proto->movex, proto->movey, QDots::down, proto->turn, Dots::move);
 			dots->repaint();
 			if(proto->num < 0) proto->turn = !proto->turn;
 			break;
-		case proto->rspmove:
+		case KDotsProto::rspmove:
 			if(proto->getMove() != -1)
 			{
 				dots->setBorderValue(proto->m_lastx, proto->m_lasty, proto->m_lastdir, proto->turn, Dots::move);
@@ -204,7 +204,7 @@
 				emit signalStatus(i18n("Invalid move, please try again!"));
 			}
 			break;
-		case proto->msggameover:
+		case KDotsProto::msggameover:
 			savepath = QDir::home().path() + "/.ggz";
 			dir.mkdir(savepath);
 			savepath += "/games";
@@ -229,10 +229,10 @@
 				exit(-1);
 			}
 			break;
-		case proto->sndsync:
+		case KDotsProto::sndsync:
 			gamesync();
 			break;
-		case proto->reqoptions:
+		case KDotsProto::reqoptions:
 			slotOptions();
 			break;
 		default:
--- ktictactux/ktictactux.cpp.old	2006-04-29 02:26:43.000000000 +0200
+++ ktictactux/ktictactux.cpp	2006-04-29 02:34:11.000000000 +0200
@@ -82,15 +82,15 @@
 	QWhiteFrame *tmp;
 	int id;
 
-	if(proto->state != proto->statemove) return;
+	if(proto->state != (int)proto->statemove) return;
 	if(m_turn != proto->num) return;
 
 	//id = widget->winId() - m_firstid;
 	tmp = reinterpret_cast<QWhiteFrame*>(widget);
 	id = tmp->id();
 
-	if(proto->board[id % 3][id / 3] == proto->player) return;
-	if(proto->board[id % 3][id / 3] == proto->opponent) return;
+	if(proto->board[id % 3][id / 3] == (int)proto->player) return;
+	if(proto->board[id % 3][id / 3] == (int)proto->opponent) return;
 
 	if(m_opponent == PLAYER_AI)
 	{
@@ -110,7 +110,7 @@
 // Prepare your turn
 void KTicTacTux::yourTurn()
 {
-	if((m_opponent == PLAYER_AI) || (proto->state == proto->statemove)) emit signalStatus(i18n("Your turn"));
+	if((m_opponent == PLAYER_AI) || (proto->state == (int)proto->statemove)) emit signalStatus(i18n("Your turn"));
 	proto->state = proto->statemove;
 }
 
@@ -166,7 +166,7 @@
 	// Check for draw (no empty fields left)
 	for(int j = 0; j < 3; j++)
 		for(int i = 0; i < 3; i++)
-			if(proto->board[i][j] == proto->none)
+			if(proto->board[i][j] == (int)proto->none)
 			{
 				m_x = i;
 				m_y = j;
@@ -283,14 +283,14 @@
 			{
 				if((proto->board[i][j] == c)
 				&& (proto->board[2 - i][2 - j] != c)
-				&& (proto->board[2 - i][2 - j] != proto->none))
+				&& (proto->board[2 - i][2 - j] != (int)proto->none))
 				{
-					if(proto->board[i][2 - j] == proto->none)
+					if(proto->board[i][2 - j] == (int)proto->none)
 					{
 						m_x = i;
 						m_y = 2 - j;
 					}
-					if(proto->board[2 - i][j] == proto->none)
+					if(proto->board[2 - i][j] == (int)proto->none)
 					{
 						m_x = 2 - i;
 						m_y = j;
@@ -319,17 +319,17 @@
 	{
 		x = xo + xp * i;
 		y = yo + yp * i;
-		if((proto->board[trip(x)][trip(y)] != proto->none)
+		if((proto->board[trip(x)][trip(y)] != (int)proto->none)
 		&& (proto->board[trip(x + xp)][trip(y + yp)] == proto->board[trip(x)][trip(y)]))
 		{
 			if(proto->board[trip(x + xp * 2)][trip(y + yp * 2)] != proto->board[trip(x)][trip(y)])
 			{
-				if((proto->board[trip(x + xp * 2)][trip(y + yp * 2)] == proto->none) && (!m_seewinner))
+				if((proto->board[trip(x + xp * 2)][trip(y + yp * 2)] == (int)proto->none) && (!m_seewinner))
 				{
 					m_x = trip(x + xp * 2);
 					m_y = trip(y + yp * 2);
 					// take unlimited chance
-					if(proto->board[trip(x)][trip(y)] == proto->opponent) m_seewinner = 1;
+					if(proto->board[trip(x)][trip(y)] == (int)proto->opponent) m_seewinner = 1;
 				}
 			}
 			else m_winner = proto->board[trip(x + xp * 2)][trip(y + yp * 2)];
@@ -389,33 +389,33 @@
 
 	switch(op)
 	{
-		case proto->msgseat:
+		case KTicTacTuxProto::msgseat:
 			proto->getSeat();
 			break;
-		case proto->msgplayers:
+		case KTicTacTuxProto::msgplayers:
 			proto->getPlayers();
 			proto->state = proto->statewait;
 			if((proto->num >= 0) && (proto->names[!proto->num][0]))
 				emit signalScore(i18n("Network game with %1").arg(proto->names[!proto->num]));
 			break;
-		case proto->reqmove:
+		case KTicTacTuxProto::reqmove:
 			proto->state = proto->statemove;
 			m_turn = proto->num;
 			emit signalStatus(i18n("Your move"));
 			break;
-		case proto->rspmove:
+		case KTicTacTuxProto::rspmove:
 			switch(proto->getMoveStatus())
 			{
-				case proto->errstate:
+				case KTicTacTuxProto::errstate:
 					emit signalStatus(i18n("*server*"));
 					break;
-				case proto->errturn:
+				case KTicTacTuxProto::errturn:
 					emit signalStatus(i18n("*turn*"));
 					break;
-				case proto->errbound:
+				case KTicTacTuxProto::errbound:
 					emit signalStatus(i18n("*bounds*"));
 					break;
-				case proto->errfull:
+				case KTicTacTuxProto::errfull:
 					emit signalStatus(i18n("*occupied*"));
 					break;
 				default:
@@ -423,18 +423,18 @@
 			}
 			getNextTurn();
 			break;
-		case proto->msgmove:
+		case KTicTacTuxProto::msgmove:
 			proto->getOpponentMove();
 			if(proto->num < 0) emit signalStatus(i18n("Watching the game"));
 			break;
-		case proto->sndsync:
+		case KTicTacTuxProto::sndsync:
 			proto->getSync();
 			break;
 //		case proto->sndstats:
 //			proto->getStatistics();
 //			emit signalNetworkScore(proto->stats[0], proto->stats[1]);
 //			break;
-		case proto->msggameover:
+		case KTicTacTuxProto::msggameover:
 			proto->getGameOver();
 			proto->state = proto->statedone;
 			gameOver();
@@ -450,10 +450,10 @@
 	{
 		switch(proto->board[i % 3][i / 3])
 		{
-			case proto->player:
+			case KTicTacTuxProto::player:
 				frame[i % 3][i / 3]->setPaletteBackgroundPixmap(QPixmap(m_t1));
 				break;
-			case proto->opponent:
+			case KTicTacTuxProto::opponent:
 				frame[i % 3][i / 3]->setPaletteBackgroundPixmap(QPixmap(m_t2));
 				break;
 			default:
--- koenig/game.cc.old	2006-04-29 02:41:38.000000000 +0200
+++ koenig/game.cc	2006-04-29 02:41:48.000000000 +0200
@@ -95,10 +95,10 @@
 		case CHESS_MSG_PLAYERS:
 			kdDebug(12101) << "Got an MSG_PLAYERS" << endl;
 
-			if (GGZ_SEAT_OPEN != (chessInfo.assign[0] = ggz->getChar()))
+			if ((int)GGZ_SEAT_OPEN != (chessInfo.assign[0] = ggz->getChar()))
 				chessInfo.name[0] = ggz->getString();
 
-			if (GGZ_SEAT_OPEN != (chessInfo.assign[1] = ggz->getChar()))
+			if ((int)GGZ_SEAT_OPEN != (chessInfo.assign[1] = ggz->getChar()))
 				chessInfo.name[1] = ggz->getString();
 
 			kdDebug(12101) << "Got players " << chessInfo.name[0]
--- kcc/kcc.cpp.old	2006-04-29 02:50:16.000000000 +0200
+++ kcc/kcc.cpp	2006-04-29 02:53:19.000000000 +0200
@@ -152,7 +152,7 @@
 	// Check for draw (no empty fields left)
 	for(int j = 0; j < 3; j++)
 		for(int i = 0; i < 3; i++)
-			if(proto->board[i][j] == KCCProto::none)
+			if(proto->board[i][j] == (int)KCCProto::none)
 			{
 				m_x = i;
 				m_y = j;
@@ -298,30 +298,30 @@
 
 	switch(op)
 	{
-		case proto->cc_msg_seat:
+		case KCCProto::cc_msg_seat:
 			proto->getSeat();
 			kdDebug() << "*proto* got my seat: " << proto->num << endl;
 			break;
-		case proto->cc_msg_players:
+		case KCCProto::cc_msg_players:
 			proto->getPlayers();
 			proto->state = KCCProto::statewait;
 			emit signalScore(i18n("Network game"));
 			kdDebug() << "*proto* got players " << endl;
 			break;
-		case proto->cc_req_move:
+		case KCCProto::cc_req_move:
 			proto->state = KCCProto::statemove;
 			m_turn = proto->num;
 			emit signalStatus(i18n("Your move"));
 			kdDebug() << "*proto* move requested" << endl;
 			break;
-		case proto->cc_rsp_move:
+		case KCCProto::cc_rsp_move:
 			proto->getMoveStatus();
 			switch(proto->status)
 			{
-				case proto->errnone:
+				case KCCProto::errnone:
 					status = i18n("Move accepted");
 					break;
-				case proto->errstate:
+				case KCCProto::errstate:
 					status = i18n("Table not yet full");
 					break;
 				default:
@@ -332,7 +332,7 @@
 			//getNextTurn();
 			kdDebug() << "*proto* rsp_move " << status << ": " << (int)proto->status << endl;
 
-			if(proto->status == KCCProto::errnone)
+			if(proto->status == (int)KCCProto::errnone)
 			{
 				findTarget(QPoint(m_fx, m_fy), QPoint(m_tx, m_ty), false);
 				tmp = proto->board[m_fx][m_fy];
@@ -342,7 +342,7 @@
 			}
 			m_fx = -1;
 			break;
-		case proto->cc_msg_move:
+		case KCCProto::cc_msg_move:
 			kdDebug() << "*proto* msg_move" << endl;
 			proto->getOpponentMove();
 			//if(proto->num < 0) emit signalStatus(i18n("Watching the game"));
@@ -352,11 +352,11 @@
 			proto->board[proto->m_ox1][proto->m_oy1] = 1;
 			proto->board[proto->m_ox2][proto->m_oy2] = tmp;
 			break;
-		case proto->cc_msg_sync:
+		case KCCProto::cc_msg_sync:
 			proto->getSync();
 			kdDebug() << "*proto* sync" << endl;
 			break;
-		case proto->cc_msg_gameover:
+		case KCCProto::cc_msg_gameover:
 			proto->getGameOver();
 			kdDebug() << "*proto* gameover" << endl;
 			proto->state = KCCProto::statedone;
@@ -376,7 +376,7 @@
 	//setMask(QBitmap(QString("%1/kcc/mask.png").arg(GGZDATADIR)));
 	p.begin(&b);
 
-	if(proto->state != KCCProto::statenone)
+	if(proto->state != (int)KCCProto::statenone)
 		for(int j = 0; j < 17; j++)
 			for(int i = 0; i < 15; i++)
 			{