File: warning-fixes.diff

package info (click to toggle)
mgp 1.13a%2Bupstream20090219-14
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 4,196 kB
  • sloc: ansic: 32,387; sh: 4,286; lisp: 1,405; yacc: 945; lex: 264; makefile: 158; perl: 117; awk: 9
file content (417 lines) | stat: -rw-r--r-- 10,111 bytes parent folder | download | duplicates (3)
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# DP: fix tons of compiler warnings
# DP: also, make sure our CFLAGS etc. are actually used

--- a/Imakefile.in
+++ b/Imakefile.in
@@ -70,6 +70,7 @@ SpecialObjectRule(grammar.o,grammar.c, $
 SpecialObjectRule(embed.o,embed.c, $(DEFS) $(OPTFLAGS))
 SpecialObjectRule(mng.o,mng.c, $(DEFS) $(OPTFLAGS))
 SpecialObjectRule(m17n.o,m17n.c, $(DEFS) $(OPTFLAGS))
+SpecialObjectRule(unimap.o,unimap.c, $(DEFS) $(OPTFLAGS))
 
 #define PassCDebugFlags
 #define IHaveSubdirs
@@ -87,11 +88,12 @@ plist.o: $(srcdir)/plist.c ctlwords.h
 print.o: $(srcdir)/print.c ctlwords.h
 
 ctlwords.h: $(srcdir)/ctlwords.c $(srcdir)/globals.c
-	$(CC) -o ./ctlwords $(srcdir)/ctlwords.c
+	$(CC) -c $(CFLAGS) $(DEFS) $(OPTFLAGS) $(srcdir)/ctlwords.c
+	$(CCLINK) -o ctlwords $(LDOPTIONS) ctlwords.o $(EXTRA_LOAD_FLAGS)
 	./ctlwords < $(srcdir)/globals.c > ctlwords.h
 
 clean::
-	rm -f ctlwords
+	rm -f ctlwords ctlwords.o
 
 scanner.c: $(srcdir)/scanner.l
 	$(LEX) -t $(srcdir)/scanner.l > scanner.c
@@ -102,11 +104,6 @@ grammar.c tokdefs.h: $(srcdir)/grammar.y
 	mv y.tab.c grammar.c
 	mv y.tab.h tokdefs.h
 
-# -O2 will work badly...
-unimap.o:
-	$(CC) -c $(CCOPTIONS) $(THREADS_CFLAGS) $(ALLDEFINES) \
-		-I$(srcdir) $(DEFS) $(OPTFLAGS) unimap.c
-
 # missing libraries
 memcmp.o: missing/memcmp.c
 	$(CC) -c $(CFLAGS) -I$(srcdir) $(DEFS) $(OPTFLAGS) \
--- a/contrib/xwintoppm/dsimple.c
+++ b/contrib/xwintoppm/dsimple.c
@@ -55,6 +55,7 @@ void out();
 void blip();
 Window Window_With_Name();
 void Fatal_Error();
+void usage(void) __attribute__((__noreturn__));
 
 /*
  * Just_display: A group of routines designed to make the writting of simple
@@ -398,6 +399,7 @@ Pixmap Bitmap_To_Pixmap(dpy, d, gc, bitm
 }
 
 
+#if 0
 /*
  * blip: a debugging routine.  Prints Blip! on stderr with flushing. 
  */
@@ -405,6 +407,7 @@ void blip()
 {
   outl("blip!");
 }
+#endif
 
 
 /*
@@ -495,6 +498,7 @@ Window Window_With_Name(dpy, top, name)
  *       printf with up to 7 arguments.
  */
 /* VARARGS1 */
+void
 outl(msg, arg0,arg1,arg2,arg3,arg4,arg5,arg6)
      char *msg;
      char *arg0, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6;
--- a/contrib/xwintoppm/list.c
+++ b/contrib/xwintoppm/list.c
@@ -101,7 +101,7 @@ list_ptr new_list ()
 {
     list_ptr lp;
 
-    if (lp = (list_ptr) malloc( sizeof( list_item))) {
+    if ((lp = (list_ptr) malloc(sizeof(list_item)))) {
 	lp->next = NULL;
 	lp->ptr.item = NULL;
     }
--- a/contrib/xwintoppm/multiVis.c
+++ b/contrib/xwintoppm/multiVis.c
@@ -331,7 +331,7 @@ int srcw,srch,dst_x , dst_y ;
     int *indexMap,ncolors ;
     int i,j,old_pixel,new_pixel,red_ind,green_ind,blue_ind ;
     XColor *colors;
-    int rShift,gShift,bShift;
+    int rShift = 0, gShift = 0, bShift = 0;
     int targetBytesPerLine ;
 
     ncolors = QueryColorMap(disp,reg->cmap,reg->vis,&colors,
@@ -982,6 +982,7 @@ static void add_window_to_list( image_wi
     int 	y_vis;
     int 	width;
     int 	height;
+    int		border_width;
     Visual	*vis;
     Colormap	cmap;
     Window	parent;
--- a/contrib/xwintoppm/xwintoppm.c
+++ b/contrib/xwintoppm/xwintoppm.c
@@ -125,6 +125,14 @@ typedef unsigned long Pixel;
 #include <X11/extensions/XKBbells.h>
 #endif
 
+void usage(void) __attribute__((__noreturn__));
+static void Error(char *) __attribute__((__noreturn__));
+static void Window_Dump(Window, FILE *);
+int Image_Size(XImage *);
+int Get_XColors(XWindowAttributes *, XColor **);
+
+void outl(); /* aieee! */
+
 /* Setable Options */
 
 int format = ZPixmap;
@@ -155,11 +163,12 @@ static long parse_long (s)
     return (thesign * retval);
 }
 
+int
 main(argc, argv)
     int argc;
     char **argv;
 {
-    register i;
+    register int i;
     Window target_win;
     FILE *out_file = stdout;
     Bool frame_only = False;
@@ -281,6 +290,7 @@ XColor **colors ;
  *              writting.
  */
 
+void
 Window_Dump(window, out)
      Window window;
      FILE *out;
@@ -609,6 +619,7 @@ Window_Dump(window, out)
 /*
  * Report the syntax for calling xwd.
  */
+void
 usage()
 {
     fprintf (stderr,
@@ -623,6 +634,7 @@ usage()
  * Error - Fatal xwd error.
  */
 
+static void
 Error(string)
 	char *string;	/* Error description string. */
 {
@@ -716,6 +728,7 @@ int Get_XColors(win_info, colors)
     return ncolors ;
 }
 
+void
 _swapshort (bp, n)
     register char *bp;
     register unsigned n;
@@ -731,6 +744,7 @@ _swapshort (bp, n)
     }
 }
 
+void
 _swaplong (bp, n)
     register char *bp;
     register unsigned n;
--- a/ctlwords.c
+++ b/ctlwords.c
@@ -22,9 +22,12 @@ BEGIN {
 
 #endif
 
+#include <ctype.h>
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 
+int
 main(int argc, char *argv[])
 {
 	char buf[1024];
--- a/grammar.y
+++ b/grammar.y
@@ -70,6 +70,8 @@
 static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF };
 #endif
 
+int yylex(void);
+
 int n_errors = 0;
 struct ctrl *root;
 char *yyfilename;
--- a/image/bright.c
+++ b/image/bright.c
@@ -248,6 +248,7 @@ Image *normalize(image, verbose)
 
 void gray(image, verbose)
      Image *image;
+     int verbose;
 { int a;
   unsigned int size;
   Intensity intensity, red, green, blue;
--- a/image/path.c
+++ b/image/path.c
@@ -20,9 +20,7 @@
 #if 1 /* SYSV */
 #include <unistd.h>
 #endif
-#ifdef __APPLE__
 #include <stdlib.h>
-#endif
 
 /* SUPPRESS 530 */
 /* SUPPRESS 560 */
--- a/image/rlelib.c
+++ b/image/rlelib.c
@@ -428,6 +428,7 @@ register struct sv_globals * globals;
  */
 void
 RunSkipBlankLines(nblank, globals)
+int nblank;
 register struct sv_globals * globals;
 {
 }
@@ -439,6 +440,7 @@ register struct sv_globals * globals;
  */
 void
 RunSetColor(c, globals)
+int c;
 register struct sv_globals * globals;
 {
 }
@@ -451,6 +453,7 @@ register struct sv_globals * globals;
 /* ARGSUSED */
 void
 RunSkipPixels(nskip, last, wasrun, globals)
+int nskip, last, wasrun;
 register struct sv_globals * globals;
 {
 }
@@ -462,6 +465,7 @@ register struct sv_globals * globals;
  */
 void
 RunNewScanLine(flag, globals)
+int flag;
 register struct sv_globals * globals;
 {
 }
@@ -473,6 +477,7 @@ register struct sv_globals * globals;
 void
 Runputdata(buf, n, globals)
 rle_pixel * buf;
+int n;
 register struct sv_globals * globals;
 {
 }
@@ -485,6 +490,7 @@ register struct sv_globals * globals;
 /* ARGSUSED */
 void
 Runputrun(color, n, last, globals)
+int color, n, last;
 register struct sv_globals * globals;
 {
 }
@@ -1391,6 +1397,7 @@ int dith_size = 16;
  */
 void
 dithermap(levels, gamma, rgbmap, divN, modN, magic)
+int levels;
 double gamma;
 int rgbmap[][3];
 int divN[256];
@@ -1451,6 +1458,7 @@ int magic[16][16];
  */
 void
 bwdithermap(levels, gamma, bwmap, divN, modN, magic)
+int levels;
 double gamma;
 int bwmap[];
 int divN[256];
@@ -1677,6 +1685,7 @@ int gammamap[256];
  */
 int
 dithergb(x, y, r, g, b, levels, divN, modN, magic)
+int x, y, r, g, b, levels;
 int divN[256];
 int modN[256];
 int magic[16][16];
@@ -1708,6 +1717,7 @@ int magic[16][16];
  */
 int
 ditherbw(x, y, val, divN, modN, magic)
+int x, y, val;
 int divN[256];
 int modN[256];
 int magic[16][16];
--- a/image/rotate.c
+++ b/image/rotate.c
@@ -40,6 +40,7 @@ int *new_pos;				/* Destination bit posi
 Image *rotate(simage, degrees, verbose)
 Image *simage;				/* Image to rotate             */
 int    degrees;				/* Number of degrees to rotate */
+int    verbose;
 { 
   char buf[BUFSIZ];			/* New title                   */
   Image    *image1;			/* Source image                */
--- a/image/smooth.c
+++ b/image/smooth.c
@@ -74,6 +74,7 @@ static Image *doSmooth(image)
 
 Image *smooth(image, iterations, verbose)
      Image *image;
+     int    iterations;
      int    verbose;
 { int a;
   Image *old, *new;
--- a/image/window.c
+++ b/image/window.c
@@ -16,9 +16,7 @@
 #include <signal.h>
 #include <errno.h>
 #include <sys/types.h>
-#ifdef SYSV
 #include <unistd.h>
-#endif
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
@@ -224,7 +222,7 @@ void setViewportColormap(disp, scrn, vis
      int scrn;
      Visual *visual;
 { XSetWindowAttributes swa;
-  static cmap_atom= None;
+  static int cmap_atom= None;
   Window cmap_windows[2];
 
   if (cmap_atom == None)
--- a/image/zoom.c
+++ b/image/zoom.c
@@ -39,6 +39,7 @@ static unsigned int *buildIndex(width, z
 Image *zoom(oimage, xzoom, yzoom, verbose)
      Image        *oimage;
      float        xzoom, yzoom;
+     int	  verbose;
 { char          buf[BUFSIZ];
   Image        *image=NULL;
   unsigned int *xindex, *yindex;
--- a/mgp.c
+++ b/mgp.c
@@ -896,7 +896,7 @@ main_loop(start_page)
 				if (e.xbutton.button == 1) {
 					struct render_state tstate;
 					tstate = state;
-					int zid;
+					int zid = 0;
 #ifdef USE_IMLIB
 					if (zoomin == 1){
 						zoomin = 0;
--- a/mgp.h
+++ b/mgp.h
@@ -853,3 +853,16 @@ extern void M17N_process_direc __P((char
 extern void M17N_draw_string __P((struct render_state *, struct ctrl *cp));
 extern void M17N_draw_object __P((struct render_object *, Drawable, int, int));
 #endif
+
+#ifdef USE_IMLIB
+/* draw.c */
+int search_zimage(int, int, int);
+void zoomin_zimage(int);
+void zoomout_zimage(int);
+/* image/imlib_loader.c */
+Pixmap pixmap_fromimimage(Imlib_Image *, int, int);
+void manage_pixmap(Pixmap, int, int);
+#endif
+
+/* missing on Debian/glibc */
+size_t strlcpy(char *, const char *, size_t);
--- a/print.c
+++ b/print.c
@@ -1297,7 +1297,7 @@ icon_output(tp)
 
 	paintit = (painticon || colorps);
 
-	switch ((int)tp->font) {	/*XXX*/
+	switch ((size_t)tp->font) {	/*XXX*/
 	case 0:
 		/* XXX: image is not supported yet */
 		break;
@@ -1658,7 +1658,7 @@ icon_remember(icon, fontsize, offset, co
 	textpool[ntextpool].xoffset = offset;
 	textpool[ntextpool].xsiz = char_size[0];
 	textpool[ntextpool].size = fontsize;
-	textpool[ntextpool].font = (struct fontmap *)icon;	/*XXX*/
+	textpool[ntextpool].font = (struct fontmap *)(size_t)icon;	/*XXX*/
 	textpool[ntextpool].text = NULL;
 	textpool[ntextpool].fore = color;
 	textpool[ntextpool].back = back;	/*XXX*/
--- a/x11.c
+++ b/x11.c
@@ -355,7 +355,7 @@ init_win3()
 void
 toggle_fullscreen()
 {
-	static fullscreen = 0;
+	static int fullscreen = 0;
 	XClientMessageEvent  xev;
 
 	fullscreen = ++fullscreen % 2;