ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.22.tar.gz
[xscreensaver] / hacks / speedmine.c
index d7051c1ea12e558e77f2c56c85639f0cb34a1d6f..aac2d18bcc98f46b3e676ce087e92613285a5f9c 100644 (file)
@@ -116,6 +116,11 @@ static double step=0.0;
 #define BACKWARDS -1
 static int direction = FORWARDS;
 
+/* Apparently AIX's math.h bogusly defines `nearest' as a function,
+   in violation of the ANSI C spec. */
+#undef nearest
+#define nearest n3arest
+
 static int pindex=0, nearest=0;
 static int flipped_at=0;
 static int xoffset=0, yoffset=0;
@@ -282,7 +287,7 @@ perspective (void)
             }
                        r = rotation_bias + (int)(vertigo*zcc); MODULO(r, ROTS);
 
-                       xvals[t][j] = xoffset + width/2 +
+                       xvals[t][j] = xoffset + (width>>1) +
                                          (int)(xx * costab[r] - yy * sintab[r]);
                        maxx[t] = MAX(maxx[t], xvals[t][j]);
                        minx[t] = MIN(minx[t], xvals[t][j]);