Fixed some compiler warnings that Visual Studio reported.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 20 Jul 2013 19:51:51 -0400
changeset 7482 249d8ecbbb7d
parent 7481 5ff71e03d9eb
child 7483 0eafcc0d161b
Fixed some compiler warnings that Visual Studio reported.
include/SDL_thread.h
src/stdlib/SDL_string.c
src/thread/SDL_thread.c
src/thread/SDL_thread_c.h
src/video/SDL_surface.c
--- a/include/SDL_thread.h	Sat Jul 20 18:51:49 2013 -0400
+++ b/include/SDL_thread.h	Sat Jul 20 19:51:51 2013 -0400
@@ -49,7 +49,7 @@
 typedef unsigned long SDL_threadID;
 
 /* Thread local storage ID, 0 is the invalid ID */
-typedef unsigned SDL_TLSID;
+typedef unsigned int SDL_TLSID;
 
 /* The SDL thread priority
  *
--- a/src/stdlib/SDL_string.c	Sat Jul 20 18:51:49 2013 -0400
+++ b/src/stdlib/SDL_string.c	Sat Jul 20 19:51:51 2013 -0400
@@ -1350,7 +1350,7 @@
 static size_t
 SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg)
 {
-    int i, width;
+    int width;
     size_t len;
     size_t left = maxlen;
     char *textstart = text;
--- a/src/thread/SDL_thread.c	Sat Jul 20 18:51:49 2013 -0400
+++ b/src/thread/SDL_thread.c	Sat Jul 20 19:51:51 2013 -0400
@@ -57,8 +57,8 @@
     }
 
     storage = SDL_SYS_GetTLSData();
-    if (!storage || id > storage->limit) {
-        int i, oldlimit, newlimit;
+    if (!storage || (id > storage->limit)) {
+        unsigned int i, oldlimit, newlimit;
 
         oldlimit = storage ? storage->limit : 0;
         newlimit = (id + TLS_ALLOC_CHUNKSIZE);
--- a/src/thread/SDL_thread_c.h	Sat Jul 20 18:51:49 2013 -0400
+++ b/src/thread/SDL_thread_c.h	Sat Jul 20 19:51:51 2013 -0400
@@ -58,7 +58,7 @@
 
 /* This is the system-independent thread local storage structure */
 typedef struct {
-    int limit;
+    unsigned int limit;
     struct {
         void *data;
         void (*destructor)(void*);
--- a/src/video/SDL_surface.c	Sat Jul 20 18:51:49 2013 -0400
+++ b/src/video/SDL_surface.c	Sat Jul 20 19:51:51 2013 -0400
@@ -178,7 +178,7 @@
         return SDL_InvalidParamError("surface");
     }
 
-    if (surface->format->palette && key >= surface->format->palette->ncolors) {
+    if (surface->format->palette && key >= ((Uint32) surface->format->palette->ncolors)) {
         return SDL_InvalidParamError("key");
     }