Commit Graph
5 Commits
Author SHA1 Message Date
Rafał Florczak a0e4f6a4b0 Parallel github workflow builds 2024-08-12 13:31:18 -07:00
Rafał Florczak 5369f16e16 Implement cross-platform FTOC using clamp and static_casts
The old implementation relied on the tricks that no longer seem to
optimize anything and break strict aliasing rule, which in turn is an
undefined behavior:

/var/storage/rf/proj/itgmania/src/RageTypes.h: In function ‘unsigned char FTOC(float)’:
/var/storage/rf/proj/itgmania/src/RageTypes.h:300:42: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  300 |         int ret = reinterpret_cast<int&>(base);
      |                                          ^~~~

Compiler explorer summary: https://godbolt.org/z/5857747P3

It's also possible to eliminate this strict aliasing violation with a union,
while leaving all the tricky code (also included in the link above).

Online build of the test code that's suggested for FTOC: https://onlinegdb.com/O7N0Orl0r

ARM version of the code wasn't correct -- as in not passing the attached test.
It didn't perform accurately around the end of the input range.
2024-07-17 20:21:55 -07:00
Rafał Florczak 90aabddc7f Drop libbz2 dependency
Dynamic linking against libbz2 was problematic on some distributions.
We only needed it for pcre's CLI (which we don't use) and ffmpeg's mkv
decompression in case a user forced encoder to use it, because its usage
is discouraged by the standard.

See https://github.com/itgmania/itgmania/issues/217 for the related
discussion.
2024-06-18 05:39:51 -07:00
Rafał Florczak 903fa7eea3 Treat type-limits as errors in GNU builds 2024-05-30 17:38:47 -07:00
Rafał Florczak f7f88f9544 Guard against signedness of chars and wchars on different targets 2024-05-30 17:38:47 -07:00