mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Address some compiler warnings about implicit integer conversions.
--HG-- branch : minor
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user