SIZE_MAX need not be defined in limits.h it can be in limits.h (windows) or stdint.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c
index 0eec7bf..a7d644a 100644
--- a/src/audio/SDL_wave.c
+++ b/src/audio/SDL_wave.c
@@ -22,14 +22,13 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
-#else
-#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t)-1)
#endif
#ifndef INT_MAX
/* Make a lucky guess. */
#define INT_MAX SDL_MAX_SINT32
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)-1)
#endif
/* Microsoft WAVE file loading routines */
@@ -928,7 +927,7 @@ IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
{
Sint16 step;
Uint32 c;
- Uint8 *cstate = state->cstate;
+ Uint8 *cstate = (Uint8 *) state->cstate;
for (c = 0; c < state->channels; c++) {
size_t o = state->block.pos + c * 4;
@@ -1561,7 +1560,7 @@ WaveReadPartialChunkData(SDL_RWops *src, WaveChunk *chunk, size_t length)
}
if (length > 0) {
- chunk->data = SDL_malloc(length);
+ chunk->data = (Uint8 *) SDL_malloc(length);
if (chunk->data == NULL) {
return SDL_OutOfMemory();
}
diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c
index b40c974..73b180c 100644
--- a/src/video/windows/SDL_windowsmessagebox.c
+++ b/src/video/windows/SDL_windowsmessagebox.c
@@ -24,11 +24,10 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
-#else
+#endif
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif
-#endif
#include "../../core/windows/SDL_windows.h"