Package: xonix / 1.4-31

10-makefile=11-x11.c-CAN-2004-0157-and-other=12-compile-fixes.patch Patch series | download
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
From d05709429e42a5cc505b55f9728178ddaf86aa45 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Thu, 17 Dec 2009 17:16:18 +0200
Subject: [PATCH] x11.c: compiling fixes


Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 x11.c |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/x11.c b/x11.c
index eb197c5..51f151b 100644
--- a/x11.c
+++ b/x11.c
@@ -165,7 +165,7 @@ static int screenno;
 static int depth;
 static Screen *screen;
 static Colormap cmap;
-static int winx, winy;
+/* static int winx, winy; */
 static AppResources resources;
 static int exiting = 0;
 
@@ -174,6 +174,9 @@ Display      *dpy;
 Window       canv;
 Dimension    sizex, sizey;
 
+/* Forward declarations */
+extern void Do_New (void); /* xonix.c */
+
 static GC default_gc, empty_gc;
 static Pixmap runner_pm, flyer_pm, eater_pm, filled_pm, empty_pm, way_pm;
 static Dims empty_dims, filled_dims, way_dims;
@@ -370,7 +373,7 @@ void
 x11_init(int argc, char **argv)
 {
   XGCValues v;
-  XColor c, c1;
+  XColor c1;
   Cursor cursor;
   Pixmap cursor_pm, cursor_mask_pm, colon;
   XColor cursor_fg, cursor_bg;
@@ -528,10 +531,10 @@ x11_init(int argc, char **argv)
   XtGetValues(toplevel, wargs, i);
 
   i = 0;
-  XtSetArg(wargs[i], XtNminWidth, (XtPointer)(unsigned)width); i++;
-  XtSetArg(wargs[i], XtNmaxWidth, (XtPointer)(unsigned)width); i++;
-  XtSetArg(wargs[i], XtNminHeight, (XtPointer)(unsigned)height); i++;
-  XtSetArg(wargs[i], XtNmaxHeight, (XtPointer)(unsigned)height); i++;
+  XtSetArg(wargs[i], XtNminWidth, (XtArgVal)width); i++;
+  XtSetArg(wargs[i], XtNmaxWidth, (XtArgVal)width); i++;
+  XtSetArg(wargs[i], XtNminHeight, (XtArgVal)height); i++;
+  XtSetArg(wargs[i], XtNmaxHeight, (XtArgVal)height); i++;
   XtSetValues(toplevel, wargs, i);
   
   ttab = XtParseTranslationTable(trans_table);
@@ -559,7 +562,7 @@ x11_init(int argc, char **argv)
 
   for(i = 0; i < 10; i++) {
     digit_pms[i] = XCreateBitmapFromData(dpy, XtWindow(statusarea),
-					 digit_bits[i],
+					 (char *)digit_bits[i],
 					 /* assume all digits are same size */
 					 d0_width, d0_height);
   }
@@ -590,7 +593,7 @@ x11_init(int argc, char **argv)
   v.tile = empty_pm;
   empty_gc = XCreateGC(dpy, canv, GCTile|GCFillStyle, &v);
 
-  gMyStatusArea = (char *)malloc(H_STEPS * V_STEPS);
+  gMyStatusArea = (Ptr)malloc(H_STEPS * V_STEPS);
   if(gMyStatusArea == 0)
     XtAppError(app, "No space for status area");
 
@@ -848,8 +851,8 @@ DoAbout(void)
   XtGetValues(toplevel, wargs, i);
     
   i = 0;
-  XtSetArg(wargs[i], XtNx, (XtPointer)(x + 10));  i++;
-  XtSetArg(wargs[i], XtNy, (XtPointer)(y + 10));  i++;
+  XtSetArg(wargs[i], XtNx, (XtArgVal)(x + 10));  i++;
+  XtSetArg(wargs[i], XtNy, (XtArgVal)(y + 10));  i++;
   XtSetValues(about, wargs, i);
 
   gameover_pending = 1;
@@ -1004,7 +1007,7 @@ DisplayHighScore(void)
     /* format a text - fork and exec the processes so we can drop privileges */
     switch( fork() ) {
        case -1:          /* Error */
-         perror(fork);
+         perror("fork failed");
 	 exit(1);
 	 break;
        case 0:           /* Child */
@@ -1119,8 +1122,8 @@ DisplayHighScore(void)
   XtGetValues(toplevel, wargs, i);
 
   i = 0;
-  XtSetArg(wargs[i], XtNx, (XtPointer)(x + 10));  i++;
-  XtSetArg(wargs[i], XtNy, (XtPointer)(y + 100));  i++;
+  XtSetArg(wargs[i], XtNx, (XtArgVal)(x + 10));  i++;
+  XtSetArg(wargs[i], XtNy, (XtArgVal)(y + 100));  i++;
   XtSetValues(score_shell, wargs, i);
 
   gameover_pending = 1;
@@ -1182,8 +1185,8 @@ ExitXonix(int status)
     XtGetValues(toplevel, wargs, i);
     
     i = 0;
-    XtSetArg(wargs[i], XtNx, (XtPointer)(x + 10));  i++;
-    XtSetArg(wargs[i], XtNy, (XtPointer)(y + 10));  i++;
+    XtSetArg(wargs[i], XtNx, (XtArgVal)(x + 10));  i++;
+    XtSetArg(wargs[i], XtNy, (XtArgVal)(y + 10));  i++;
     XtSetValues(gameover_shell, wargs, i);
 
     if(!gameover_pending++)
-- 
1.6.5