Fix build with newer GCC

This commit is contained in:
joerg 2011-12-05 22:48:58 +00:00
parent 9e5ce8f73a
commit 7f82faf4aa
9 changed files with 197 additions and 10 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.14 2011/02/07 21:28:56 wiz Exp $
$NetBSD: distinfo,v 1.15 2011/12/05 22:48:58 joerg Exp $
SHA1 (xart19980415.tgz) = d4445392e33a5dcf5ae951babac82394e7cdd65c
RMD160 (xart19980415.tgz) = 99077c23a798d8c0026bd53450052b1a8cf6ff6f
@ -6,11 +6,17 @@ Size (xart19980415.tgz) = 343909 bytes
SHA1 (patch-aa) = 7d8ae61d9a624cc537396f406b496f28376cf7b5
SHA1 (patch-ab) = b0f00e29560ce786e37a8ba62fef82dae80c4ee9
SHA1 (patch-ac) = 618003b6d192e85a1aa5f64b0f8eccfec991012e
SHA1 (patch-ad) = 08059ca068d156be0e31283180c5deaebb99f7bd
SHA1 (patch-ad) = 9bea96736f23880863f1aa2ccb5499d64f5e781c
SHA1 (patch-ae) = d0d87fe957cbec5979e635270d2ad05b294f7530
SHA1 (patch-af) = 7253489721eead898cd3a67878584d86b7719e3f
SHA1 (patch-ag) = 58bf357debce54707378b6598ca813af6a632e3b
SHA1 (patch-ah) = f888c5167cd8a6111e2064d586ff50984320b210
SHA1 (patch-ai) = 349170a16199734f35dc56de12e77dd289db412b
SHA1 (patch-aj) = 7139b114301de5becf1449bd2b346223b205a908
SHA1 (patch-ak) = a7778776ec8251a51477f3548f28ed30a1ef9770
SHA1 (patch-ak) = fb0de4cead898e3d41bdd7380020e8058031556f
SHA1 (patch-image.h) = ccc9233baac771801028ddfcc9b4863456f0bfda
SHA1 (patch-main.c) = 145840a9baf90164cda10656eac8f8f6f31a400d
SHA1 (patch-protocol.c) = 4ddc5530adfe85b7b282545b7c067c3f8cc38d0b
SHA1 (patch-rw_readGIF.c) = 444483ad98c0edb9c1bde596e73baa904781a81c
SHA1 (patch-rw_readWriteXBM.c) = 8e3fc7546d98ffd37eafc747a7d724a56bccb765
SHA1 (patch-rw_readWriteXWD.c) = 78065d0137e339f45bea6333a73d2e1945b9ef27

View file

@ -1,10 +1,10 @@
$NetBSD: patch-ad,v 1.2 1998/08/07 10:40:54 agc Exp $
$NetBSD: patch-ad,v 1.3 2011/12/05 22:48:59 joerg Exp $
Fix PR 5746 by Benjamin Lorenz <lorenz@ps.uni-sb.de>.
--- misc.h.BAK Sun Jul 12 17:00:39 1998
+++ misc.h Sun Jul 12 17:00:53 1998
@@ -24,7 +24,7 @@
--- misc.h.orig 1998-03-07 21:36:05.000000000 +0000
+++ misc.h
@@ -24,7 +24,7 @@ long random(void);
#ifndef linux
#if defined(BSD4_4) || defined(HPArchitecture) || defined(SGIArchitecture) || defined(_AIX)
@ -13,3 +13,11 @@ Fix PR 5746 by Benjamin Lorenz <lorenz@ps.uni-sb.de>.
#else
int srandom(unsigned int);
#endif /* BSD4_4 */
@@ -97,7 +97,6 @@ void HelpInit(Widget top);
void GetDefaultWH(int *w, int *h);
char *GetDefaultRC(void);
void SetIconImage(Widget w);
-void main(int argc, char *argv[]);
/* misc.c */
Widget GetToplevel(Widget w);

View file

@ -1,8 +1,17 @@
$NetBSD: patch-ak,v 1.1 2006/08/09 17:13:58 darcy Exp $
$NetBSD: patch-ak,v 1.2 2011/12/05 22:48:59 joerg Exp $
--- xpaint.h.orig 1998-04-13 00:27:17.000000000 -0400
--- xpaint.h.orig 1998-04-13 04:27:17.000000000 +0000
+++ xpaint.h
@@ -45,8 +45,6 @@
@@ -19,6 +19,8 @@
#include <sys/param.h>
#endif
+#include <stdio.h>
+
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
@@ -45,8 +47,6 @@
#define NULL 0
#endif /* AIXV3 */

View file

@ -0,0 +1,30 @@
$NetBSD: patch-image.h,v 1.1 2011/12/05 22:48:59 joerg Exp $
--- image.h.orig 1998-03-10 07:33:31.000000000 +0000
+++ image.h
@@ -1,6 +1,8 @@
#ifndef __IMAGE_H__
#define __IMAGE_H__
+#include <X11/Xlib.h>
+
/* +-------------------------------------------------------------------+ */
/* | Copyright (C) 1993, David Koblas (koblas@netcom.com) | */
/* | Copyright 1995, 1996 Torsten Martinsen (bullestock@dk-online.dk) | */
@@ -64,7 +66,6 @@ typedef struct {
unsigned long sourceMask;
} Image;
-#ifdef _XLIB_H_
/* Used to transfer information to routines in iprocess.c */
struct imageprocessinfo {
int oilArea;
@@ -86,8 +87,6 @@ struct imageprocessinfo {
XColor *background;
};
-#endif
-
#define ImagePixel(image, x, y) \
(((image)->cmapSize == 0) \
? &((image)->data[((y) * (image)->width + (x)) * 3]) \

View file

@ -0,0 +1,30 @@
$NetBSD: patch-main.c,v 1.1 2011/12/05 22:48:59 joerg Exp $
--- main.c.orig 1998-04-16 01:17:10.000000000 +0000
+++ main.c
@@ -18,6 +18,7 @@
#include <X11/Intrinsic.h>
#include <X11/Shell.h>
#include <X11/StringDefs.h>
+#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
@@ -47,7 +48,7 @@ static char *appDefaults[] =
NULL
};
-gcFunction = 3;
+int gcFunction = 3;
typedef struct {
String visualType;
@@ -272,7 +273,7 @@ GetFutureVisual(Widget *toplevel, int de
}
-void
+int
main(int argc, char *argv[])
{
Display *dpy;

View file

@ -0,0 +1,12 @@
$NetBSD: patch-protocol.c,v 1.1 2011/12/05 22:48:59 joerg Exp $
--- protocol.c.orig 2011-12-05 20:27:50.000000000 +0000
+++ protocol.c
@@ -21,6 +21,7 @@
#include <X11/cursorfont.h>
#include <sys/time.h>
#include <stdio.h>
+#include <stdlib.h>
#include "xpaint.h"
#include "misc.h"

View file

@ -0,0 +1,31 @@
$NetBSD: patch-rw_readGIF.c,v 1.1 2011/12/05 22:48:59 joerg Exp $
--- rw/readGIF.c.orig 2011-12-05 20:25:31.000000000 +0000
+++ rw/readGIF.c
@@ -43,7 +43,7 @@ struct {
unsigned int ColorResolution;
unsigned int Background;
unsigned int AspectRatio;
- int GrayScale;
+ int GrayScale2;
} GifScreen;
static struct {
@@ -137,7 +137,7 @@ ReadGIF(char *file)
if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */
if (ReadColorMap(fd, GifScreen.BitPixel, GifScreen.ColorMap,
- &GifScreen.GrayScale)) {
+ &GifScreen.GrayScale2)) {
RWSetMsg("error reading global colormap");
fclose(fd);
return image;
@@ -193,7 +193,7 @@ ReadGIF(char *file)
image = ReadImage(fd, LM_to_uint(buf[4], buf[5]),
LM_to_uint(buf[6], buf[7]),
GifScreen.BitPixel, GifScreen.ColorMap,
- GifScreen.GrayScale, BitSet(buf[8], INTERLACE),
+ GifScreen.GrayScale2, BitSet(buf[8], INTERLACE),
imageCount != imageNumber);
}
}

View file

@ -0,0 +1,22 @@
$NetBSD: patch-rw_readWriteXBM.c,v 1.1 2011/12/05 22:48:59 joerg Exp $
--- rw/readWriteXBM.c.orig 2011-12-05 20:26:00.000000000 +0000
+++ rw/readWriteXBM.c
@@ -16,8 +16,7 @@
#include <stdio.h>
+#include <string.h>
#include "image.h"
-int strncmp(char *, char *, int);
-
#define TRUE 1
#define FALSE 0
@@ -57,7 +56,4 @@ int strncmp(char *, char *, int);
#include <ctype.h>
-extern char *strrchr(char *, char);
-
-
#define MAX_SIZE 255
#define True 1

View file

@ -0,0 +1,39 @@
$NetBSD: patch-rw_readWriteXWD.c,v 1.1 2011/12/05 22:48:59 joerg Exp $
--- rw/readWriteXWD.c.orig 2011-12-05 20:25:22.000000000 +0000
+++ rw/readWriteXWD.c
@@ -27,6 +27,7 @@
#include "image.h"
#include <stdio.h>
+#include <string.h>
#include <X11/XWDFile.h>
@@ -59,7 +60,7 @@ void *calloc(int, int);
#define ZPixmap 2
#define StaticGray 0
-#define GrayScale 1
+#define GrayScale2 1
#define StaticColor 2
#define PseudoColor 3
#define TrueColor 4
@@ -559,7 +560,7 @@ Image *
scale = 256 / (1 << hdr.bits_per_pixel) - 1;
}
break;
- default: /* StaticColor, PseudoColor, GrayScale */
+ default: /* StaticColor, PseudoColor, GrayScale2 */
if (image != NULL)
break;
image = ImageNew(hdr.pixmap_width, hdr.pixmap_height);
@@ -586,7 +587,7 @@ Image *
for (y = 0; y < image->height; y++) {
switch (hdr.visual_class) {
case StaticGray:
- case GrayScale:
+ case GrayScale2:
case StaticColor:
case PseudoColor:
for (x = 0; x < image->width; x++) {