From 7f82faf4aab6f86931e40f01e9602dc427d65d8a Mon Sep 17 00:00:00 2001 From: joerg Date: Mon, 5 Dec 2011 22:48:58 +0000 Subject: [PATCH] Fix build with newer GCC --- graphics/xart/distinfo | 12 ++++-- graphics/xart/patches/patch-ad | 16 ++++++-- graphics/xart/patches/patch-ak | 15 +++++-- graphics/xart/patches/patch-image.h | 30 ++++++++++++++ graphics/xart/patches/patch-main.c | 30 ++++++++++++++ graphics/xart/patches/patch-protocol.c | 12 ++++++ graphics/xart/patches/patch-rw_readGIF.c | 31 +++++++++++++++ graphics/xart/patches/patch-rw_readWriteXBM.c | 22 +++++++++++ graphics/xart/patches/patch-rw_readWriteXWD.c | 39 +++++++++++++++++++ 9 files changed, 197 insertions(+), 10 deletions(-) create mode 100644 graphics/xart/patches/patch-image.h create mode 100644 graphics/xart/patches/patch-main.c create mode 100644 graphics/xart/patches/patch-protocol.c create mode 100644 graphics/xart/patches/patch-rw_readGIF.c create mode 100644 graphics/xart/patches/patch-rw_readWriteXBM.c create mode 100644 graphics/xart/patches/patch-rw_readWriteXWD.c diff --git a/graphics/xart/distinfo b/graphics/xart/distinfo index 6a6dcd11506e..a20936b5e44e 100644 --- a/graphics/xart/distinfo +++ b/graphics/xart/distinfo @@ -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 diff --git a/graphics/xart/patches/patch-ad b/graphics/xart/patches/patch-ad index 7e992aa94add..c87c493337f9 100644 --- a/graphics/xart/patches/patch-ad +++ b/graphics/xart/patches/patch-ad @@ -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 . ---- 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 . #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); diff --git a/graphics/xart/patches/patch-ak b/graphics/xart/patches/patch-ak index 6f5fa5b2ba6e..e13d7cc9de6a 100644 --- a/graphics/xart/patches/patch-ak +++ b/graphics/xart/patches/patch-ak @@ -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 + #endif + ++#include ++ + #ifndef MIN + #define MIN(a,b) (((a) < (b)) ? (a) : (b)) + #endif +@@ -45,8 +47,6 @@ #define NULL 0 #endif /* AIXV3 */ diff --git a/graphics/xart/patches/patch-image.h b/graphics/xart/patches/patch-image.h new file mode 100644 index 000000000000..bb407c778754 --- /dev/null +++ b/graphics/xart/patches/patch-image.h @@ -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 ++ + /* +-------------------------------------------------------------------+ */ + /* | 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]) \ diff --git a/graphics/xart/patches/patch-main.c b/graphics/xart/patches/patch-main.c new file mode 100644 index 000000000000..b7a6ba98607d --- /dev/null +++ b/graphics/xart/patches/patch-main.c @@ -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 + #include + #include ++#include + #include + #include + #include +@@ -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; diff --git a/graphics/xart/patches/patch-protocol.c b/graphics/xart/patches/patch-protocol.c new file mode 100644 index 000000000000..c129b802b659 --- /dev/null +++ b/graphics/xart/patches/patch-protocol.c @@ -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 + #include + #include ++#include + + #include "xpaint.h" + #include "misc.h" diff --git a/graphics/xart/patches/patch-rw_readGIF.c b/graphics/xart/patches/patch-rw_readGIF.c new file mode 100644 index 000000000000..768f1dc24883 --- /dev/null +++ b/graphics/xart/patches/patch-rw_readGIF.c @@ -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); + } + } diff --git a/graphics/xart/patches/patch-rw_readWriteXBM.c b/graphics/xart/patches/patch-rw_readWriteXBM.c new file mode 100644 index 000000000000..9140a5d0c1fc --- /dev/null +++ b/graphics/xart/patches/patch-rw_readWriteXBM.c @@ -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 ++#include + #include "image.h" + +-int strncmp(char *, char *, int); +- + #define TRUE 1 + #define FALSE 0 +@@ -57,7 +56,4 @@ int strncmp(char *, char *, int); + #include + +-extern char *strrchr(char *, char); +- +- + #define MAX_SIZE 255 + #define True 1 diff --git a/graphics/xart/patches/patch-rw_readWriteXWD.c b/graphics/xart/patches/patch-rw_readWriteXWD.c new file mode 100644 index 000000000000..6f0d74bef9a4 --- /dev/null +++ b/graphics/xart/patches/patch-rw_readWriteXWD.c @@ -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 ++#include + + #include + +@@ -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++) {