diff options
author | dholland <dholland@pkgsrc.org> | 2008-07-28 02:45:56 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2008-07-28 02:45:56 +0000 |
commit | 5341b53649851b8bbe342537300963e07250701a (patch) | |
tree | 8a7f129aba3ff418a8b73bcbb025e58cb7ef975b /x11/xphoon/patches | |
parent | 7f57b393dc62a5c8acd9a28bc4f061bc9e3cfd84 (diff) | |
download | pkgsrc-5341b53649851b8bbe342537300963e07250701a.tar.gz |
Drag this kicking and screaming into the Century of the Fruitbat.
- ANSIfy.
- Use standard headers instead of rolling custom wrong decls.
- Don't use void main.
- Fix y2038 bugs.
- Prune dead code.
- Stop using outdated timezone interfaces.
- Don't need libcompat any more.
- Generally clean up build.
Should fix broken build on Linux, probably other non-BSD OSes as well.
PKGREVISION++.
Diffstat (limited to 'x11/xphoon/patches')
-rw-r--r-- | x11/xphoon/patches/patch-aa | 13 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-ab | 64 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-ac | 119 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-ad | 70 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-ae | 24 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-af | 141 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-ag | 33 | ||||
-rw-r--r-- | x11/xphoon/patches/patch-ah | 16 |
8 files changed, 436 insertions, 44 deletions
diff --git a/x11/xphoon/patches/patch-aa b/x11/xphoon/patches/patch-aa deleted file mode 100644 index e4ed2a29209..00000000000 --- a/x11/xphoon/patches/patch-aa +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-aa,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $ - ---- Imakefile.orig Wed Sep 18 21:57:31 1991 -+++ Imakefile -@@ -11,7 +11,7 @@ - - - INCLUDES = -I. -I$(TOP) -I$(TOP)/X11 -I$(TOP)/X11/bitmaps --LOCAL_LIBRARIES = $(XLIB) -+LOCAL_LIBRARIES = $(XLIB) $(EXTRA_LOCAL_LIBS) - DEPLIBS = $(DEPXLIB) - LDLIBS = -lm - diff --git a/x11/xphoon/patches/patch-ab b/x11/xphoon/patches/patch-ab index af93beff5ab..812790bc878 100644 --- a/x11/xphoon/patches/patch-ab +++ b/x11/xphoon/patches/patch-ab @@ -1,23 +1,59 @@ -$NetBSD: patch-ab,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $ +$NetBSD: patch-ab,v 1.2 2008/07/28 02:45:56 dholland Exp $ ---- dtime.c.orig Sat Sep 14 07:15:25 1991 -+++ dtime.c -@@ -26,13 +26,17 @@ - #include <sys/timeb.h> - #endif /*SYS5*/ - -+#include <sys/param.h> -+ -+#if !(defined(BSD) && (BSD >= 199306)) - extern long time(); - struct tm* localtime(); -+#endif +--- dtime.c.orig 1991-09-14 01:15:25.000000000 -0400 ++++ dtime.c 2008-07-27 22:02:34.000000000 -0400 +@@ -19,36 +19,23 @@ static char rcsid[] = + #include <stdio.h> + #include <sys/types.h> + #include <time.h> +-#ifdef SYS5 +-extern int daylight; +-extern long timezone; +-#else /*SYS5*/ +-#include <sys/timeb.h> +-#endif /*SYS5*/ +- +-extern long time(); +-struct tm* localtime(); struct tws* - dtwstime() +-dtwstime() ++dtwstime(void) { - long clock; + time_t clock; (void) time( &clock ); return dlocaltime( &clock ); + } + + struct tws* +-dlocaltime( clock ) +- long* clock; ++dlocaltime( time_t *clock ) + { + register struct tm* tm; +-#ifndef SYS5 +- struct timeb tb; +-#endif not SYS5 + static struct tws tw; + +- if ( clock == (long*) 0 ) ++ if ( clock == NULL ) + return (struct tws*) 0; + tw.tw_flags = TW_NULL; + +@@ -63,13 +50,6 @@ dlocaltime( clock ) + tw.tw_yday = tm->tm_yday; + if ( tm->tm_isdst ) + tw.tw_flags |= TW_DST; +-#ifndef SYS5 +- ftime( &tb ); +- tw.tw_zone = -tb.timezone; +-#else SYS5 +- tzset(); +- tw.tw_zone = -( timezone / 60 ); +-#endif SYS5 + tw.tw_flags &= ~TW_SDAY; + tw.tw_flags |= TW_SEXP; + tw.tw_clock = *clock; diff --git a/x11/xphoon/patches/patch-ac b/x11/xphoon/patches/patch-ac index 3bec9499f7f..e836e793dcd 100644 --- a/x11/xphoon/patches/patch-ac +++ b/x11/xphoon/patches/patch-ac @@ -1,25 +1,52 @@ -$NetBSD: patch-ac,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $ +$NetBSD: patch-ac,v 1.2 2008/07/28 02:45:56 dholland Exp $ ---- xphoon.c.orig Wed Sep 18 21:57:37 1991 -+++ xphoon.c -@@ -31,9 +31,16 @@ +--- xphoon.c.orig 1991-09-18 15:57:37.000000000 -0400 ++++ xphoon.c 2008-07-27 22:02:33.000000000 -0400 +@@ -31,22 +31,22 @@ static char rcsid[] = /* Externals. */ -+#include <sys/param.h> -+ -+#if (defined(BSD) && (BSD >= 199306)) +-extern char* malloc(); +-extern long time(); +-extern long random(); +- +-extern void getbits(); +-extern double jtime(); +-extern double phase(); +#include <stdlib.h> +#include <time.h> -+#else - extern char* malloc(); - extern long time(); - extern long random(); -+#endif ++#include "xphoon.h" + + + /* Forward routines. */ + +-static void xinit(); +-static void make_star_tiles(); +-static void hack_bits(); +-static void set_root(); +-static void cleanup(); ++static void xinit(char *display_name); ++static void make_star_tiles(void); ++static void hack_bits(struct tws *t, ++ int bits_w, int bits_h, ++ char *bits, ++ int cx, int cy, int r, ++ int blackflag, int demoflag); ++static void set_root(int bits_w, int bits_h, char *bits, int cx, int cy, int r); ++static void cleanup(void); + + + /* Routines. */ +@@ -54,7 +54,7 @@ static void cleanup(); + static char* argv0; + static int seed; - extern void getbits(); - extern double jtime(); -@@ -65,7 +72,7 @@ +-void ++int + main( argc, argv ) + int argc; + char** argv; +@@ -65,7 +65,7 @@ main( argc, argv ) int blackflag, demoflag; int printpid; char* display_name; @@ -28,7 +55,7 @@ $NetBSD: patch-ac,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $ int pid, tty; int size; char* mooncopy; -@@ -190,6 +197,7 @@ +@@ -190,6 +190,7 @@ usage: (void) fflush( stdout ); /* Go stealth (ditch our controlling tty). */ @@ -36,7 +63,7 @@ $NetBSD: patch-ac,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $ tty = open( "/dev/tty", 0 ); if ( tty < 0 ) { -@@ -207,6 +215,9 @@ +@@ -207,6 +208,9 @@ usage: } (void) close( tty ); } @@ -46,3 +73,61 @@ $NetBSD: patch-ac,v 1.1.1.1 2001/07/18 14:27:31 nra Exp $ } size = BitmapSize( moon_w, moon_h ); +@@ -246,8 +250,7 @@ static GC copygc; + static GC clipgc; + + static void +-xinit( display_name ) +- char* display_name; ++xinit( char *display_name ) + { + Pixmap temp_pixmap; + +@@ -333,7 +336,7 @@ static Pixmap star_tile[NUM_TILES]; + static int star_tiles_made = 0; + + static void +-make_star_tiles() ++make_star_tiles(void) + { + int i, j, k, r, x, y; + int total_prob; +@@ -410,12 +413,11 @@ char *shades[16] = { + Tennessee */ + + static void +-hack_bits( t, bits_w, bits_h, bits, cx, cy, r, blackflag, demoflag ) +- struct tws* t; +- int bits_w, bits_h; +- char* bits; +- int cx, cy, r; +- int blackflag, demoflag; ++hack_bits(struct tws *t, ++ int bits_w, int bits_h, ++ char *bits, ++ int cx, int cy, int r, ++ int blackflag, int demoflag) + { + double jd, angphase, cphase, aom, cdist, cangdia, csund, csuang; + int i; +@@ -492,10 +494,7 @@ hack_bits( t, bits_w, bits_h, bits, cx, + /* set_root - set the root bitmap */ + + static void +-set_root( bits_w, bits_h, bits, cx, cy, r ) +- int bits_w, bits_h; +- char* bits; +- int cx, cy, r; ++set_root(int bits_w, int bits_h, char *bits, int cx, int cy, int r) + { + Pixmap moon_bitmap; + Pixmap mask_bitmap; +@@ -586,7 +585,7 @@ set_root( bits_w, bits_h, bits, cx, cy, + } + + static void +-cleanup() ++cleanup(void) + { + int i; + diff --git a/x11/xphoon/patches/patch-ad b/x11/xphoon/patches/patch-ad new file mode 100644 index 00000000000..32e7bc1bf1d --- /dev/null +++ b/x11/xphoon/patches/patch-ad @@ -0,0 +1,70 @@ +$NetBSD: patch-ad,v 1.1 2008/07/28 02:45:56 dholland Exp $ + +--- tws.h.orig 1991-09-13 19:32:38.000000000 -0400 ++++ tws.h 2008-07-27 22:31:10.000000000 -0400 +@@ -1,5 +1,6 @@ + /* tws.h - header file for libtws date/time library */ + ++#include <time.h> + + /* Definition of the tws data structure. */ + +@@ -17,7 +18,7 @@ struct tws { + + int tw_zone; + +- long tw_clock; ++ time_t tw_clock; + + int tw_flags; + #define TW_NULL 0x0000 +@@ -33,47 +34,9 @@ struct tws { + + /* Declarations of routines. */ + +-void twscopy( ); +- /* twscopy( &totws, &fromtws ) copies a tws */ +-int twsort( ); +- /* twsort( &tws1, &tws2 ) compares two tws's: 1 means tws1 is +- later; -1 means tws1 is earlier; 0 means they are equal */ +-long twclock( ); +- /* twclock( &tws ) turns a tws into a time(3)-style clock value */ +-long twjuliandate( ); +- /* twjuliandate( &tws ) returns the Julian day number of a tws */ +-long twsubtract( ); +- /* twsubtract( &tws1, &tws2 ) returns seconds of difference */ +- +-/* These routines are functionally similar to the ctime(3) routines +- in the standard Unix library. */ +-char *dctime( ); +- /* dctime( &tws ) returns a string for the date/time passed in */ +-struct tws *dlocaltime( ); ++struct tws *dlocaltime(time_t *clock); + /* dlocaltime( &clock ) turns a time(3) clock value into a tws */ +-struct tws *dgmtime( ); +- /* dgmtime( &clock ) turns a time(3) clock value into a tws */ +-char *dasctime( ); +- /* dasctime( &tws, flags ) turns a tws into a string */ +-char *dtimezone( ); +- /* dtimezone( offset, flags ) returns the name of the time zone */ + +-char *dtimenow( ); +- /* dtimenow( ) returns a string for the current date/time */ +- +-struct tws *dparsetime( ); +- /* dparsetime( &str ) turns a string into a tws */ +- +-struct tws *dtwstime( ); ++struct tws *dtwstime(void); + /* dtwstime( ) returns a tws for the current date/time */ + +-#ifdef ATZ +-#define dtime(cl) dasctime( dlocaltime( cl ), TW_NULL ) +-#else ATZ +-#define dtime(cl) dasctime( dlocaltime( cl ), TW_ZONE ) +-#endif ATZ +- +-#define dtwszone(tw) dtimezone( tw -> tw_zone, tw -> tw_flags ) +- +- +-extern char *tw_dotw[], *tw_ldotw[], *tw_moty[]; diff --git a/x11/xphoon/patches/patch-ae b/x11/xphoon/patches/patch-ae new file mode 100644 index 00000000000..b4eb159b674 --- /dev/null +++ b/x11/xphoon/patches/patch-ae @@ -0,0 +1,24 @@ +$NetBSD: patch-ae,v 1.1 2008/07/28 02:45:56 dholland Exp $ + +--- moon.c.orig 1991-09-15 20:59:28.000000000 -0400 ++++ moon.c 2008-07-27 22:23:28.000000000 -0400 +@@ -14,16 +14,11 @@ static char rcsid[] = + #endif + + #include <X11/Xlib.h> +-#include <moon.xbm> ++#include "xphoon.h" ++#include "moon.xbm" + + void +-getbits( wP, hP, moonP, cxP, cyP, rP ) +- int* wP; +- int* hP; +- char** moonP; +- int* cxP; +- int* cyP; +- int* rP; ++getbits( int *wP, int *hP, char **moonP, int *cxP, int *cyP, int *rP ) + { + *wP = moon_width; + *hP = moon_height; diff --git a/x11/xphoon/patches/patch-af b/x11/xphoon/patches/patch-af new file mode 100644 index 00000000000..17eef124d2d --- /dev/null +++ b/x11/xphoon/patches/patch-af @@ -0,0 +1,141 @@ +$NetBSD: patch-af,v 1.1 2008/07/28 02:45:56 dholland Exp $ + +--- phase.c.orig 1991-09-14 01:15:29.000000000 -0400 ++++ phase.c 2008-07-27 22:21:18.000000000 -0400 +@@ -9,8 +9,10 @@ static char rcsid[] = + #endif + + #include <stdio.h> ++#include <stdlib.h> + #include <math.h> + #include "tws.h" ++#include "xphoon.h" + + /* Astronomical constants. */ + +@@ -65,8 +67,7 @@ static char rcsid[] = + + /* jdate - convert internal GMT date and time to Julian day and fraction */ + +-static long jdate(t) +-struct tws *t; ++static long jdate(struct tws *t) + { + long c, m, y; + +@@ -89,8 +90,7 @@ struct tws *t; + ** a double) + */ + +-double jtime(t) +-struct tws *t; ++double jtime(struct tws *t) + { + int c; + +@@ -106,6 +106,7 @@ struct tws *t; + ** returned via integer pointers to integers + */ + ++#if 0 /* not used */ + static void jyear(td, yy, mm, dd) + double td; + int *yy, *mm, *dd; +@@ -135,6 +136,7 @@ int *yy, *mm, *dd; + *mm = m; + *dd = d; + } ++#endif /* 0 - not used */ + + /* meanphase - calculates mean phase of the Moon for a given base date + ** and desired phase: +@@ -149,6 +151,7 @@ int *yy, *mm, *dd; + ** that this calculation reveals. + */ + ++#if 0 /* not used */ + static double meanphase(sdate, phase, usek) + double sdate, phase; + double *usek; +@@ -173,12 +176,14 @@ double *usek; + + return nt1; + } ++#endif /* 0 - not used */ + + /* truephase - given a K value used to determine the mean phase of the + ** new moon, and a phase selector (0.0, 0.25, 0.5, 0.75), + ** obtain the true, corrected phase time + */ + ++#if 0 /* not used */ + static double truephase(k, phase) + double k, phase; + { +@@ -257,12 +262,13 @@ double k, phase; + } + return pt; + } ++#endif /* 0 - not used */ + + /* phasehunt5 - find time of phases of the moon which surround the current + ** date. Five phases are found, starting and ending with the + ** new moons which bound the current lunation + */ +- ++#if 0 /* not used */ + void phasehunt5(sdate, phases) + double sdate; + double phases[5]; +@@ -285,12 +291,14 @@ double phases[5]; + phases[3] = truephase(k1, 0.75); + phases[4] = truephase(k2, 0.0); + } ++#endif /* 0 - not used */ + + + /* phasehunt2 - find time of phases of the moon which surround the current + ** date. Two phases are found. + */ + ++#if 0 /* not used */ + void phasehunt2(sdate, phases, which) + double sdate; + double phases[2]; +@@ -331,12 +339,12 @@ double which[2]; + } + } + } ++#endif /* 0 - not used */ + + + /* kepler - solve the equation of Kepler */ + +-static double kepler(m, ecc) +-double m, ecc; ++static double kepler(double m, double ecc) + { + double e, delta; + #define EPSILON 1E-6 +@@ -361,14 +369,13 @@ double m, ecc; + ** at the centre of the Earth. + */ + +-double phase(pdate, pphase, mage, dist, angdia, sudist, suangdia) +-double pdate; +-double *pphase; /* illuminated fraction */ +-double *mage; /* age of moon in days */ +-double *dist; /* distance in kilometres */ +-double *angdia; /* angular diameter in degrees */ +-double *sudist; /* distance to Sun */ +-double *suangdia; /* sun's angular diameter */ ++double phase(double pdate, ++ double *pphase, /* illuminated fraction */ ++ double *mage, /* age of moon in days */ ++ double *dist, /* distance in kilometres */ ++ double *angdia, /* angular diameter in degrees */ ++ double *sudist, /* distance to Sun */ ++ double *suangdia) /* sun's angular diameter */ + { + + double Day, N, M, Ec, Lambdasun, ml, MM, Ev, Ae, A3, MmP, diff --git a/x11/xphoon/patches/patch-ag b/x11/xphoon/patches/patch-ag new file mode 100644 index 00000000000..91545c569c0 --- /dev/null +++ b/x11/xphoon/patches/patch-ag @@ -0,0 +1,33 @@ +$NetBSD: patch-ag,v 1.1 2008/07/28 02:45:56 dholland Exp $ + +--- vroot.h.orig 1991-09-18 15:49:11.000000000 -0400 ++++ vroot.h 2008-07-27 22:17:45.000000000 -0400 +@@ -50,7 +50,7 @@ VirtualRootWindowOfScreen(screen) + if (screen != save_screen) { + Display *dpy = DisplayOfScreen(screen); + Atom __SWM_VROOT = None; +- int i; ++ unsigned i; + Window rootReturn, parentReturn, *children; + unsigned int numChildren; + +@@ -64,14 +64,16 @@ VirtualRootWindowOfScreen(screen) + Atom actual_type; + int actual_format; + unsigned long nitems, bytesafter; +- Window *newRoot = (Window *)0; ++ Window *newRoot; ++ unsigned char *newRootTmp = NULL; + + if (XGetWindowProperty(dpy, children[i], + __SWM_VROOT, 0, 1, False, XA_WINDOW, + &actual_type, &actual_format, + &nitems, &bytesafter, +- (unsigned char **) &newRoot) == Success +- && newRoot) { ++ &newRootTmp) == Success ++ && newRootTmp) { ++ newRoot = (Window *) newRootTmp; + root = *newRoot; + break; + } diff --git a/x11/xphoon/patches/patch-ah b/x11/xphoon/patches/patch-ah new file mode 100644 index 00000000000..f550f7540cf --- /dev/null +++ b/x11/xphoon/patches/patch-ah @@ -0,0 +1,16 @@ +$NetBSD: patch-ah,v 1.1 2008/07/28 02:45:56 dholland Exp $ + +--- /dev/null 2008-07-27 22:06:36.000000000 -0400 ++++ xphoon.h 2008-07-27 22:00:25.000000000 -0400 +@@ -0,0 +1,11 @@ ++struct tws; ++ ++void getbits(int *wP, int *hP, char **moonP, int *cxP, int *cyP, int *rP); ++double jtime(struct tws *t); ++double phase(double pdate, ++ double *pphase, ++ double *mage, ++ double *dist, ++ double *angdia, ++ double *sudist, ++ double *suangdia); |