shithub: puzzles

Download patch

ref: a029c2095de3845d3b42f441fe04eaefdc9d52a5
parent: caee305b47bd93eda98ba40d98de7aa180a470c7
author: Jacob Nevins <jacobn@chiark.greenend.org.uk>
date: Tue May 31 08:03:25 EDT 2005

Move definition of PI into puzzles.h. If nothing else, the definition in cube.c
had a typo :)

[originally from svn r5878]

--- a/cube.c
+++ b/cube.c
@@ -11,8 +11,6 @@
 
 #include "puzzles.h"
 
-#define PI 3.14159265358979323846264338327950884197169399
-
 #define MAXVERTICES 20
 #define MAXFACES 20
 #define MAXORDER 4
--- a/net.c
+++ b/net.c
@@ -12,8 +12,6 @@
 #include "puzzles.h"
 #include "tree234.h"
 
-#define PI 3.141592653589793238462643383279502884197169399
-
 #define MATMUL(xr,yr,m,x,y) do { \
     float rx, ry, xx = (x), yy = (y), *mat = (m); \
     rx = mat[0] * xx + mat[2] * yy; \
--- a/netslide.c
+++ b/netslide.c
@@ -13,8 +13,6 @@
 #include "puzzles.h"
 #include "tree234.h"
 
-#define PI 3.141592653589793238462643383279502884197169399
-
 #define MATMUL(xr,yr,m,x,y) do { \
     float rx, ry, xx = (x), yy = (y), *mat = (m); \
     rx = mat[0] * xx + mat[2] * yy; \
--- a/puzzles.h
+++ b/puzzles.h
@@ -12,6 +12,8 @@
 #define FALSE 0
 #endif
 
+#define PI 3.141592653589793238462643383279502884197169399
+
 #define lenof(array) ( sizeof(array) / sizeof(*(array)) )
 
 #define STR_INT(x) #x
--- a/twiddle.c
+++ b/twiddle.c
@@ -20,8 +20,6 @@
 #define COORD(x)  ( (x) * TILE_SIZE + BORDER )
 #define FROMCOORD(x)  ( ((x) - BORDER + TILE_SIZE) / TILE_SIZE - 1 )
 
-#define PI 3.141592653589793238462643383279502884197169399
-
 #define ANIM_PER_RADIUS_UNIT 0.13F
 #define FLASH_FRAME 0.13F