Fixed compiler warnings on Visual Studio 2013
authorSam Lantinga <slouken@libsdl.org>
Sat, 12 Aug 2017 00:04:46 -0700
changeset 112368c3cba28b1fd
parent 11235 6c3895d3599f
child 11237 11c69137bfd5
Fixed compiler warnings on Visual Studio 2013
src/file/SDL_rwops.c
src/joystick/SDL_gamecontroller.c
src/video/windows/SDL_windowsmessagebox.c
     1.1 --- a/src/file/SDL_rwops.c	Sat Aug 12 00:01:24 2017 -0700
     1.2 +++ b/src/file/SDL_rwops.c	Sat Aug 12 00:04:46 2017 -0700
     1.3 @@ -676,13 +676,13 @@
     1.4      if (size < 0) {
     1.5          size = FILE_CHUNK_SIZE;
     1.6      }
     1.7 -    data = SDL_malloc(size+1);
     1.8 +    data = SDL_malloc((size_t)(size + 1));
     1.9  
    1.10      size_total = 0;
    1.11      for (;;) {
    1.12          if ((size_total + FILE_CHUNK_SIZE) > size) {
    1.13              size = (size_total + FILE_CHUNK_SIZE);
    1.14 -            newdata = SDL_realloc(data, size + 1);
    1.15 +            newdata = SDL_realloc(data, (size_t)(size + 1));
    1.16              if (!newdata) {
    1.17                  SDL_free(data);
    1.18                  data = NULL;
     2.1 --- a/src/joystick/SDL_gamecontroller.c	Sat Aug 12 00:01:24 2017 -0700
     2.2 +++ b/src/joystick/SDL_gamecontroller.c	Sat Aug 12 00:04:46 2017 -0700
     2.3 @@ -142,13 +142,13 @@
     2.4      }
     2.5  
     2.6      while ((spot = SDL_strstr(spot, "0x")) != NULL) {
     2.7 -        entry = SDL_strtol(spot, &spot, 0);
     2.8 +        entry = (Uint16)SDL_strtol(spot, &spot, 0);
     2.9          entry <<= 16;
    2.10          spot = SDL_strstr(spot, "0x");
    2.11          if (!spot) {
    2.12              break;
    2.13          }
    2.14 -        entry |= SDL_strtol(spot, &spot, 0);
    2.15 +        entry |= (Uint16)SDL_strtol(spot, &spot, 0);
    2.16  
    2.17          if (list->num_entries == list->max_entries) {
    2.18              int max_entries = list->max_entries + 16;
     3.1 --- a/src/video/windows/SDL_windowsmessagebox.c	Sat Aug 12 00:01:24 2017 -0700
     3.2 +++ b/src/video/windows/SDL_windowsmessagebox.c	Sat Aug 12 00:04:46 2017 -0700
     3.3 @@ -346,7 +346,6 @@
     3.4  {
     3.5      WIN_DialogData *dialog;
     3.6      int i, x, y;
     3.7 -    UINT_PTR which;
     3.8      const SDL_MessageBoxButtonData *buttons = messageboxdata->buttons;
     3.9      HFONT DialogFont;
    3.10      SIZE Size;