Address some compiler warnings about implicit integer conversions.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-10-18 22:32:35 -03:00
parent 2e016810c9
commit 0653ec9564
23 changed files with 44 additions and 43 deletions
+1 -1
View File
@@ -629,7 +629,7 @@ love::image::ImageData *Canvas::newImageData(love::image::Image *image, int x, i
break;
}
int size = w * h * image::ImageData::getPixelSize(imageformat);
size_t size = w * h * image::ImageData::getPixelSize(imageformat);
uint8 *pixels = nullptr;
try
{
+1 -1
View File
@@ -1299,7 +1299,7 @@ void Graphics::points(const float *coords, const uint8 *colors, size_t numpoints
}
gl.useVertexAttribArrays(attribflags);
gl.drawArrays(GL_POINTS, 0, numpoints);
gl.drawArrays(GL_POINTS, 0, (GLsizei) numpoints);
}
void Graphics::polyline(const float *coords, size_t count)
+1 -1
View File
@@ -569,7 +569,7 @@ int Mesh::bindAttributeToShaderInput(int attributeindex, const std::string &inpu
GLenum datatype = getGLDataType(format.type);
GLboolean normalized = (datatype == GL_UNSIGNED_BYTE);
glVertexAttribPointer(attriblocation, format.components, datatype, normalized, vertexStride, gloffset);
glVertexAttribPointer(attriblocation, format.components, datatype, normalized, (GLsizei) vertexStride, gloffset);
return attriblocation;
}
+1 -1
View File
@@ -420,7 +420,7 @@ void Shader::attach(bool temporary)
{
// make sure all sent textures are properly bound to their respective texture units
// note: list potentially contains texture ids of deleted/invalid textures!
for (size_t i = 0; i < activeTexUnits.size(); ++i)
for (int i = 0; i < (int) activeTexUnits.size(); ++i)
{
if (activeTexUnits[i] > 0)
gl.bindTextureToUnit(activeTexUnits[i], i + 1, false);
+2 -2
View File
@@ -131,7 +131,7 @@ int w_Mesh_setVertices(lua_State *L)
}
luaL_checktype(L, 2, LUA_TTABLE);
size_t nvertices = luax_objlen(L, 2);
int nvertices = (int) luax_objlen(L, 2);
if (vertoffset + nvertices > t->getVertexCount())
return luaL_error(L, "Too many vertices (expected at most %d, got %d)", (int) t->getVertexCount() - (int) vertoffset, (int) nvertices);
@@ -144,7 +144,7 @@ int w_Mesh_setVertices(lua_State *L)
char *data = (char *) t->mapVertexData() + byteoffset;
for (size_t i = 0; i < nvertices; i++)
for (int i = 0; i < nvertices; i++)
{
// get vertices[vertindex]
lua_rawgeti(L, 2, i + 1);
+1 -1
View File
@@ -39,7 +39,7 @@ void luax_checkcoloredstring(lua_State *L, int idx, std::vector<Font::ColoredStr
if (lua_istable(L, idx))
{
int len = luax_objlen(L, idx);
int len = (int) luax_objlen(L, idx);
for (int i = 1; i <= len; i++)
{