Fixed compiler warnings on Visual Studio 2013

This commit is contained in:
Sam Lantinga 2017-08-12 00:04:46 -07:00
parent affab6ade5
commit b425050baf
3 changed files with 4 additions and 5 deletions

View File

@ -676,13 +676,13 @@ SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize, int freesrc)
if (size < 0) { if (size < 0) {
size = FILE_CHUNK_SIZE; size = FILE_CHUNK_SIZE;
} }
data = SDL_malloc(size+1); data = SDL_malloc((size_t)(size + 1));
size_total = 0; size_total = 0;
for (;;) { for (;;) {
if ((size_total + FILE_CHUNK_SIZE) > size) { if ((size_total + FILE_CHUNK_SIZE) > size) {
size = (size_total + FILE_CHUNK_SIZE); size = (size_total + FILE_CHUNK_SIZE);
newdata = SDL_realloc(data, size + 1); newdata = SDL_realloc(data, (size_t)(size + 1));
if (!newdata) { if (!newdata) {
SDL_free(data); SDL_free(data);
data = NULL; data = NULL;

View File

@ -142,13 +142,13 @@ SDL_LoadVIDPIDListFromHint(const char *hint, SDL_vidpid_list *list)
} }
while ((spot = SDL_strstr(spot, "0x")) != NULL) { while ((spot = SDL_strstr(spot, "0x")) != NULL) {
entry = SDL_strtol(spot, &spot, 0); entry = (Uint16)SDL_strtol(spot, &spot, 0);
entry <<= 16; entry <<= 16;
spot = SDL_strstr(spot, "0x"); spot = SDL_strstr(spot, "0x");
if (!spot) { if (!spot) {
break; break;
} }
entry |= SDL_strtol(spot, &spot, 0); entry |= (Uint16)SDL_strtol(spot, &spot, 0);
if (list->num_entries == list->max_entries) { if (list->num_entries == list->max_entries) {
int max_entries = list->max_entries + 16; int max_entries = list->max_entries + 16;

View File

@ -346,7 +346,6 @@ WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{ {
WIN_DialogData *dialog; WIN_DialogData *dialog;
int i, x, y; int i, x, y;
UINT_PTR which;
const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons; const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
HFONT DialogFont; HFONT DialogFont;
SIZE Size; SIZE Size;