5341b53649
- 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++.
133 lines
2.9 KiB
Text
133 lines
2.9 KiB
Text
$NetBSD: patch-ac,v 1.2 2008/07/28 02:45:56 dholland Exp $
|
|
|
|
--- 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. */
|
|
|
|
-extern char* malloc();
|
|
-extern long time();
|
|
-extern long random();
|
|
-
|
|
-extern void getbits();
|
|
-extern double jtime();
|
|
-extern double phase();
|
|
+#include <stdlib.h>
|
|
+#include <time.h>
|
|
+#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;
|
|
|
|
-void
|
|
+int
|
|
main( argc, argv )
|
|
int argc;
|
|
char** argv;
|
|
@@ -65,7 +65,7 @@ main( argc, argv )
|
|
int blackflag, demoflag;
|
|
int printpid;
|
|
char* display_name;
|
|
- long clock;
|
|
+ time_t clock;
|
|
int pid, tty;
|
|
int size;
|
|
char* mooncopy;
|
|
@@ -190,6 +190,7 @@ usage:
|
|
(void) fflush( stdout );
|
|
|
|
/* Go stealth (ditch our controlling tty). */
|
|
+#ifdef TIOCNOTTY
|
|
tty = open( "/dev/tty", 0 );
|
|
if ( tty < 0 )
|
|
{
|
|
@@ -207,6 +208,9 @@ usage:
|
|
}
|
|
(void) close( tty );
|
|
}
|
|
+#else
|
|
+ setsid();
|
|
+#endif
|
|
}
|
|
|
|
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;
|
|
|