mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Fix many warnings about implicit integer conversions when compiling for 64 bits.
--HG-- branch : minor
This commit is contained in:
@@ -381,7 +381,7 @@ int w_ParticleSystem_setSizes(lua_State *L)
|
||||
{
|
||||
std::vector<float> sizes(nSizes);
|
||||
for (size_t i = 0; i < nSizes; ++i)
|
||||
sizes[i] = luax_checkfloat(L, 1 + i + 1);
|
||||
sizes[i] = luax_checkfloat(L, (int) (1 + i + 1));
|
||||
|
||||
t->setSizes(sizes);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ int w_ParticleSystem_getSizes(lua_State *L)
|
||||
for (size_t i = 0; i < sizes.size(); i++)
|
||||
lua_pushnumber(L, sizes[i]);
|
||||
|
||||
return sizes.size();
|
||||
return (int) sizes.size();
|
||||
}
|
||||
|
||||
int w_ParticleSystem_setSizeVariation(lua_State *L)
|
||||
@@ -494,14 +494,14 @@ int w_ParticleSystem_setColors(lua_State *L)
|
||||
|
||||
if (lua_istable(L, 2)) // setColors({r,g,b,a}, {r,g,b,a}, ...)
|
||||
{
|
||||
size_t nColors = lua_gettop(L) - 1;
|
||||
int nColors = (int) lua_gettop(L) - 1;
|
||||
|
||||
if (nColors > 8)
|
||||
return luaL_error(L, "At most eight (8) colors may be used.");
|
||||
|
||||
std::vector<Color> colors(nColors);
|
||||
|
||||
for (size_t i = 0; i < nColors; i++)
|
||||
for (int i = 0; i < nColors; i++)
|
||||
{
|
||||
luaL_checktype(L, i + 2, LUA_TTABLE);
|
||||
|
||||
@@ -528,7 +528,7 @@ int w_ParticleSystem_setColors(lua_State *L)
|
||||
else // setColors(r,g,b,a, r,g,b,a, ...)
|
||||
{
|
||||
int cargs = lua_gettop(L) - 1;
|
||||
size_t nColors = (cargs + 3) / 4; // nColors = ceil(color_args / 4)
|
||||
int nColors = (cargs + 3) / 4; // nColors = ceil(color_args / 4)
|
||||
|
||||
if (cargs != 3 && (cargs % 4 != 0 || cargs == 0))
|
||||
return luaL_error(L, "Expected red, green, blue, and alpha. Only got %d of 4 components.", cargs % 4);
|
||||
@@ -547,7 +547,7 @@ int w_ParticleSystem_setColors(lua_State *L)
|
||||
else
|
||||
{
|
||||
std::vector<Color> colors(nColors);
|
||||
for (size_t i = 0; i < nColors; ++i)
|
||||
for (int i = 0; i < nColors; ++i)
|
||||
{
|
||||
unsigned char r = (unsigned char) luaL_checkinteger(L, 1 + i*4 + 1);
|
||||
unsigned char g = (unsigned char) luaL_checkinteger(L, 1 + i*4 + 2);
|
||||
@@ -582,7 +582,7 @@ int w_ParticleSystem_getColors(lua_State *L)
|
||||
lua_rawseti(L, -2, 4);
|
||||
}
|
||||
|
||||
return colors.size();
|
||||
return (int) colors.size();
|
||||
}
|
||||
|
||||
int w_ParticleSystem_setQuads(lua_State *L)
|
||||
@@ -592,7 +592,7 @@ int w_ParticleSystem_setQuads(lua_State *L)
|
||||
|
||||
if (lua_istable(L, 2))
|
||||
{
|
||||
for (size_t i = 1; i <= lua_objlen(L, 2); i++)
|
||||
for (int i = 1; i <= (int) lua_objlen(L, 2); i++)
|
||||
{
|
||||
lua_rawgeti(L, 2, i);
|
||||
|
||||
@@ -622,7 +622,7 @@ int w_ParticleSystem_getQuads(lua_State *L)
|
||||
|
||||
lua_createtable(L, (int) quads.size(), 0);
|
||||
|
||||
for (size_t i = 0; i < quads.size(); i++)
|
||||
for (int i = 0; i < (int) quads.size(); i++)
|
||||
{
|
||||
luax_pushtype(L, "Quad", GRAPHICS_QUAD_T, quads[i]);
|
||||
lua_rawseti(L, -2, i + 1);
|
||||
|
||||
Reference in New Issue
Block a user