Fixed some compiler warnings that Visual Studio reported.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 20 Jul 2013 19:51:51 -0400
changeset 7482249d8ecbbb7d
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
     1.1 --- a/include/SDL_thread.h	Sat Jul 20 18:51:49 2013 -0400
     1.2 +++ b/include/SDL_thread.h	Sat Jul 20 19:51:51 2013 -0400
     1.3 @@ -49,7 +49,7 @@
     1.4  typedef unsigned long SDL_threadID;
     1.5  
     1.6  /* Thread local storage ID, 0 is the invalid ID */
     1.7 -typedef unsigned SDL_TLSID;
     1.8 +typedef unsigned int SDL_TLSID;
     1.9  
    1.10  /* The SDL thread priority
    1.11   *
     2.1 --- a/src/stdlib/SDL_string.c	Sat Jul 20 18:51:49 2013 -0400
     2.2 +++ b/src/stdlib/SDL_string.c	Sat Jul 20 19:51:51 2013 -0400
     2.3 @@ -1350,7 +1350,7 @@
     2.4  static size_t
     2.5  SDL_PrintFloat(char *text, size_t maxlen, SDL_FormatInfo *info, double arg)
     2.6  {
     2.7 -    int i, width;
     2.8 +    int width;
     2.9      size_t len;
    2.10      size_t left = maxlen;
    2.11      char *textstart = text;
     3.1 --- a/src/thread/SDL_thread.c	Sat Jul 20 18:51:49 2013 -0400
     3.2 +++ b/src/thread/SDL_thread.c	Sat Jul 20 19:51:51 2013 -0400
     3.3 @@ -57,8 +57,8 @@
     3.4      }
     3.5  
     3.6      storage = SDL_SYS_GetTLSData();
     3.7 -    if (!storage || id > storage->limit) {
     3.8 -        int i, oldlimit, newlimit;
     3.9 +    if (!storage || (id > storage->limit)) {
    3.10 +        unsigned int i, oldlimit, newlimit;
    3.11  
    3.12          oldlimit = storage ? storage->limit : 0;
    3.13          newlimit = (id + TLS_ALLOC_CHUNKSIZE);
     4.1 --- a/src/thread/SDL_thread_c.h	Sat Jul 20 18:51:49 2013 -0400
     4.2 +++ b/src/thread/SDL_thread_c.h	Sat Jul 20 19:51:51 2013 -0400
     4.3 @@ -58,7 +58,7 @@
     4.4  
     4.5  /* This is the system-independent thread local storage structure */
     4.6  typedef struct {
     4.7 -    int limit;
     4.8 +    unsigned int limit;
     4.9      struct {
    4.10          void *data;
    4.11          void (*destructor)(void*);
     5.1 --- a/src/video/SDL_surface.c	Sat Jul 20 18:51:49 2013 -0400
     5.2 +++ b/src/video/SDL_surface.c	Sat Jul 20 19:51:51 2013 -0400
     5.3 @@ -178,7 +178,7 @@
     5.4          return SDL_InvalidParamError("surface");
     5.5      }
     5.6  
     5.7 -    if (surface->format->palette && key >= surface->format->palette->ncolors) {
     5.8 +    if (surface->format->palette && key >= ((Uint32) surface->format->palette->ncolors)) {
     5.9          return SDL_InvalidParamError("key");
    5.10      }
    5.11