2 ms·
Every machine in the world is Little Endian, and I'm going to specify a file format -- https://en.wikipedia.org/wiki/WAV https://en.wikipedia.org/wiki/WAV -- wi
by loup-vaillant 10y ago
Every machine in the world is Little Endian, and I'm going to specify a file format -- https://en.wikipedia.org/wiki/WAV https://en.wikipedia.org/wiki/WAV -- with C structs and type punning. Seriously, Microsoft?
Me, I just
static uint32_t
load32_le(const uint8_t s[8])
{
return (uint32_t)s[0]
| ((uint32_t)s[1] << 8)
| ((uint32_t)s[2] << 16)
| ((uint32_t)s[3] << 24);
}