simon-git: puzzles (main): Ben Harris
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Apr 5 21:50:18 BST 2023
TL;DR:
2e48ce1 Replace <math.h> with <tgmath.h> throughout
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Ben Harris <bjh21 at bjh21.me.uk>
Date: 2023-04-05 21:50:18
commit 2e48ce132e011e83517a9fc4905edcc8f9a5ef58
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=2e48ce132e011e83517a9fc4905edcc8f9a5ef58;hp=4fcc1ea6012dbb25aeb94397d81f364fab81a58d
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date: Tue Apr 4 21:43:25 2023 +0100
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.
auxiliary/hat-test.c | 2 +-
auxiliary/hatgen.c | 2 +-
blackbox.c | 2 +-
bridges.c | 2 +-
cmake/testbuild.c | 2 +-
cube.c | 2 +-
dominosa.c | 2 +-
drawing.c | 2 +-
fifteen.c | 2 +-
filling.c | 2 +-
flip.c | 2 +-
flood.c | 2 +-
galaxies.c | 2 +-
grid.c | 2 +-
gtk.c | 2 +-
guess.c | 2 +-
hat.c | 2 +-
inertia.c | 2 +-
keen.c | 2 +-
lightup.c | 2 +-
loopgen.c | 2 +-
loopy.c | 2 +-
magnets.c | 2 +-
map.c | 2 +-
mines.c | 2 +-
misc.c | 2 +-
mosaic.c | 2 +-
net.c | 2 +-
netslide.c | 2 +-
nullgame.c | 2 +-
pattern.c | 2 +-
pearl.c | 2 +-
pegs.c | 2 +-
penrose.c | 2 +-
range.c | 2 +-
rect.c | 2 +-
samegame.c | 2 +-
signpost.c | 2 +-
singles.c | 2 +-
sixteen.c | 2 +-
slant.c | 2 +-
solo.c | 2 +-
tents.c | 2 +-
towers.c | 2 +-
tracks.c | 2 +-
twiddle.c | 2 +-
undead.c | 2 +-
unequal.c | 2 +-
unfinished/group.c | 2 +-
unfinished/numgame.c | 2 +-
unfinished/separate.c | 2 +-
unfinished/slide.c | 2 +-
unfinished/sokoban.c | 2 +-
unruly.c | 2 +-
untangle.c | 2 +-
55 files changed, 55 insertions(+), 55 deletions(-)
More information about the tartarus-commits
mailing list