But Windows is ILP64, where sizeof(int) == sizeof(long).
int32_t is ISO C, which is aimed at both Windows and *nix even though MS refuses to update their compiler past C89.
Toybox is aimed only at systems where sizeof(int)==4. It also expects POSIX2008 support.
The strncmp was done that way because I wanted to see why it wasn't playing.
A more toybox-ish way would be
Code: Select all
if (strncmp(a, b, 4) || strncmp(c, d, 4) || strncmp(e, f, 4)){
perror_msg("bad WAV header: %s", wav_file);
return;
}
This could also be used for the comparisons if you don't want to do strncmp().
Code: Select all
if (IS_LITTLE_ENDIAN) {
//endianness-switching
} else {
//big-endian code
}
On the mixer, -l and -r would be nice; optstring would look about like this:
"l#<0>100r#<0>100"
This way the initialization code converts it to a long and checks the range.
Making list a separate command seems rather pointless; both need to open the mixer and call some ioctls on it.
Also, it's a standard part of most CLI mixers.