Fixed compiler warning on Visual C++
authorSam Lantinga <slouken@libsdl.org>
Mon, 07 Mar 2011 14:07:08 -0800
changeset 5447 2a3cf6d7cac5
parent 5446 6ac8b0ac645e
child 5448 8090caeed230
Fixed compiler warning on Visual C++
src/video/SDL_pixels.c
--- a/src/video/SDL_pixels.c	Mon Mar 07 14:06:46 2011 -0800
+++ b/src/video/SDL_pixels.c	Mon Mar 07 14:07:08 2011 -0800
@@ -816,7 +816,7 @@
         v = (pixel & format->Bmask) >> format->Bshift;
         *b = SDL_expand_byte[format->Bloss][v];
     } else {
-        if (pixel < format->palette->ncolors) {
+        if (pixel < (unsigned)format->palette->ncolors) {
             *r = format->palette->colors[pixel].r;
             *g = format->palette->colors[pixel].g;
             *b = format->palette->colors[pixel].b;
@@ -841,7 +841,7 @@
         v = (pixel & format->Amask) >> format->Ashift;
         *a = SDL_expand_byte[format->Aloss][v];
     } else {
-        if (pixel < format->palette->ncolors) {
+        if (pixel < (unsigned)format->palette->ncolors) {
             *r = format->palette->colors[pixel].r;
             *g = format->palette->colors[pixel].g;
             *b = format->palette->colors[pixel].b;