Fixed compiler warnings on Visual Studio 2013
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
diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c
index 83971ed..10fdcf9 100644
--- a/src/file/SDL_rwops.c
+++ b/src/file/SDL_rwops.c
@@ -676,13 +676,13 @@ SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc)
if (size < 0) {
size = FILE_CHUNK_SIZE;
}
- data = SDL_malloc(size+1);
+ data = SDL_malloc((size_t)(size + 1));
size_total = 0;
for (;;) {
if ((size_total + FILE_CHUNK_SIZE) > size) {
size = (size_total + FILE_CHUNK_SIZE);
- newdata = SDL_realloc(data, size + 1);
+ newdata = SDL_realloc(data, (size_t)(size + 1));
if (!newdata) {
SDL_free(data);
data = NULL;
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index def6754..37de325 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -142,13 +142,13 @@ SDL_LoadVIDPIDListFromHint(const char *hint, SDL_vidpid_list *list)
}
while ((spot = SDL_strstr(spot, "0x")) != NULL) {
- entry = SDL_strtol(spot, &spot, 0);
+ entry = (Uint16)SDL_strtol(spot, &spot, 0);
entry <<= 16;
spot = SDL_strstr(spot, "0x");
if (!spot) {
break;
}
- entry |= SDL_strtol(spot, &spot, 0);
+ entry |= (Uint16)SDL_strtol(spot, &spot, 0);
if (list->num_entries == list->max_entries) {
int max_entries = list->max_entries + 16;
diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c
index 9b40a60..e154107 100644
--- a/src/video/windows/SDL_windowsmessagebox.c
+++ b/src/video/windows/SDL_windowsmessagebox.c
@@ -346,7 +346,6 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{
WIN_DialogData *dialog;
int i, x, y;
- UINT_PTR which;
const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
HFONT DialogFont;
SIZE Size;