diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-04-04 21:43:25 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-04-04 21:43:25 +0100 |
| commit | 2e48ce132e011e83517a9fc4905edcc8f9a5ef58 (patch) | |
| tree | 36edea02171e24dcf91a49f59f3d9046307f999e | |
| parent | 4fcc1ea6012dbb25aeb94397d81f364fab81a58d (diff) | |
| download | puzzles-2e48ce132e011e83517a9fc4905edcc8f9a5ef58.zip puzzles-2e48ce132e011e83517a9fc4905edcc8f9a5ef58.tar.gz puzzles-2e48ce132e011e83517a9fc4905edcc8f9a5ef58.tar.bz2 puzzles-2e48ce132e011e83517a9fc4905edcc8f9a5ef58.tar.xz | |
Replace <math.h> with <tgmath.h> throughout
C89 provided only double-precision mathematical functions (sin() etc),
and so despite using single-precision elsewhere, those are what Puzzles
has traditionally used. C99 introduced single-precision equivalents
(sinf() etc), and I hope it's been long enough that we can safely use
them. Maybe they'll even be faster.
Rather than directly use the single-precision functions, though, we use
the magic macros from <tgmath.h> that automatically choose the precision
of mathematical functions based on their arguments. This has the
advantage that we only need to change which header we include, and thus
that we can switch back again if some platform has trouble with the new
header.
| -rw-r--r-- | auxiliary/hat-test.c | 2 | ||||
| -rw-r--r-- | auxiliary/hatgen.c | 2 | ||||
| -rw-r--r-- | blackbox.c | 2 | ||||
| -rw-r--r-- | bridges.c | 2 | ||||
| -rw-r--r-- | cmake/testbuild.c | 2 | ||||
| -rw-r--r-- | cube.c | 2 | ||||
| -rw-r--r-- | dominosa.c | 2 | ||||
| -rw-r--r-- | drawing.c | 2 | ||||
| -rw-r--r-- | fifteen.c | 2 | ||||
| -rw-r--r-- | filling.c | 2 | ||||
| -rw-r--r-- | flip.c | 2 | ||||
| -rw-r--r-- | flood.c | 2 | ||||
| -rw-r--r-- | galaxies.c | 2 | ||||
| -rw-r--r-- | grid.c | 2 | ||||
| -rw-r--r-- | gtk.c | 2 | ||||
| -rw-r--r-- | guess.c | 2 | ||||
| -rw-r--r-- | hat.c | 2 | ||||
| -rw-r--r-- | inertia.c | 2 | ||||
| -rw-r--r-- | keen.c | 2 | ||||
| -rw-r--r-- | lightup.c | 2 | ||||
| -rw-r--r-- | loopgen.c | 2 | ||||
| -rw-r--r-- | loopy.c | 2 | ||||
| -rw-r--r-- | magnets.c | 2 | ||||
| -rw-r--r-- | map.c | 2 | ||||
| -rw-r--r-- | mines.c | 2 | ||||
| -rw-r--r-- | misc.c | 2 | ||||
| -rw-r--r-- | mosaic.c | 2 | ||||
| -rw-r--r-- | net.c | 2 | ||||
| -rw-r--r-- | netslide.c | 2 | ||||
| -rw-r--r-- | nullgame.c | 2 | ||||
| -rw-r--r-- | pattern.c | 2 | ||||
| -rw-r--r-- | pearl.c | 2 | ||||
| -rw-r--r-- | pegs.c | 2 | ||||
| -rw-r--r-- | penrose.c | 2 | ||||
| -rw-r--r-- | range.c | 2 | ||||
| -rw-r--r-- | rect.c | 2 | ||||
| -rw-r--r-- | samegame.c | 2 | ||||
| -rw-r--r-- | signpost.c | 2 | ||||
| -rw-r--r-- | singles.c | 2 | ||||
| -rw-r--r-- | sixteen.c | 2 | ||||
| -rw-r--r-- | slant.c | 2 | ||||
| -rw-r--r-- | solo.c | 2 | ||||
| -rw-r--r-- | tents.c | 2 | ||||
| -rw-r--r-- | towers.c | 2 | ||||
| -rw-r--r-- | tracks.c | 2 | ||||
| -rw-r--r-- | twiddle.c | 2 | ||||
| -rw-r--r-- | undead.c | 2 | ||||
| -rw-r--r-- | unequal.c | 2 | ||||
| -rw-r--r-- | unfinished/group.c | 2 | ||||
| -rw-r--r-- | unfinished/numgame.c | 2 | ||||
| -rw-r--r-- | unfinished/separate.c | 2 | ||||
| -rw-r--r-- | unfinished/slide.c | 2 | ||||
| -rw-r--r-- | unfinished/sokoban.c | 2 | ||||
| -rw-r--r-- | unruly.c | 2 | ||||
| -rw-r--r-- | untangle.c | 2 |
55 files changed, 55 insertions, 55 deletions
diff --git a/auxiliary/hat-test.c b/auxiliary/hat-test.c index e41a53a..4f8dc65 100644 --- a/auxiliary/hat-test.c +++ b/auxiliary/hat-test.c @@ -5,7 +5,7 @@ */ #include <assert.h> -#include <math.h> +#include <tgmath.h> #include <stdarg.h> #include <stdio.h> #include <string.h> diff --git a/auxiliary/hatgen.c b/auxiliary/hatgen.c index d9c6d73..9574cb8 100644 --- a/auxiliary/hatgen.c +++ b/auxiliary/hatgen.c @@ -16,7 +16,7 @@ */ #include <assert.h> -#include <math.h> +#include <tgmath.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> @@ -7,7 +7,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -73,7 +73,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" diff --git a/cmake/testbuild.c b/cmake/testbuild.c index 67a6879..137af2f 100644 --- a/cmake/testbuild.c +++ b/cmake/testbuild.c @@ -5,7 +5,7 @@ #include <stdarg.h> #include <string.h> #include <errno.h> -#include <math.h> +#include <tgmath.h> #include <sys/time.h> #include <sys/resource.h> @@ -7,7 +7,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -48,7 +48,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -27,7 +27,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -8,7 +8,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -58,7 +58,7 @@ #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -9,7 +9,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -32,7 +32,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -80,7 +80,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -13,7 +13,7 @@ #include <ctype.h> #include <float.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -13,7 +13,7 @@ #include <stdarg.h> #include <string.h> #include <errno.h> -#include <math.h> +#include <tgmath.h> #include <unistd.h> #include <sys/time.h> @@ -7,7 +7,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -12,7 +12,7 @@ */ #include <assert.h> -#include <math.h> +#include <tgmath.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> @@ -12,7 +12,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -8,7 +8,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "latin.h" @@ -48,7 +48,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -8,7 +8,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -77,7 +77,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -37,7 +37,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -15,7 +15,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -13,7 +13,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "tree234.h" #include "puzzles.h" @@ -3,7 +3,7 @@ */ #include <assert.h> -#include <math.h> +#include <tgmath.h> #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -14,7 +14,7 @@ #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -8,7 +8,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -9,7 +9,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -16,7 +16,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -8,7 +8,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -36,7 +36,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "grid.h" @@ -8,7 +8,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" @@ -9,7 +9,7 @@ #include <assert.h> #include <string.h> -#include <math.h> +#include <tgmath.h> #include <stdio.h> #include "puzzles.h" /* for malloc routines, and PI */ @@ -58,7 +58,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -26,7 +26,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -68,7 +68,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -8,7 +8,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -58,7 +58,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "latin.h" @@ -10,7 +10,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -28,7 +28,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -87,7 +87,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #ifdef STANDALONE_SOLVER #include <stdarg.h> @@ -33,7 +33,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "matching.h" @@ -23,7 +23,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "latin.h" @@ -21,7 +21,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -11,7 +11,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -35,7 +35,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -21,7 +21,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "latin.h" /* contains typedef for digit */ diff --git a/unfinished/group.c b/unfinished/group.c index 891c4e4..345deb5 100644 --- a/unfinished/group.c +++ b/unfinished/group.c @@ -31,7 +31,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "latin.h" diff --git a/unfinished/numgame.c b/unfinished/numgame.c index 849c83e..5de69a2 100644 --- a/unfinished/numgame.c +++ b/unfinished/numgame.c @@ -40,7 +40,7 @@ #include <string.h> #include <limits.h> #include <assert.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" diff --git a/unfinished/separate.c b/unfinished/separate.c index 9ffa632..fdeeb3d 100644 --- a/unfinished/separate.c +++ b/unfinished/separate.c @@ -94,7 +94,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" diff --git a/unfinished/slide.c b/unfinished/slide.c index acddd93..a4cf168 100644 --- a/unfinished/slide.c +++ b/unfinished/slide.c @@ -32,7 +32,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" diff --git a/unfinished/sokoban.c b/unfinished/sokoban.c index 80596c2..a493bf4 100644 --- a/unfinished/sokoban.c +++ b/unfinished/sokoban.c @@ -58,7 +58,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -47,7 +47,7 @@ #include <string.h> #include <assert.h> #include <ctype.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" @@ -32,7 +32,7 @@ #include <assert.h> #include <ctype.h> #include <limits.h> -#include <math.h> +#include <tgmath.h> #include "puzzles.h" #include "tree234.h" |