diff src/video/SDL_gamma.c @ 1612:97d0966f4bf7

Fixed some ultra-pedantic gcc warnings
author Sam Lantinga <slouken@libsdl.org>
date Fri, 24 Mar 2006 06:10:24 +0000
parents d910939febfa
children 782fd950bd46 65800e7f7146
line wrap: on
line diff
--- a/src/video/SDL_gamma.c	Fri Mar 24 05:11:51 2006 +0000
+++ b/src/video/SDL_gamma.c	Fri Mar 24 06:10:24 2006 +0000
@@ -43,14 +43,14 @@
 	int i;
 
 	/* 0.0 gamma is all black */
-	if ( gamma <= 0.0 ) {
+	if ( gamma <= 0.0f ) {
 		for ( i=0; i<256; ++i ) {
 			ramp[i] = 0;
 		}
 		return;
 	} else
 	/* 1.0 gamma is identity */
-	if ( gamma == 1.0 ) {
+	if ( gamma >= 1.0f ) {
 		for ( i=0; i<256; ++i ) {
 			ramp[i] = (i << 8) | i;
 		}
@@ -73,7 +73,7 @@
 	/* The following is adapted from a post by Garrett Bass on OpenGL
 	   Gamedev list, March 4, 2000.
 	 */
-	float sum = 0.0;
+	float sum = 0.0f;
 	int i, count = 0;
 
 	*gamma = 1.0;
@@ -85,7 +85,7 @@
 	        count++;
 	    }
 	}
-	if ( count && sum ) {
+	if ( count && sum > 0.0f ) {
 		*gamma = 1.0f / (sum / count);
 	}
 }