Fixed compiling of three test programs with C++.
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 57 58 59 60 61 62 63 64 65 66
diff --git a/test/testgles.c b/test/testgles.c
index 291661a..5be48ac 100644
--- a/test/testgles.c
+++ b/test/testgles.c
@@ -173,7 +173,7 @@ main(int argc, char *argv[])
quit(2);
}
- context = SDL_calloc(state->num_windows, sizeof(context));
+ context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context));
if (context == NULL) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
quit(2);
diff --git a/test/testgles2.c b/test/testgles2.c
index af5962b..45b3d79 100644
--- a/test/testgles2.c
+++ b/test/testgles2.c
@@ -546,7 +546,7 @@ main(int argc, char *argv[])
return 0;
}
- context = SDL_calloc(state->num_windows, sizeof(context));
+ context = (SDL_GLContext *)SDL_calloc(state->num_windows, sizeof(context));
if (context == NULL) {
SDL_Log("Out of memory!\n");
quit(2);
@@ -640,7 +640,7 @@ main(int argc, char *argv[])
}
}
- datas = SDL_calloc(state->num_windows, sizeof(shader_data));
+ datas = (shader_data *)SDL_calloc(state->num_windows, sizeof(shader_data));
/* Set rendering settings for each context */
for (i = 0; i < state->num_windows; ++i) {
diff --git a/test/testime.c b/test/testime.c
index c4a25ea..39a40f8 100644
--- a/test/testime.c
+++ b/test/testime.c
@@ -110,7 +110,7 @@ static void unifont_init(const char *fontname)
const size_t unifontTextureSize = UNIFONT_NUM_TEXTURES * state->num_windows * sizeof(void *);
/* Allocate memory for the glyph data so the file can be closed after initialization. */
- unifontGlyph = SDL_malloc(unifontGlyphSize);
+ unifontGlyph = (struct UnifontGlyph *)SDL_malloc(unifontGlyphSize);
if (unifontGlyph == NULL)
{
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for glyph data.\n", (int)(unifontGlyphSize + 1023) / 1024);
@@ -119,7 +119,7 @@ static void unifont_init(const char *fontname)
SDL_memset(unifontGlyph, 0, unifontGlyphSize);
/* Allocate memory for texture pointers for all renderers. */
- unifontTexture = SDL_malloc(unifontTextureSize);
+ unifontTexture = (SDL_Texture **)SDL_malloc(unifontTextureSize);
if (unifontTexture == NULL)
{
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d KiB for texture pointer data.\n", (int)(unifontTextureSize + 1023) / 1024);
@@ -270,7 +270,7 @@ static void unifont_load_texture(Uint32 textureID)
exit(-1);
}
- textureRGBA = SDL_malloc(UNIFONT_TEXTURE_SIZE);
+ textureRGBA = (Uint8 *)SDL_malloc(UNIFONT_TEXTURE_SIZE);
if (textureRGBA == NULL)
{
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "unifont: Failed to allocate %d MiB for a texture.\n", UNIFONT_TEXTURE_SIZE / 1024 / 1024);