updated on Fri Jan 20 04:00:45 UTC 2012
[aur-mirror.git] / spider / slack-diff+small-fixes.patch
blob4e1abba8afcb17149d814d8326675bf1955eb1c7
1 diff -Naur spider.orig/defs.h spider/defs.h
2 --- spider.orig/defs.h 1991-09-28 19:46:21.000000000 +0200
3 +++ spider/defs.h 2011-08-20 03:21:42.411243136 +0200
4 @@ -17,6 +17,7 @@
5 #include <X11/Xutil.h>
6 #include <X11/Xos.h>
7 #include <stdio.h>
8 +#include <stdlib.h>
9 #include "assert.h"
10 #include "copyright.h"
12 @@ -31,7 +32,7 @@
14 typedef enum {Faceup, Facedown, Joker} Type;
16 -#else DEBUG
17 +#else /* DEBUG */
19 typedef char Suit;
20 typedef char Rank;
21 @@ -60,7 +61,7 @@
22 #define Facedown 1
23 #define Joker 2
25 -#endif DEBUG
26 +#endif /* DEBUG */
28 #define NUM_DECKS 2
29 #define NUM_PILES 8
30 diff -Naur spider.orig/gfx.c spider/gfx.c
31 --- spider.orig/gfx.c 1991-09-28 19:46:10.000000000 +0200
32 +++ spider/gfx.c 2011-08-20 04:07:56.200657689 +0200
33 @@ -166,7 +166,7 @@
34 gcflags |= GCFont;
36 textgc = XCreateGC(dpy, RootWindow(dpy, screen), gcflags, &gcv);
37 -#endif KITLESS
38 +#endif /* KITLESS */
40 tmpmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
41 logo_bits, logo_width, logo_height);
42 @@ -1321,7 +1321,7 @@
43 XDrawImageString(dpy, message_win, textgc, MESSAGE_X, message_y,
44 last_message, strlen(last_message));
46 -#endif KITLESS
47 +#endif /* KITLESS */
49 void
50 card_message(str, card)
51 diff -Naur spider.orig/globals.h spider/globals.h
52 --- spider.orig/globals.h 1991-09-28 19:46:20.000000000 +0200
53 +++ spider/globals.h 2011-08-20 03:18:35.033442225 +0200
54 @@ -90,12 +90,12 @@
55 void button_press();
56 void button_release();
57 void do_expand();
58 -#endif KITLESS
59 +#endif /* KITLESS */
61 #ifdef XAW
62 Bool can_get_help_files();
63 #endif
65 -extern char *malloc();
66 -extern char *calloc();
67 -extern char *realloc();
68 +extern void *malloc();
69 +extern void *calloc();
70 +extern void *realloc();
71 diff -Naur spider.orig/movelog.c spider/movelog.c
72 --- spider.orig/movelog.c 1991-09-28 19:46:17.000000000 +0200
73 +++ spider/movelog.c 2011-08-20 03:22:50.550140339 +0200
74 @@ -33,6 +33,21 @@
76 extern int cheat_count;
78 +Rank flip_ranks[NUM_RANKS] = {
79 + King, Queen, Jack, Ten, Nine, Eight, Seven,
80 + Six, Five, Four, Three, Deuce, Ace
81 +};
83 +static int
84 +card_to_int(card)
85 +CardPtr card;
87 +int val;
89 + val = card->suit * 13 + flip_ranks[card->rank];
90 + return (val);
93 make_deck_cache()
95 CardPtr tmp;
96 @@ -280,11 +295,6 @@
100 -Rank flip_ranks[NUM_RANKS] = {
101 - King, Queen, Jack, Ten, Nine, Eight, Seven,
102 - Six, Five, Four, Three, Deuce, Ace
105 static void
106 int_to_card(val, suit, rank)
107 int val;
108 @@ -298,16 +308,6 @@
109 assert (*rank >= Ace && *suit <= King);
112 -static int
113 -card_to_int(card)
114 -CardPtr card;
116 -int val;
118 - val = card->suit * 13 + flip_ranks[card->rank];
119 - return (val);
122 static CardPtr
123 find_card(cache, suit, rank)
124 CardPtr *cache;
125 @@ -709,6 +709,23 @@
129 +static int
130 +restore_game(str, str2)
131 +char *str, *str2;
134 + if (read_position(str) != 0) {
135 + return (-1);
138 + init_cache(); /* clear out the move cache */
140 + if (str2)
141 + read_moves(str2);
143 + return (0);
146 read_selection(buf)
147 char *buf;
149 @@ -786,23 +803,6 @@
150 show_message(buf);
153 -static int
154 -restore_game(str, str2)
155 -char *str, *str2;
158 - if (read_position(str) != 0) {
159 - return (-1);
162 - init_cache(); /* clear out the move cache */
164 - if (str2)
165 - read_moves(str2);
167 - return (0);
171 * play the same deck again
173 diff -Naur spider.orig/spider.c spider/spider.c
174 --- spider.orig/spider.c 1991-09-28 19:46:12.000000000 +0200
175 +++ spider/spider.c 2011-08-20 04:19:23.259260596 +0200
176 @@ -619,7 +619,7 @@
178 return (type_names[type]);
180 -#endif DEBUG
181 +#endif /* DEBUG */
185 diff -Naur spider.orig/windows.c spider/windows.c
186 --- spider.orig/windows.c 1991-09-28 19:46:15.000000000 +0200
187 +++ spider/windows.c 2011-08-20 03:23:34.517277892 +0200
188 @@ -116,7 +116,7 @@
189 XMapWindow(dpy, message_win);
190 XMapWindow(dpy, table);
192 -#endif KITLESS
193 +#endif /* KITLESS */
195 #ifndef KITLESS
196 table_init(win)
197 @@ -140,4 +140,4 @@
199 XChangeWindowAttributes(dpy, table, winmask, &winattr);
201 -#endif KITLESS
202 +#endif /* KITLESS */
203 diff -Naur spider.orig/xaw_ui.c spider/xaw_ui.c
204 --- spider.orig/xaw_ui.c 1991-09-28 19:46:51.000000000 +0200
205 +++ spider/xaw_ui.c 2011-08-20 04:03:09.000000000 +0200
206 @@ -429,30 +429,25 @@
207 confirm_box = XtCreatePopupShell("prompt", transientShellWidgetClass,
208 toplevel, args, n);
210 - n = 0;
211 confirmpane = XtCreateManagedWidget("confirmbox", panedWidgetClass,
212 confirm_box, args, n);
214 - n = 0;
215 XtSetArg(args[n], XtNshowGrip, False); n++;
216 confirm_label = XtCreateManagedWidget("confirmlabel", labelWidgetClass,
217 confirmpane, args, n);
219 - n = 0;
220 XtSetArg(args[n], XtNshowGrip, False); n++;
221 XtSetArg(args[n], XtNorientation, XtorientHorizontal); n++;
222 confirmbox = XtCreateManagedWidget("confirmbox", boxWidgetClass,
223 confirmpane, args, n);
225 - n = 0;
226 button = XtCreateManagedWidget("confirmok", commandWidgetClass,
227 confirmbox, args, n);
228 - XtAddCallback(button, XtNcallback, confirm_callback, 1);
229 + XtAddCallback(button, XtNcallback, confirm_callback, (int *) 1);
231 - n = 0;
232 button = XtCreateManagedWidget("confirmcancel", commandWidgetClass,
233 confirmbox, args, n);
234 - XtAddCallback(button, XtNcallback, confirm_callback, 2);
235 + XtAddCallback(button, XtNcallback, confirm_callback, (int *) 2);
239 @@ -489,66 +484,54 @@
241 Widget help, helpbox, helpform, helpview;
242 Widget button;
243 -int n;
244 +int n = 0;
245 Arg args[10];
247 - n = 0;
248 help = XtCreatePopupShell("Spider Help", topLevelShellWidgetClass,
249 toplevel, args, n);
251 - n = 0;
252 helpbox = XtCreateManagedWidget("helpbox", panedWidgetClass,
253 help, args, n);
255 - n = 0;
256 XtSetArg(args[n], XtNshowGrip, False); n++;
257 XtSetArg(args[n], XtNorientation, XtorientHorizontal); n++;
258 helpform = XtCreateManagedWidget("helpform", boxWidgetClass,
259 helpbox, args, n);
261 - n = 0;
262 button = XtCreateManagedWidget("helpintro", commandWidgetClass,
263 helpform, args, n);
264 - XtAddCallback(button, XtNcallback, change_help, 1);
265 + XtAddCallback(button, XtNcallback, change_help, (int *) 1);
267 - n = 0;
268 button = XtCreateManagedWidget("helprules", commandWidgetClass,
269 helpform, args, n);
270 - XtAddCallback(button, XtNcallback, change_help, 2);
271 + XtAddCallback(button, XtNcallback, change_help, (int *) 2);
273 - n = 0;
274 button = XtCreateManagedWidget("helpcontrols", commandWidgetClass,
275 helpform, args, n);
276 - XtAddCallback(button, XtNcallback, change_help, 3);
277 + XtAddCallback(button, XtNcallback, change_help, (int *) 3);
279 - n = 0;
280 button = XtCreateManagedWidget("helpexamples", commandWidgetClass,
281 helpform, args, n);
282 - XtAddCallback(button, XtNcallback, change_help, 4);
283 + XtAddCallback(button, XtNcallback, change_help, (int *) 4);
285 - n = 0;
286 button = XtCreateManagedWidget("helpmisc", commandWidgetClass,
287 helpform, args, n);
288 - XtAddCallback(button, XtNcallback, change_help, 5);
289 + XtAddCallback(button, XtNcallback, change_help, (int *) 5);
291 - n = 0;
292 button = XtCreateManagedWidget("helpsummary", commandWidgetClass,
293 helpform, args, n);
294 - XtAddCallback(button, XtNcallback, change_help, 6);
295 + XtAddCallback(button, XtNcallback, change_help, (int *) 6);
297 - n = 0;
298 button = XtCreateManagedWidget("helpexit", commandWidgetClass,
299 helpform, args, n);
300 - XtAddCallback(button, XtNcallback, change_help, 7);
301 + XtAddCallback(button, XtNcallback, change_help, (int *) 7);
303 - n = 0;
304 XtSetArg(args[n], XtNshowGrip, False); n++;
305 XtSetArg(args[n], XtNallowHoriz, True); n++;
306 XtSetArg(args[n], XtNallowVert, True); n++;
307 helpview = XtCreateManagedWidget("helpview", viewportWidgetClass,
308 helpbox, args, n);
310 - n = 0;
311 XtSetArg(args[n], XtNheight, 300); n++;
312 XtSetArg(args[n], XtNwidth, 550); n++;
313 XtSetArg(args[n], XtNtype, XawAsciiFile); n++;