|Re: [hatari-devel] Removing SDL use for byte order checks / conversions|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Removing SDL use for byte order checks / conversions
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Thu, 6 Oct 2022 08:07:25 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1665043646; bh=fx8l2drUAt3WfJmLh9YW7dS86WHNOF7r8augt7/Vp0w=; h=Date:Subject:To:From:From; b=HmI/Eia36wEmADoJmgkZDB8T5vgFSn+xCS4libL3FdkVKEdrVvyKGYfuPhd+0k7No yInovEZB6q/3dcxm+0BPJK1/8ibpTAhoRfqUWwU+IDjzmfr6Eflobbb2+8Evql6rcj Rrl0j/uxwb4gyAne76FbXF+Q/b9M1JjP7IPvChzlMeMeUO792VUF73wO7pbqcy3nMq F/SURAP/EMj39pV4q2BInEi8JvLtpp8B2oeV/C7WPwpZyTFSiKMOQEXttgxEFw+1K0 2Q0+BVpfFgCmOD4VmWerN9aKz8DDuG0YcO0pGv6MhptbHTGj53IqyDQss20xTj0Uc1 eQhcu1SpZJMLQ==
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:
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
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.