mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-29 06:28:29 +00:00
Fix format string warnings for width-based integers
The DJGPP compiler emits many warnings for conflicts between print format specifiers and argument types. To fix the warnings, I added `SDL_PRIx32` macros for use with `Sint32` and `Uint32` types. The macros alias those found in <inttypes.h> or fallback to a reasonable default. As an alternative, print arguments could be cast to plain old integers. I opted slightly for the current solution as it felt more technically correct, despite making the format strings more verbose.
This commit is contained in:

committed by
Sam Lantinga

parent
5427f4861b
commit
f443a6fc7a
@@ -1871,7 +1871,7 @@ WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 **audio_buf,
|
||||
while ((Uint64)RIFFend > (Uint64)chunk->position + chunk->length + (chunk->length & 1)) {
|
||||
/* Abort after too many chunks or else corrupt files may waste time. */
|
||||
if (chunkcount++ >= chunkcountlimit) {
|
||||
return SDL_SetError("Chunk count in WAVE file exceeds limit of %u", chunkcountlimit);
|
||||
return SDL_SetError("Chunk count in WAVE file exceeds limit of %" SDL_PRIu32, chunkcountlimit);
|
||||
}
|
||||
|
||||
result = WaveNextChunk(src, chunk);
|
||||
|
Reference in New Issue
Block a user