Re: [hatari-devel] Removing SDL use for byte order checks / conversions |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
On 05/10/2022 19.17, Eero Tamminen wrote:
Defines should be upper case, and more than 2 letters I think. IMHO better solution is just moving the "ifndef M_PI, define M_PI" to a common header, after "include <math.h>". On 5.10.2022 0.55, David Savinkoff wrote:Dear Sirs: An unused M_PI define in src/falcon/dsp_core.c is the only M_PI in Hatari that is not my fault.
I think we can remove that #define in dsp_core.c since it is not used anymore.
I have come to the conclusion that the entirety of computer science has had decades to find a way of representing pi and has failed. Thus, the correct way of defining pi on a computer in C is as follows: #define pi 3.14159265358979323846264338327950 /* use more digits if needed */ Note that pi is lower case because pi is fundamentally more important than C convention.
Uff, I didn't expect my one-line patch to #include <SDL_stdinc.h> to cause so much discussion ;-) ... anyway, if you all are really that unhappy about SDL_stdinc.h (which always #defines M_PI), I think I'd rather prefer Eero's suggestion to always define M_PI if it is not available in math.h yet. M_PI should be available on *most* systems in math.h, so it is still some kind of default naming and we should not diverge from that in Hatari to make, I think.
Thomas
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |