X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fhypercube.c;h=3fef0e6a8ba0a15fb89a62840ff5db8f3e238ef4;hb=c6b273ef7292ba10943694df1656b05203d7b62f;hp=37ac07455746c27c3387bc670dc6036bcd60230b;hpb=258170f6204e23da06f272ffda1f4504b6ae2eaf;p=xscreensaver diff --git a/hacks/hypercube.c b/hacks/hypercube.c index 37ac0745..3fef0e6a 100644 --- a/hacks/hypercube.c +++ b/hacks/hypercube.c @@ -1,4 +1,5 @@ -/* xscreensaver, Copyright (c) 1992 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992, 1995, 1996 + * Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -12,8 +13,8 @@ * and Jamie Zawinski. */ -#include "screenhack.h" #include +#include "screenhack.h" static Display *dpy; static Window window; @@ -33,9 +34,7 @@ struct point_state { }; static void -move_line (state0, state1, gc) - struct point_state *state0, *state1; - GC gc; +move_line (struct point_state *state0, struct point_state *state1, GC gc) { if (state0->same_p && state1->same_p) return; @@ -58,8 +57,7 @@ move_line (state0, state1, gc) } static void -hyper (xy, xz, yz, xw, yw, zw) - double xy, xz, yz, xw, yw, zw; +hyper (double xy, double xz, double yz, double xw, double yw, double zw) { double cos_xy = cos (xy), sin_xy = sin (xy); double cos_xz = cos (xz), sin_xz = sin (xz); @@ -76,7 +74,7 @@ hyper (xy, xz, yz, xw, yw, zw) double _tmp0_, _tmp1_; struct point_state points [16]; - bzero (points, sizeof (points)); + memset (points, 0, sizeof (points)); #define mmmm (&points[0]) #define mmmp (&points[1]) @@ -174,7 +172,7 @@ hyper (xy, xz, yz, xw, yw, zw) mixing an ANSI compiler with a non-ANSI preprocessor, or vice versa. Regardless, your system is broken; it's not a bug in this program. */ -#if __STDC__ || SVR4 +#if defined(__STDC__) || defined(__ANSI_CPP__) # define rotate(name,dim0,dim1,cos,sin) \ _tmp0_ = ((name##dim0 * cos) + (name##dim1 * sin)); \ _tmp1_ = ((name##dim1 * cos) - (name##dim0 * sin)); \ @@ -229,7 +227,7 @@ char *defaults [] = { "*color3: white", "*color4: green", "*color5: cyan", - "*color6: blue", + "*color6: dodgerblue", "*color7: magenta", "*xw: 0.000", @@ -240,7 +238,7 @@ char *defaults [] = { "*zw: 0.000", "*observer-z: 5", - "*delay: 100000", + "*delay: 30000", 0 }; @@ -262,22 +260,18 @@ XrmOptionDescRec options [] = { { "-zw", ".zw", XrmoptionSepArg, 0 }, { "-observer-z", ".observer-z", XrmoptionSepArg, 0 }, - { "-delay", ".delay", XrmoptionSepArg, 0 } + { "-delay", ".delay", XrmoptionSepArg, 0 }, + { 0, 0, 0, 0 } }; -int options_size = (sizeof (options) / sizeof (options[0])); - - void -screenhack (d, w) - Display *d; - Window w; +screenhack (Display *d, Window w) { XGCValues gcv; XWindowAttributes xgwa; Colormap cmap; double xy, xz, yz, xw, yw, zw; - unsigned long bg, pixel; + unsigned long bg; dpy = d; window = w;