Fixed some trivial compiler warnings

This commit is contained in:
Alex Szpakowski
2014-03-12 17:55:19 -03:00
parent a13fd761cc
commit 4faddcd9aa
8 changed files with 37 additions and 21 deletions
+2 -2
View File
@@ -468,8 +468,8 @@ void Source::getDirection(float *v) const
void Source::setCone(float innerAngle, float outerAngle, float outerVolume)
{
cone.innerAngle = LOVE_TODEG(innerAngle);
cone.outerAngle = LOVE_TODEG(outerAngle);
cone.innerAngle = (int) LOVE_TODEG(innerAngle);
cone.outerAngle = (int) LOVE_TODEG(outerAngle);
cone.outerVolume = outerVolume;
if (valid)
+13 -13
View File
@@ -198,14 +198,14 @@ bool Math::isConvex(const std::vector<Vertex> &polygon)
**/
float Math::gammaToLinear(float c) const
{
if (c > 1.0)
return 1.0;
else if (c < 0.0)
return 0.0;
if (c > 1.0f)
return 1.0f;
else if (c < 0.0f)
return 0.0f;
else if (c <= 0.04045)
return c / 12.92;
return c / 12.92f;
else
return powf((c + 0.055) / 1.055, 2.4);
return powf((c + 0.055f) / 1.055f, 2.4f);
}
/**
@@ -213,14 +213,14 @@ float Math::gammaToLinear(float c) const
**/
float Math::linearToGamma(float c) const
{
if (c > 1.0)
return 1.0;
else if (c < 0.0)
return 0.0;
else if (c < 0.0031308)
return c * 12.92;
if (c > 1.0f)
return 1.0f;
else if (c < 0.0f)
return 0.0f;
else if (c < 0.0031308f)
return c * 12.92f;
else
return 1.055 * powf(c, 0.41666) - 0.055;
return 1.055f * powf(c, 0.41666f) - 0.055f;
}
} // math
+2 -2
View File
@@ -259,7 +259,7 @@ static int getGammaArgs(lua_State *L, float color[4])
for (int i = 1; i <= n && i <= 4; i++)
{
lua_rawgeti(L, 1, i);
color[i - 1] = (float) luaL_checknumber(L, -1) / 255.0;
color[i - 1] = (float) luaL_checknumber(L, -1) / 255.0f;
numcomponents++;
}
@@ -270,7 +270,7 @@ static int getGammaArgs(lua_State *L, float color[4])
int n = lua_gettop(L);
for (int i = 1; i <= n && i <= 4; i++)
{
color[i - 1] = (float) luaL_checknumber(L, i) / 255.0;
color[i - 1] = (float) luaL_checknumber(L, i) / 255.0f;
numcomponents++;
}
}
+1 -1
View File
@@ -202,7 +202,7 @@ uint16 Fixture::getBits(lua_State *L)
{
size_t bpos = (size_t)(lua_tointeger(L, i)-1);
if (bpos >= 16)
return luaL_error(L, "Values must be in range 1-16.");
luaL_error(L, "Values must be in range 1-16.");
b.set(bpos, true);
}