Visual C++ compiler warning fixes
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Jul 2007 06:53:20 +0000
changeset 21798b76cc268771
parent 2178 114a541cfae2
child 2180 5ed37b16c1a7
Visual C++ compiler warning fixes
VisualC.zip
src/file/SDL_rwops.c
test/common.c
test/loopwave.c
test/testwm.c
     1.1 Binary file VisualC.zip has changed
     2.1 --- a/src/file/SDL_rwops.c	Thu Jul 12 06:31:36 2007 +0000
     2.2 +++ b/src/file/SDL_rwops.c	Thu Jul 12 06:53:20 2007 +0000
     2.3 @@ -191,7 +191,7 @@
     2.4          void *data = (char *) context->hidden.win32io.buffer.data +
     2.5              context->hidden.win32io.buffer.size -
     2.6              context->hidden.win32io.buffer.left;
     2.7 -        read_ahead = SDL_min(total_need, context->hidden.win32io.buffer.left);
     2.8 +        read_ahead = SDL_min(total_need, (size_t)context->hidden.win32io.buffer.left);
     2.9          SDL_memcpy(ptr, data, read_ahead);
    2.10          context->hidden.win32io.buffer.left -= read_ahead;
    2.11  
     3.1 --- a/test/common.c	Thu Jul 12 06:31:36 2007 +0000
     3.2 +++ b/test/common.c	Thu Jul 12 06:53:20 2007 +0000
     3.3 @@ -245,7 +245,7 @@
     3.4          if (!argv[index]) {
     3.5              return -1;
     3.6          }
     3.7 -        state->audiospec.channels = SDL_atoi(argv[index]);
     3.8 +        state->audiospec.channels = (Uint8)SDL_atoi(argv[index]);
     3.9          return 2;
    3.10      }
    3.11      if (SDL_strcasecmp(argv[index], "--samples") == 0) {
    3.12 @@ -253,7 +253,7 @@
    3.13          if (!argv[index]) {
    3.14              return -1;
    3.15          }
    3.16 -        state->audiospec.samples = SDL_atoi(argv[index]);
    3.17 +        state->audiospec.samples = (Uint16)SDL_atoi(argv[index]);
    3.18          return 2;
    3.19      }
    3.20      if ((SDL_strcasecmp(argv[index], "-h") == 0)
    3.21 @@ -498,7 +498,7 @@
    3.22      fprintf(stderr, ")\n");
    3.23  
    3.24      fprintf(stderr, "    Texture formats (%d): ", info->num_texture_formats);
    3.25 -    for (i = 0; i < info->num_texture_formats; ++i) {
    3.26 +    for (i = 0; i < (int)info->num_texture_formats; ++i) {
    3.27          if (i > 0) {
    3.28              fprintf(stderr, ", ");
    3.29          }
     4.1 --- a/test/loopwave.c	Thu Jul 12 06:31:36 2007 +0000
     4.2 +++ b/test/loopwave.c	Thu Jul 12 06:53:20 2007 +0000
     4.3 @@ -67,8 +67,6 @@
     4.4  int
     4.5  main(int argc, char *argv[])
     4.6  {
     4.7 -    int i, n;
     4.8 -
     4.9      /* Load the SDL library */
    4.10      if (SDL_Init(SDL_INIT_AUDIO) < 0) {
    4.11          fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
     5.1 --- a/test/testwm.c	Thu Jul 12 06:31:36 2007 +0000
     5.2 +++ b/test/testwm.c	Thu Jul 12 06:53:20 2007 +0000
     5.3 @@ -175,7 +175,7 @@
     5.4      SDL_PushEvent(&event);
     5.5  }
     5.6  
     5.7 -static int SDLCALL(*old_filterfunc) (void *, SDL_Event *);
     5.8 +static int (SDLCALL *old_filterfunc) (void *, SDL_Event *);
     5.9  static void *old_filterdata;
    5.10  
    5.11  int SDLCALL