[librpbyteswap] byteswap_rp.h, __swabf(): Initialize the union to 0.

This doesn't affect the compiled output, but it's needed by gcc-5.4
in order to be marked as constexpr.

The uninitialized union *is* allowed as of C++20, supported in
gcc-10.1 and later.
This commit is contained in:
David Korth 2025-05-10 15:09:57 -04:00
parent 3d0fd3627b
commit 7efa014ba8

View File

@ -134,7 +134,7 @@ static inline float __swabf(float f)
union {
uint32_t u32;
float f;
} u32_f;
} u32_f = { 0 };
u32_f.f = f;
u32_f.u32 = __swab32(u32_f.u32);
return u32_f.f;