aboutsummaryrefslogtreecommitdiff
path: root/undead.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-04-04 21:43:25 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-04-04 21:43:25 +0100
commit2e48ce132e011e83517a9fc4905edcc8f9a5ef58 (patch)
tree36edea02171e24dcf91a49f59f3d9046307f999e /undead.c
parent4fcc1ea6012dbb25aeb94397d81f364fab81a58d (diff)
downloadpuzzles-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.
Diffstat (limited to 'undead.c')
-rw-r--r--undead.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/undead.c b/undead.c
index 833eb34..4ef8fe4 100644
--- a/undead.c
+++ b/undead.c
@@ -35,7 +35,7 @@
#include <string.h>
#include <assert.h>
#include <ctype.h>
-#include <math.h>
+#include <tgmath.h>
#include "puzzles.h"