Visual C++ compiler warning fixes
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Jul 2007 06:53:20 +0000
changeset 2179 8b76cc268771
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
Binary file VisualC.zip has changed
--- a/src/file/SDL_rwops.c	Thu Jul 12 06:31:36 2007 +0000
+++ b/src/file/SDL_rwops.c	Thu Jul 12 06:53:20 2007 +0000
@@ -191,7 +191,7 @@
         void *data = (char *) context->hidden.win32io.buffer.data +
             context->hidden.win32io.buffer.size -
             context->hidden.win32io.buffer.left;
-        read_ahead = SDL_min(total_need, context->hidden.win32io.buffer.left);
+        read_ahead = SDL_min(total_need, (size_t)context->hidden.win32io.buffer.left);
         SDL_memcpy(ptr, data, read_ahead);
         context->hidden.win32io.buffer.left -= read_ahead;
 
--- a/test/common.c	Thu Jul 12 06:31:36 2007 +0000
+++ b/test/common.c	Thu Jul 12 06:53:20 2007 +0000
@@ -245,7 +245,7 @@
         if (!argv[index]) {
             return -1;
         }
-        state->audiospec.channels = SDL_atoi(argv[index]);
+        state->audiospec.channels = (Uint8)SDL_atoi(argv[index]);
         return 2;
     }
     if (SDL_strcasecmp(argv[index], "--samples") == 0) {
@@ -253,7 +253,7 @@
         if (!argv[index]) {
             return -1;
         }
-        state->audiospec.samples = SDL_atoi(argv[index]);
+        state->audiospec.samples = (Uint16)SDL_atoi(argv[index]);
         return 2;
     }
     if ((SDL_strcasecmp(argv[index], "-h") == 0)
@@ -498,7 +498,7 @@
     fprintf(stderr, ")\n");
 
     fprintf(stderr, "    Texture formats (%d): ", info->num_texture_formats);
-    for (i = 0; i < info->num_texture_formats; ++i) {
+    for (i = 0; i < (int)info->num_texture_formats; ++i) {
         if (i > 0) {
             fprintf(stderr, ", ");
         }
--- a/test/loopwave.c	Thu Jul 12 06:31:36 2007 +0000
+++ b/test/loopwave.c	Thu Jul 12 06:53:20 2007 +0000
@@ -67,8 +67,6 @@
 int
 main(int argc, char *argv[])
 {
-    int i, n;
-
     /* Load the SDL library */
     if (SDL_Init(SDL_INIT_AUDIO) < 0) {
         fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
--- a/test/testwm.c	Thu Jul 12 06:31:36 2007 +0000
+++ b/test/testwm.c	Thu Jul 12 06:53:20 2007 +0000
@@ -175,7 +175,7 @@
     SDL_PushEvent(&event);
 }
 
-static int SDLCALL(*old_filterfunc) (void *, SDL_Event *);
+static int (SDLCALL *old_filterfunc) (void *, SDL_Event *);
 static void *old_filterdata;
 
 int SDLCALL