summaryrefslogtreecommitdiff
path: root/games/xconq/files/patch-tcltk__tkmap.c
blob: 0a2f7505e1e64a0d5d552eb1287ee6d97bc25ba6 (plain) (blame)
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
--- tcltk/tkmap.c.orig	2005-03-12 04:12:22.000000000 +0100
+++ tcltk/tkmap.c	2013-05-14 12:50:05.000000000 +0200
@@ -436,7 +436,7 @@
 	    fraction = 0;
 	    fraction2 = 1;
 	    printf("map xview %g %g\n", fraction, fraction2);
-	    sprintf(interp->result, "%g %g", fraction, fraction2);
+        Tcl_SetResult(interp, "0 1", TCL_STATIC);
 	} else {
 	    type = Tk_GetScrollInfo(interp, argc, argv, &fraction, &count);
 	    switch (type) {
@@ -466,7 +466,7 @@
 	    fraction = 0;
 	    fraction2 = 1;
 	    printf("map yview %g %g\n", fraction, fraction2);
-	    sprintf(interp->result, "%g %g", fraction, fraction2);
+        Tcl_SetResult(interp, "0 1", TCL_STATIC);
 	} else {
 	    type = Tk_GetScrollInfo(interp, argc, argv, &fraction, &count);
 	    switch (type) {
@@ -976,8 +976,11 @@
     DGprintf("Pixel %d,%d -> unit %s\n", sx, sy, unit_desig(*unitp));
 #endif
     nearest_unit_view(dside, mapw->vp, sx, sy, &uview);
-    if (uview)
+    if (uview) {
       *unitp = view_unit(uview);
+    } else {
+      *unitp = NULL;
+    }
     return TRUE;
 }
 
@@ -3046,7 +3049,7 @@
 	    wid2 = wid / 2;
 	    XSetLineAttributes(dpy, gc, wid, LineSolid, CapButt, JoinMiter); 
 	    color = dside->ui->cell_color[b];
-	    if ((int)color < 0)
+	    if ((long)color < 0)
 	      color = dside->ui->blackcolor;
 	    XSetForeground(dpy, gc, color->pixel);
 	    XSetBackground(dpy, gc, dside->ui->whitecolor->pixel);
@@ -3134,7 +3137,7 @@
 	wid2 = wid / 2;
 	XSetLineAttributes(dpy, gc, wid, LineSolid, CapButt, JoinMiter); 
 	color = dside->ui->cell_color[c];
-	if ((int)color < 0)
+	if ((long)color < 0)
 	  color = dside->ui->blackcolor;
 	XSetForeground(dpy, gc, color->pixel);
 	XSetBackground(dpy, gc, dside->ui->whitecolor->pixel);
@@ -3241,7 +3244,7 @@
 	    wid2 = wid / 2;
 	    XSetLineAttributes(dpy, gc, wid, LineSolid, CapButt, JoinMiter); 
 	    color = dside->ui->cell_color[c];
-	    if ((int)color < 0)
+	    if ((long)color < 0)
 	      color = dside->ui->blackcolor;
 	    XSetForeground(dpy, gc, color->pixel);
 	    XSetBackground(dpy, gc, dside->ui->whitecolor->pixel);