From f70a37d4d903c38c4de3174eb3c95d300b4cb9c0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 20 Jul 2013 19:51:51 -0400 Subject: [PATCH] Fixed some compiler warnings that Visual Studio reported. --- include/SDL_thread.h | 2 +- src/stdlib/SDL_string.c | 2 +- src/thread/SDL_thread.c | 4 ++-- src/thread/SDL_thread_c.h | 2 +- src/video/SDL_surface.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/SDL_thread.h b/include/SDL_thread.h index ba5af31e2..e480a773b 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -49,7 +49,7 @@ typedef struct SDL_Thread SDL_Thread; 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 * diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index fd3fba3f7..93bb056ad 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -1350,7 +1350,7 @@ SDL_PrintUnsignedLongLong(char *text, size_t maxlen, SDL_FormatInfo *info, Uint6 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; diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index e0bac7e77..6b9fa1894 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -57,8 +57,8 @@ SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void *)) } 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); diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index da3a165fb..1971ded24 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -58,7 +58,7 @@ extern void SDL_RunThread(void *data); /* This is the system-independent thread local storage structure */ typedef struct { - int limit; + unsigned int limit; struct { void *data; void (*destructor)(void*); diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 2544462ba..17f253c2c 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -178,7 +178,7 @@ SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key) 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"); }