File: 1010-gcc-14.patch

package info (click to toggle)
xvier 1.0-14
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 300 kB
  • sloc: ansic: 4,836; makefile: 13
file content (129 lines) | stat: -rw-r--r-- 3,352 bytes parent folder | download | duplicates (2)
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
Description: Got rid of compiler errors and warnings from GCC 14.
 Calling undecleared methods is no longer allowed.  Also fixed a few
 minor warnings and a possibly uninitialized variable.
Author: Petter Reinholdtsen <pere@debian.org>
Bug-Debian: https://bugs.debian.org/1075691
Forwarded: no
Last-Update: 2024-10-08
---
--- xvier-1.0.orig/vier.c
+++ xvier-1.0/vier.c
@@ -1,4 +1,7 @@
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/time.h>
 
@@ -24,6 +27,9 @@ int zugstackp = 0, level = 2;
 #define S_WINS   8
 #define USELESS 16
 
+int comp_schwarz(int pos, int lev, int limit);
+int s_zugzwang(int remain);
+
 char read_char(ch)
 char *ch;
 {
@@ -564,13 +570,14 @@ char **argv;
 	for (i = 0; i < columns; i++) {
 	  register int zw;
 	  
-	  if ((j = frei[reihenfolge[i]]) < row_col)
+	  if ((j = frei[reihenfolge[i]]) < row_col) {
 	    if ((zw = comp_schwarz (j, 0, wert + 1)) < wert) {
 	      wert = zw;
 	      same_n = 1;
 	      same[0] = reihenfolge[i];
 	    } else if (zw == wert)
 	      same[same_n++] = reihenfolge[i];
+	  }
 	}
       }
       if (same_n == 0) {
--- xvier-1.0.orig/vier.h
+++ xvier-1.0/vier.h
@@ -1,5 +1,3 @@
-char *malloc();
-
 extern int rows, columns, vnum;
 extern int row_col, row_1_col, row_2_col;
 extern int *brett, *weiss, *schwarz, **freip, **doublesp;
@@ -9,3 +7,5 @@ extern int *_p_h_, **pp;
 extern struct oldv {
   int *pos, value;
 } *stack, *sp, **zugstack;
+
+void vierinit(void);
--- xvier-1.0.orig/vierinit.c
+++ xvier-1.0/vierinit.c
@@ -1,4 +1,5 @@
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "xvier.h"
 #include "vier.h"
--- xvier-1.0.orig/xvier.c
+++ xvier-1.0/xvier.c
@@ -2,14 +2,16 @@
 #include <X11/Xutil.h>
 #include <X11/cursorfont.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <signal.h>
+#include <string.h>
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/time.h>
 
+#include "vier.h"
 #include "xvier.h"
 
-char *malloc();
-
 char *displayname = NULL, *geostring = NULL, *fontpattern = NULL;
 int iconic = 0, level = 0;
 int rows = 6, columns = 7;
@@ -195,7 +197,7 @@ int ind;
 void recalculate(width, height)
 int width, height;
 {
-  int i, j, fontid, d1, d2, d3, maxtextwidth, maxtextheight;
+  int i, j, fontid = 0, d1, d2, d3, maxtextwidth, maxtextheight;
   XCharStruct tmpsize;
 
   if (width == topwidth && height == topheight)
@@ -570,7 +572,7 @@ char **argv;
       color.blue  = rgb_values[i].blue;
       color.flags = DoRed | DoGreen | DoBlue;
     retry:
-      if (XAllocColor(mydisplay, cmap, &color) == 0)
+      if (XAllocColor(mydisplay, cmap, &color) == 0) {
 	if (!private_cmap) {
 	  private_cmap = 1;
 	  cmap = XCopyColormapAndFree(mydisplay, cmap);
@@ -579,6 +581,7 @@ char **argv;
 	  fprintf(stderr, "%s: Couldn't allocate color %d\n", *argv, i);
 	  exit(2);
 	}
+      }
       PixelArray[i] = color.pixel;
     }
     if (private_cmap) {
@@ -991,13 +994,14 @@ char **argv;
 	    if ((myevent.xbutton.x % (piece_width + piece_dx)) > piece_dx) {
 	      int col = myevent.xbutton.x / (piece_width + piece_dx);
 
-	      if (col < columns)
+	      if (col < columns) {
 		if (columnfill[col] < rows) {
 		  write_prog('a' + col);
 		  domove(1 - c_index, col);
 		  message(1 - message_index);
 		} else
 		  XBell(mydisplay, 0);
+	      }
 	    }
 	  }
 	}