Browse Source

Fix many warnings about implicit integer conversions when compiling for 64 bits.

--HG--
branch : minor
Alex Szpakowski 10 years ago
parent
commit
ebc68023a7
39 changed files with 114 additions and 114 deletions
  1. 0 3
      platform/xcode/liblove.xcodeproj/project.pbxproj
  2. 6 3
      src/common/runtime.cpp
  3. 1 1
      src/modules/audio/openal/Pool.cpp
  4. 1 1
      src/modules/audio/openal/Source.cpp
  5. 1 1
      src/modules/filesystem/physfs/Filesystem.cpp
  6. 2 2
      src/modules/font/BMFontRasterizer.cpp
  7. 1 1
      src/modules/font/Font.cpp
  8. 6 6
      src/modules/font/freetype/TrueTypeRasterizer.cpp
  9. 4 4
      src/modules/graphics/opengl/Canvas.cpp
  10. 1 1
      src/modules/graphics/opengl/Font.cpp
  11. 1 1
      src/modules/graphics/opengl/Graphics.cpp
  12. 2 2
      src/modules/graphics/opengl/Mesh.cpp
  13. 1 1
      src/modules/graphics/opengl/OpenGL.cpp
  14. 2 2
      src/modules/graphics/opengl/ParticleSystem.cpp
  15. 4 4
      src/modules/graphics/opengl/Polyline.cpp
  16. 3 3
      src/modules/graphics/opengl/Shader.cpp
  17. 1 1
      src/modules/graphics/opengl/SpriteBatch.cpp
  18. 6 6
      src/modules/graphics/opengl/VertexBuffer.cpp
  19. 1 1
      src/modules/graphics/opengl/wrap_Font.cpp
  20. 4 4
      src/modules/graphics/opengl/wrap_Graphics.cpp
  21. 7 7
      src/modules/graphics/opengl/wrap_Mesh.cpp
  22. 9 9
      src/modules/graphics/opengl/wrap_ParticleSystem.cpp
  23. 8 8
      src/modules/graphics/opengl/wrap_Shader.cpp
  24. 1 1
      src/modules/graphics/opengl/wrap_SpriteBatch.cpp
  25. 1 1
      src/modules/image/CompressedData.cpp
  26. 2 2
      src/modules/image/magpie/ImageIOHandler.cpp
  27. 3 3
      src/modules/image/wrap_CompressedData.cpp
  28. 2 2
      src/modules/joystick/sdl/JoystickModule.cpp
  29. 1 1
      src/modules/math/BezierCurve.cpp
  30. 1 1
      src/modules/math/BezierCurve.h
  31. 6 6
      src/modules/math/wrap_BezierCurve.cpp
  32. 13 13
      src/modules/math/wrap_Math.cpp
  33. 3 3
      src/modules/physics/box2d/Physics.cpp
  34. 1 1
      src/modules/sound/SoundData.cpp
  35. 3 3
      src/modules/sound/lullaby/VorbisDecoder.cpp
  36. 1 1
      src/modules/sound/lullaby/WaveDecoder.cpp
  37. 1 1
      src/modules/thread/Channel.cpp
  38. 1 1
      src/modules/touch/wrap_Touch.cpp
  39. 2 2
      src/modules/window/wrap_Window.cpp

+ 0 - 3
platform/xcode/liblove.xcodeproj/project.pbxproj

@@ -3802,7 +3802,6 @@
 					LOVE_NOMPG123,
 					LOVE_NOMPG123,
 				);
 				);
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				HEADER_SEARCH_PATHS = (
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
 					ios/include,
 					ios/include,
@@ -3844,7 +3843,6 @@
 					LOVE_NO_MODPLUG,
 					LOVE_NO_MODPLUG,
 					LOVE_NOMPG123,
 					LOVE_NOMPG123,
 				);
 				);
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				HEADER_SEARCH_PATHS = (
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
 					ios/include,
 					ios/include,
@@ -3887,7 +3885,6 @@
 					LOVE_NO_MODPLUG,
 					LOVE_NO_MODPLUG,
 					LOVE_NOMPG123,
 					LOVE_NOMPG123,
 				);
 				);
-				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				HEADER_SEARCH_PATHS = (
 				HEADER_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(inherited)",
 					ios/include,
 					ios/include,

+ 6 - 3
src/common/runtime.cpp

@@ -330,19 +330,22 @@ int luax_table_insert(lua_State *L, int tindex, int vindex, int pos)
 		tindex = lua_gettop(L)+1+tindex;
 		tindex = lua_gettop(L)+1+tindex;
 	if (vindex < 0)
 	if (vindex < 0)
 		vindex = lua_gettop(L)+1+vindex;
 		vindex = lua_gettop(L)+1+vindex;
+
 	if (pos == -1)
 	if (pos == -1)
 	{
 	{
 		lua_pushvalue(L, vindex);
 		lua_pushvalue(L, vindex);
-		lua_rawseti(L, tindex, lua_objlen(L, tindex)+1);
+		lua_rawseti(L, tindex, (int) lua_objlen(L, tindex)+1);
 		return 0;
 		return 0;
 	}
 	}
 	else if (pos < 0)
 	else if (pos < 0)
-		pos = lua_objlen(L, tindex)+1+pos;
-	for (int i = lua_objlen(L, tindex)+1; i > pos; i--)
+		pos = (int) lua_objlen(L, tindex)+1+pos;
+
+	for (int i = (int) lua_objlen(L, tindex)+1; i > pos; i--)
 	{
 	{
 		lua_rawgeti(L, tindex, i-1);
 		lua_rawgeti(L, tindex, i-1);
 		lua_rawseti(L, tindex, i);
 		lua_rawseti(L, tindex, i);
 	}
 	}
+
 	lua_pushvalue(L, vindex);
 	lua_pushvalue(L, vindex);
 	lua_rawseti(L, tindex, pos);
 	lua_rawseti(L, tindex, pos);
 	return 0;
 	return 0;

+ 1 - 1
src/modules/audio/openal/Pool.cpp

@@ -128,7 +128,7 @@ void Pool::update()
 
 
 int Pool::getSourceCount() const
 int Pool::getSourceCount() const
 {
 {
-	return playing.size();
+	return (int) playing.size();
 }
 }
 
 
 int Pool::getMaxSources() const
 int Pool::getMaxSources() const

+ 1 - 1
src/modules/audio/openal/Source.cpp

@@ -102,7 +102,7 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData)
 	if (fmt == 0)
 	if (fmt == 0)
 		throw InvalidFormatException(soundData->getChannels(), soundData->getBitDepth());
 		throw InvalidFormatException(soundData->getChannels(), soundData->getBitDepth());
 
 
-	staticBuffer.set(new StaticDataBuffer(fmt, soundData->getData(), soundData->getSize(), soundData->getSampleRate()));
+	staticBuffer.set(new StaticDataBuffer(fmt, soundData->getData(), (ALsizei) soundData->getSize(), soundData->getSampleRate()));
 
 
 	// The buffer has a +2 retain count right now, but we want it to have +1.
 	// The buffer has a +2 retain count right now, but we want it to have +1.
 	staticBuffer->release();
 	staticBuffer->release();

+ 1 - 1
src/modules/filesystem/physfs/Filesystem.cpp

@@ -373,7 +373,7 @@ FileData *Filesystem::newFileData(void *data, unsigned int size, const char *fil
 
 
 FileData *Filesystem::newFileData(const char *b64, const char *filename) const
 FileData *Filesystem::newFileData(const char *b64, const char *filename) const
 {
 {
-	int size = strlen(b64);
+	int size = (int) strlen(b64);
 	int outsize = 0;
 	int outsize = 0;
 	char *dst = b64_decode(b64, size, outsize);
 	char *dst = b64_decode(b64, size, outsize);
 	FileData *fd = new FileData(outsize, std::string(filename));
 	FileData *fd = new FileData(outsize, std::string(filename));

+ 2 - 2
src/modules/font/BMFontRasterizer.cpp

@@ -143,7 +143,7 @@ BMFontRasterizer::BMFontRasterizer(love::filesystem::FileData *fontdef, const st
 		fontFolder = filename.substr(0, separatorpos);
 		fontFolder = filename.substr(0, separatorpos);
 
 
 	// The parseConfig function will try to load any missing page images.
 	// The parseConfig function will try to load any missing page images.
-	for (size_t i = 0; i < imagelist.size(); i++)
+	for (int i = 0; i < (int) imagelist.size(); i++)
 		images[i] = imagelist[i];
 		images[i] = imagelist[i];
 
 
 	std::string configtext((const char *) fontdef->getData(), fontdef->getSize());
 	std::string configtext((const char *) fontdef->getData(), fontdef->getSize());
@@ -178,7 +178,7 @@ void BMFontRasterizer::parseConfig(const std::string &configtext)
 		}
 		}
 		else if (tag == "page")
 		else if (tag == "page")
 		{
 		{
-			size_t pageindex = (size_t) cline.getAttributeInt("id");
+			int pageindex = cline.getAttributeInt("id");
 			std::string filename = cline.getAttributeString("file");
 			std::string filename = cline.getAttributeString("file");
 
 
 			// The file name is relative to the font file's folder.
 			// The file name is relative to the font file's folder.

+ 1 - 1
src/modules/font/Font.cpp

@@ -73,7 +73,7 @@ Rasterizer *Font::newImageRasterizer(love::image::ImageData *data, const std::st
 		throw love::Exception("UTF-8 decoding error: %s", e.what());
 		throw love::Exception("UTF-8 decoding error: %s", e.what());
 	}
 	}
 
 
-	return newImageRasterizer(data, &glyphs[0], glyphs.size());
+	return newImageRasterizer(data, &glyphs[0], (int) glyphs.size());
 }
 }
 
 
 Rasterizer *Font::newImageRasterizer(love::image::ImageData *data, uint32 *glyphs, int numglyphs)
 Rasterizer *Font::newImageRasterizer(love::image::ImageData *data, uint32 *glyphs, int numglyphs)

+ 6 - 6
src/modules/font/freetype/TrueTypeRasterizer.cpp

@@ -53,10 +53,10 @@ TrueTypeRasterizer::TrueTypeRasterizer(FT_Library library, love::Data *data, int
 
 
 	// Set global metrics
 	// Set global metrics
 	FT_Size_Metrics s = face->size->metrics;
 	FT_Size_Metrics s = face->size->metrics;
-	metrics.advance = s.max_advance >> 6;
-	metrics.ascent = s.ascender >> 6;
-	metrics.descent = s.descender >> 6;
-	metrics.height = s.height >> 6;
+	metrics.advance = (int) (s.max_advance >> 6);
+	metrics.ascent  = (int) (s.ascender >> 6);
+	metrics.descent = (int) (s.descender >> 6);
+	metrics.height  = (int) (s.height >> 6);
 }
 }
 
 
 TrueTypeRasterizer::~TrueTypeRasterizer()
 TrueTypeRasterizer::~TrueTypeRasterizer()
@@ -100,7 +100,7 @@ GlyphData *TrueTypeRasterizer::getGlyphData(uint32 glyph) const
 	glyphMetrics.bearingY = bitmap_glyph->top;
 	glyphMetrics.bearingY = bitmap_glyph->top;
 	glyphMetrics.height = bitmap.rows;
 	glyphMetrics.height = bitmap.rows;
 	glyphMetrics.width = bitmap.width;
 	glyphMetrics.width = bitmap.width;
-	glyphMetrics.advance = ftglyph->advance.x >> 16;
+	glyphMetrics.advance = (int) (ftglyph->advance.x >> 16);
 
 
 	GlyphData *glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_LUMINANCE_ALPHA);
 	GlyphData *glyphData = new GlyphData(glyph, glyphMetrics, GlyphData::FORMAT_LUMINANCE_ALPHA);
 
 
@@ -151,7 +151,7 @@ GlyphData *TrueTypeRasterizer::getGlyphData(uint32 glyph) const
 
 
 int TrueTypeRasterizer::getGlyphCount() const
 int TrueTypeRasterizer::getGlyphCount() const
 {
 {
-	return face->num_glyphs;
+	return (int) face->num_glyphs;
 }
 }
 
 
 bool TrueTypeRasterizer::hasGlyph(uint32 glyph) const
 bool TrueTypeRasterizer::hasGlyph(uint32 glyph) const

+ 4 - 4
src/modules/graphics/opengl/Canvas.cpp

@@ -206,7 +206,7 @@ struct FramebufferStrategyCorePacked : public FramebufferStrategy
 		drawbuffers.push_back(GL_COLOR_ATTACHMENT0);
 		drawbuffers.push_back(GL_COLOR_ATTACHMENT0);
 
 
 		// Attach the canvas textures to the currently bound framebuffer.
 		// Attach the canvas textures to the currently bound framebuffer.
-		for (size_t i = 0; i < canvases.size(); i++)
+		for (int i = 0; i < (int) canvases.size(); i++)
 		{
 		{
 			glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1 + i,
 			glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1 + i,
 				GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0);
 				GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0);
@@ -214,7 +214,7 @@ struct FramebufferStrategyCorePacked : public FramebufferStrategy
 		}
 		}
 
 
 		// set up multiple render targets
 		// set up multiple render targets
-		glDrawBuffers(drawbuffers.size(), &drawbuffers[0]);
+		glDrawBuffers((int) drawbuffers.size(), &drawbuffers[0]);
 	}
 	}
 };
 };
 
 
@@ -364,7 +364,7 @@ struct FramebufferStrategyPackedEXT : public FramebufferStrategy
 		drawbuffers.push_back(GL_COLOR_ATTACHMENT0_EXT);
 		drawbuffers.push_back(GL_COLOR_ATTACHMENT0_EXT);
 
 
 		// Attach the canvas textures to the currently bound framebuffer.
 		// Attach the canvas textures to the currently bound framebuffer.
-		for (size_t i = 0; i < canvases.size(); i++)
+		for (int i = 0; i < (int) canvases.size(); i++)
 		{
 		{
 			glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1_EXT + i,
 			glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1_EXT + i,
 								   GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0);
 								   GL_TEXTURE_2D, canvases[i]->getGLTexture(), 0);
@@ -372,7 +372,7 @@ struct FramebufferStrategyPackedEXT : public FramebufferStrategy
 		}
 		}
 
 
 		// set up multiple render targets
 		// set up multiple render targets
-		glDrawBuffers(drawbuffers.size(), &drawbuffers[0]);
+		glDrawBuffers((int) drawbuffers.size(), &drawbuffers[0]);
 	}
 	}
 };
 };
 
 

+ 1 - 1
src/modules/graphics/opengl/Font.cpp

@@ -457,7 +457,7 @@ std::vector<Font::DrawCommand> Font::generateVerticesFormatted(const std::string
 			offset.x = floorf((wrap - width) / 2.0f);
 			offset.x = floorf((wrap - width) / 2.0f);
 			break;
 			break;
 		case ALIGN_JUSTIFY:
 		case ALIGN_JUSTIFY:
-			numspaces = std::count(line.begin(), line.end(), ' ');
+			numspaces = (int) std::count(line.begin(), line.end(), ' ');
 			if (wrappedlines[i] && numspaces >= 1)
 			if (wrappedlines[i] && numspaces >= 1)
 				extraspacing = (wrap - width) / float(numspaces);
 				extraspacing = (wrap - width) / float(numspaces);
 			else
 			else

+ 1 - 1
src/modules/graphics/opengl/Graphics.cpp

@@ -1150,7 +1150,7 @@ void Graphics::polygon(DrawMode mode, const float *coords, size_t count)
 		gl.bindTexture(gl.getDefaultTexture());
 		gl.bindTexture(gl.getDefaultTexture());
 		glEnableVertexAttribArray(ATTRIB_POS);
 		glEnableVertexAttribArray(ATTRIB_POS);
 		glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, coords);
 		glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, coords);
-		gl.drawArrays(GL_TRIANGLE_FAN, 0, count/2-1); // opengl will close the polygon for us
+		gl.drawArrays(GL_TRIANGLE_FAN, 0, (int)count/2-1); // opengl will close the polygon for us
 		glDisableVertexAttribArray(ATTRIB_POS);
 		glDisableVertexAttribArray(ATTRIB_POS);
 	}
 	}
 }
 }

+ 2 - 2
src/modules/graphics/opengl/Mesh.cpp

@@ -358,7 +358,7 @@ void Mesh::draw(float x, float y, float angle, float sx, float sy, float ox, flo
 		// Make sure the index buffer isn't mapped (sends data to GPU if needed.)
 		// Make sure the index buffer isn't mapped (sends data to GPU if needed.)
 		ibo->unmap();
 		ibo->unmap();
 
 
-		int max = element_count - 1;
+		int max = (int) element_count - 1;
 		if (range_max >= 0)
 		if (range_max >= 0)
 			max = std::min(range_max, max);
 			max = std::min(range_max, max);
 
 
@@ -373,7 +373,7 @@ void Mesh::draw(float x, float y, float angle, float sx, float sy, float ox, flo
 	}
 	}
 	else
 	else
 	{
 	{
-		int max = vertex_count - 1;
+		int max = (int) vertex_count - 1;
 		if (range_max >= 0)
 		if (range_max >= 0)
 			max = std::min(range_max, max);
 			max = std::min(range_max, max);
 
 

+ 1 - 1
src/modules/graphics/opengl/OpenGL.cpp

@@ -116,7 +116,7 @@ void OpenGL::setupContext()
 	state.curTextureUnit = (int) curgltextureunit - GL_TEXTURE0;
 	state.curTextureUnit = (int) curgltextureunit - GL_TEXTURE0;
 
 
 	// Retrieve currently bound textures for each texture unit.
 	// Retrieve currently bound textures for each texture unit.
-	for (size_t i = 0; i < state.textureUnits.size(); i++)
+	for (int i = 0; i < (int) state.textureUnits.size(); i++)
 	{
 	{
 		glActiveTexture(GL_TEXTURE0 + i);
 		glActiveTexture(GL_TEXTURE0 + i);
 		glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &state.textureUnits[i]);
 		glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &state.textureUnits[i]);

+ 2 - 2
src/modules/graphics/opengl/ParticleSystem.cpp

@@ -889,7 +889,7 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
 
 
 	{
 	{
 		VertexBuffer::Bind ibo_bind(*ibo.getVertexBuffer());
 		VertexBuffer::Bind ibo_bind(*ibo.getVertexBuffer());
-		gl.drawElements(GL_TRIANGLES, ibo.getIndexCount(pCount), ibo.getType(), ibo.getPointer(0));
+		gl.drawElements(GL_TRIANGLES, (GLsizei) ibo.getIndexCount(pCount), ibo.getType(), ibo.getPointer(0));
 	}
 	}
 
 
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
@@ -990,7 +990,7 @@ void ParticleSystem::update(float dt)
 			{
 			{
 				s = t * (float) k; // [0:numquads-1] (clamped below)
 				s = t * (float) k; // [0:numquads-1] (clamped below)
 				i = (s > 0.0f) ? (size_t) s : 0;
 				i = (s > 0.0f) ? (size_t) s : 0;
-				p->quadIndex = (i < k) ? i : k - 1;
+				p->quadIndex = (int) ((i < k) ? i : k - 1);
 			}
 			}
 
 
 			// Next particle.
 			// Next particle.

+ 4 - 4
src/modules/graphics/opengl/Polyline.cpp

@@ -369,9 +369,9 @@ void Polyline::draw()
 	glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, vertices);
 	glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, vertices);
 
 
 	if (use_quad_indices)
 	if (use_quad_indices)
-		gl.drawElements(draw_mode, (vertex_count / 4) * 6, GL_UNSIGNED_SHORT, indices);
+		gl.drawElements(draw_mode, (int) (vertex_count / 4) * 6, GL_UNSIGNED_SHORT, indices);
 	else
 	else
-		gl.drawArrays(draw_mode, 0, vertex_count);
+		gl.drawArrays(draw_mode, 0, (int) vertex_count);
 
 
 	if (overdraw)
 	if (overdraw)
 	{
 	{
@@ -385,9 +385,9 @@ void Polyline::draw()
 		glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, overdraw);
 		glVertexAttribPointer(ATTRIB_POS, 2, GL_FLOAT, GL_FALSE, 0, overdraw);
 
 
 		if (use_quad_indices)
 		if (use_quad_indices)
-			gl.drawElements(draw_mode, (overdraw_vertex_count / 4) * 6, GL_UNSIGNED_SHORT, indices);
+			gl.drawElements(draw_mode, (int) (overdraw_vertex_count / 4) * 6, GL_UNSIGNED_SHORT, indices);
 		else
 		else
-			gl.drawArrays(draw_mode, 0, overdraw_vertex_count);
+			gl.drawArrays(draw_mode, 0, (int) overdraw_vertex_count);
 
 
 		glDisableVertexAttribArray(ATTRIB_COLOR);
 		glDisableVertexAttribArray(ATTRIB_COLOR);
 
 

+ 3 - 3
src/modules/graphics/opengl/Shader.cpp

@@ -401,7 +401,7 @@ void Shader::attach(bool temporary)
 		for (size_t i = 0; i < activeTexUnits.size(); ++i)
 		for (size_t i = 0; i < activeTexUnits.size(); ++i)
 		{
 		{
 			if (activeTexUnits[i] > 0)
 			if (activeTexUnits[i] > 0)
-				gl.bindTextureToUnit(activeTexUnits[i], i + 1, false);
+				gl.bindTextureToUnit(activeTexUnits[i], (int) i + 1, false);
 		}
 		}
 
 
 		// We always want to use texture unit 0 for everyhing else.
 		// We always want to use texture unit 0 for everyhing else.
@@ -589,7 +589,7 @@ int Shader::getTextureUnit(const std::string &name)
 	if (freeunit_it != textureCounters.end())
 	if (freeunit_it != textureCounters.end())
 	{
 	{
 		// we don't want to use unit 0
 		// we don't want to use unit 0
-		texunit = std::distance(textureCounters.begin(), freeunit_it) + 1;
+		texunit = (int) std::distance(textureCounters.begin(), freeunit_it) + 1;
 	}
 	}
 	else
 	else
 	{
 	{
@@ -600,7 +600,7 @@ int Shader::getTextureUnit(const std::string &name)
 			throw love::Exception("No more texture units available for shader.");
 			throw love::Exception("No more texture units available for shader.");
 
 
 		// we don't want to use unit 0
 		// we don't want to use unit 0
-		texunit = std::distance(activeTexUnits.begin(), nextunit_it) + 1;
+		texunit = (int) std::distance(activeTexUnits.begin(), nextunit_it) + 1;
 	}
 	}
 
 
 	texUnitPool[name] = texunit;
 	texUnitPool[name] = texunit;

+ 1 - 1
src/modules/graphics/opengl/SpriteBatch.cpp

@@ -263,7 +263,7 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
 	glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), array_buf->getPointer(texel_offset));
 	glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), array_buf->getPointer(texel_offset));
 
 
 	gl.prepareDraw();
 	gl.prepareDraw();
-	gl.drawElements(GL_TRIANGLES, element_buf.getIndexCount(next), element_buf.getType(), element_buf.getPointer(0));
+	gl.drawElements(GL_TRIANGLES, (GLsizei) element_buf.getIndexCount(next), element_buf.getType(), element_buf.getPointer(0));
 
 
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
 	glDisableVertexAttribArray(ATTRIB_TEXCOORD);
 	glDisableVertexAttribArray(ATTRIB_POS);
 	glDisableVertexAttribArray(ATTRIB_POS);

+ 6 - 6
src/modules/graphics/opengl/VertexBuffer.cpp

@@ -365,13 +365,13 @@ void VertexIndex::fill()
 
 
 	for (size_t i = 0; i < maxSize; ++i)
 	for (size_t i = 0; i < maxSize; ++i)
 	{
 	{
-		indices[i*6+0] = i * 4 + 0;
-		indices[i*6+1] = i * 4 + 1;
-		indices[i*6+2] = i * 4 + 2;
+		indices[i*6+0] = T(i * 4 + 0);
+		indices[i*6+1] = T(i * 4 + 1);
+		indices[i*6+2] = T(i * 4 + 2);
 
 
-		indices[i*6+3] = i * 4 + 0;
-		indices[i*6+4] = i * 4 + 2;
-		indices[i*6+5] = i * 4 + 3;
+		indices[i*6+3] = T(i * 4 + 0);
+		indices[i*6+4] = T(i * 4 + 2);
+		indices[i*6+5] = T(i * 4 + 3);
 	}
 	}
 }
 }
 
 

+ 1 - 1
src/modules/graphics/opengl/wrap_Font.cpp

@@ -60,7 +60,7 @@ int w_Font_getWrap(lua_State *L)
 
 
 	luax_catchexcept(L, [&]() {
 	luax_catchexcept(L, [&]() {
 		t->getWrap(str, wrap, lines, &widths);
 		t->getWrap(str, wrap, lines, &widths);
-		numlines = lines.size();
+		numlines = (int) lines.size();
 	});
 	});
 
 
 	for (int width : widths)
 	for (int width : widths)

+ 4 - 4
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -526,7 +526,7 @@ int w_newMesh(lua_State *L)
 		// Get the vertices from the table.
 		// Get the vertices from the table.
 		for (size_t i = 1; i <= vertex_count; i++)
 		for (size_t i = 1; i <= vertex_count; i++)
 		{
 		{
-			lua_rawgeti(L, 1, i);
+			lua_rawgeti(L, 1, (int) i);
 
 
 			if (lua_type(L, -1) != LUA_TTABLE)
 			if (lua_type(L, -1) != LUA_TTABLE)
 				return luax_typerror(L, 1, "table of tables");
 				return luax_typerror(L, 1, "table of tables");
@@ -923,7 +923,7 @@ int w_setCanvas(lua_State *L)
 
 
 	if (is_table)
 	if (is_table)
 	{
 	{
-		for (size_t i = 1; i <= lua_objlen(L, 1); i++)
+		for (int i = 1; i <= (int) lua_objlen(L, 1); i++)
 		{
 		{
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i);
 			canvases.push_back(luax_checkcanvas(L, -1));
 			canvases.push_back(luax_checkcanvas(L, -1));
@@ -1259,7 +1259,7 @@ int w_line(lua_State *L)
 	bool is_table = false;
 	bool is_table = false;
 	if (args == 1 && lua_istable(L, 1))
 	if (args == 1 && lua_istable(L, 1))
 	{
 	{
-		args = lua_objlen(L, 1);
+		args = (int) lua_objlen(L, 1);
 		is_table = true;
 		is_table = true;
 	}
 	}
 
 
@@ -1360,7 +1360,7 @@ int w_polygon(lua_State *L)
 	float *coords;
 	float *coords;
 	if (args == 1 && lua_istable(L, 2))
 	if (args == 1 && lua_istable(L, 2))
 	{
 	{
-		args = lua_objlen(L, 2);
+		args = (int) lua_objlen(L, 2);
 		is_table = true;
 		is_table = true;
 	}
 	}
 
 

+ 7 - 7
src/modules/graphics/opengl/wrap_Mesh.cpp

@@ -102,12 +102,12 @@ int w_Mesh_setVertices(lua_State *L)
 {
 {
 	Mesh *t = luax_checkmesh(L, 1);
 	Mesh *t = luax_checkmesh(L, 1);
 
 
-	size_t vertex_count = lua_objlen(L, 2);
+	int vertex_count = (int) lua_objlen(L, 2);
 	std::vector<Vertex> vertices;
 	std::vector<Vertex> vertices;
 	vertices.reserve(vertex_count);
 	vertices.reserve(vertex_count);
 
 
 	// Get the vertices from the table.
 	// Get the vertices from the table.
-	for (size_t i = 1; i <= vertex_count; i++)
+	for (int i = 1; i <= vertex_count; i++)
 	{
 	{
 		lua_rawgeti(L, 2, i);
 		lua_rawgeti(L, 2, i);
 
 
@@ -144,13 +144,13 @@ int w_Mesh_getVertices(lua_State *L)
 
 
 	const Vertex *vertices = t->getVertices();
 	const Vertex *vertices = t->getVertices();
 
 
-	size_t count = t->getVertexCount();
+	int count = (int) t->getVertexCount();
 	lua_createtable(L, count, 0);
 	lua_createtable(L, count, 0);
 
 
 	if (count == 0 || vertices == nullptr)
 	if (count == 0 || vertices == nullptr)
 		return 1;
 		return 1;
 
 
-	for (size_t i = 0; i < count; i++)
+	for (int i = 0; i < count; i++)
 	{
 	{
 		// Create vertex table.
 		// Create vertex table.
 		lua_createtable(L, 8, 0);
 		lua_createtable(L, 8, 0);
@@ -199,7 +199,7 @@ int w_Mesh_setVertexMap(lua_State *L)
 	Mesh *t = luax_checkmesh(L, 1);
 	Mesh *t = luax_checkmesh(L, 1);
 
 
 	bool is_table = lua_istable(L, 2);
 	bool is_table = lua_istable(L, 2);
-	int nargs = is_table ? lua_objlen(L, 2) : lua_gettop(L) - 1;
+	int nargs = is_table ? (int) lua_objlen(L, 2) : lua_gettop(L) - 1;
 
 
 	std::vector<uint32> vertexmap;
 	std::vector<uint32> vertexmap;
 	vertexmap.reserve(nargs);
 	vertexmap.reserve(nargs);
@@ -227,11 +227,11 @@ int w_Mesh_getVertexMap(lua_State *L)
 	std::vector<uint32> vertex_map;
 	std::vector<uint32> vertex_map;
 	luax_catchexcept(L, [&](){ t->getVertexMap(vertex_map); });
 	luax_catchexcept(L, [&](){ t->getVertexMap(vertex_map); });
 
 
-	size_t element_count = vertex_map.size();
+	int element_count = (int) vertex_map.size();
 
 
 	lua_createtable(L, element_count, 0);
 	lua_createtable(L, element_count, 0);
 
 
-	for (size_t i = 0; i < element_count; i++)
+	for (int i = 0; i < element_count; i++)
 	{
 	{
 		lua_pushinteger(L, lua_Integer(vertex_map[i]) + 1);
 		lua_pushinteger(L, lua_Integer(vertex_map[i]) + 1);
 		lua_rawseti(L, -2, i + 1);
 		lua_rawseti(L, -2, i + 1);

+ 9 - 9
src/modules/graphics/opengl/wrap_ParticleSystem.cpp

@@ -381,7 +381,7 @@ int w_ParticleSystem_setSizes(lua_State *L)
 	{
 	{
 		std::vector<float> sizes(nSizes);
 		std::vector<float> sizes(nSizes);
 		for (size_t i = 0; i < nSizes; ++i)
 		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);
 		t->setSizes(sizes);
 	}
 	}
@@ -396,7 +396,7 @@ int w_ParticleSystem_getSizes(lua_State *L)
 	for (size_t i = 0; i < sizes.size(); i++)
 	for (size_t i = 0; i < sizes.size(); i++)
 		lua_pushnumber(L, sizes[i]);
 		lua_pushnumber(L, sizes[i]);
 
 
-	return sizes.size();
+	return (int) sizes.size();
 }
 }
 
 
 int w_ParticleSystem_setSizeVariation(lua_State *L)
 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}, ...)
 	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)
 		if (nColors > 8)
 			return luaL_error(L, "At most eight (8) colors may be used.");
 			return luaL_error(L, "At most eight (8) colors may be used.");
 
 
 		std::vector<Color> colors(nColors);
 		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);
 			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, ...)
 	else // setColors(r,g,b,a, r,g,b,a, ...)
 	{
 	{
 		int cargs = lua_gettop(L) - 1;
 		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))
 		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);
 			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
 		else
 		{
 		{
 			std::vector<Color> colors(nColors);
 			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 r = (unsigned char) luaL_checkinteger(L, 1 + i*4 + 1);
 				unsigned char g = (unsigned char) luaL_checkinteger(L, 1 + i*4 + 2);
 				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);
 		lua_rawseti(L, -2, 4);
 	}
 	}
 
 
-	return colors.size();
+	return (int) colors.size();
 }
 }
 
 
 int w_ParticleSystem_setQuads(lua_State *L)
 int w_ParticleSystem_setQuads(lua_State *L)
@@ -592,7 +592,7 @@ int w_ParticleSystem_setQuads(lua_State *L)
 
 
 	if (lua_istable(L, 2))
 	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);
 			lua_rawgeti(L, 2, i);
 
 
@@ -622,7 +622,7 @@ int w_ParticleSystem_getQuads(lua_State *L)
 
 
 	lua_createtable(L, (int) quads.size(), 0);
 	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]);
 		luax_pushtype(L, "Quad", GRAPHICS_QUAD_T, quads[i]);
 		lua_rawseti(L, -2, i + 1);
 		lua_rawseti(L, -2, i + 1);

+ 8 - 8
src/modules/graphics/opengl/wrap_Shader.cpp

@@ -87,7 +87,7 @@ static T *_getVectors(lua_State *L, int count, size_t &dimension)
 			return 0;
 			return 0;
 		}
 		}
 
 
-		for (size_t k = 1; k <= dimension; ++k)
+		for (int k = 1; k <= (int) dimension; ++k)
 		{
 		{
 			lua_rawgeti(L, 3 + i, k);
 			lua_rawgeti(L, 3 + i, k);
 			if (lua_isnumber(L, -1))
 			if (lua_isnumber(L, -1))
@@ -132,7 +132,7 @@ int w_Shader_sendInt(lua_State *L)
 	bool should_error = false;
 	bool should_error = false;
 	try
 	try
 	{
 	{
-		shader->sendInt(name, dimension, values, count);
+		shader->sendInt(name, (int) dimension, values, count);
 	}
 	}
 	catch (love::Exception &e)
 	catch (love::Exception &e)
 	{
 	{
@@ -173,7 +173,7 @@ int w_Shader_sendFloat(lua_State *L)
 	bool should_error = false;
 	bool should_error = false;
 	try
 	try
 	{
 	{
-		shader->sendFloat(name, dimension, values, count);
+		shader->sendFloat(name, (int) dimension, values, count);
 	}
 	}
 	catch (love::Exception &e)
 	catch (love::Exception &e)
 	{
 	{
@@ -199,7 +199,7 @@ int w_Shader_sendMatrix(lua_State *L)
 		return luax_typerror(L, 3, "matrix table");
 		return luax_typerror(L, 3, "matrix table");
 
 
 	lua_getfield(L, 3, "dimension");
 	lua_getfield(L, 3, "dimension");
-	int dimension = lua_tointeger(L, -1);
+	int dimension = (int) lua_tointeger(L, -1);
 	lua_pop(L, 1);
 	lua_pop(L, 1);
 
 
 	if (dimension < 2 || dimension > 4)
 	if (dimension < 2 || dimension > 4)
@@ -217,7 +217,7 @@ int w_Shader_sendMatrix(lua_State *L)
 			// a dimension of mind. You're moving into a land of both shadow
 			// a dimension of mind. You're moving into a land of both shadow
 			// and substance, of things and ideas. You've just crossed over
 			// and substance, of things and ideas. You've just crossed over
 			// into... the Twilight Zone.
 			// into... the Twilight Zone.
-			int other_dimension = lua_tointeger(L, -1);
+			int other_dimension = (int) lua_tointeger(L, -1);
 			delete[] values;
 			delete[] values;
 			return luaL_error(L, "Invalid matrix size at argument %d: Expected size %dx%d, got %dx%d.",
 			return luaL_error(L, "Invalid matrix size at argument %d: Expected size %dx%d, got %dx%d.",
 							  3+i, dimension, dimension, other_dimension, other_dimension);
 							  3+i, dimension, dimension, other_dimension, other_dimension);
@@ -258,19 +258,19 @@ static void w_convertMatrices(lua_State *L, int idx)
 	for (int matrix = idx; matrix < idx + matrixcount; matrix++)
 	for (int matrix = idx; matrix < idx + matrixcount; matrix++)
 	{
 	{
 		luaL_checktype(L, matrix, LUA_TTABLE);
 		luaL_checktype(L, matrix, LUA_TTABLE);
-		int dimension = lua_objlen(L, matrix);
+		int dimension = (int) lua_objlen(L, matrix);
 
 
 		int newi = 1;
 		int newi = 1;
 		lua_createtable(L, dimension * dimension, 0);
 		lua_createtable(L, dimension * dimension, 0);
 
 
 		// Collapse {{a,b,c}, {d,e,f}, ...} to {a,b,c, d,e,f, ...}
 		// Collapse {{a,b,c}, {d,e,f}, ...} to {a,b,c, d,e,f, ...}
-		for (size_t i = 1; i <= lua_objlen(L, matrix); i++)
+		for (int i = 1; i <= (int) lua_objlen(L, matrix); i++)
 		{
 		{
 			// Push args[matrix][i] onto the stack.
 			// Push args[matrix][i] onto the stack.
 			lua_rawgeti(L, matrix, i);
 			lua_rawgeti(L, matrix, i);
 			luaL_checktype(L, -1, LUA_TTABLE);
 			luaL_checktype(L, -1, LUA_TTABLE);
 
 
-			for (size_t j = 1; j <= lua_objlen(L, -1); j++)
+			for (int j = 1; j <= (int) lua_objlen(L, -1); j++)
 			{
 			{
 				// Push args[matrix[i][j] onto the stack.
 				// Push args[matrix[i][j] onto the stack.
 				lua_rawgeti(L, -1, j);
 				lua_rawgeti(L, -1, j);

+ 1 - 1
src/modules/graphics/opengl/wrap_SpriteBatch.cpp

@@ -78,7 +78,7 @@ int w_SpriteBatch_add(lua_State *L)
 int w_SpriteBatch_set(lua_State *L)
 int w_SpriteBatch_set(lua_State *L)
 {
 {
 	SpriteBatch *t = luax_checkspritebatch(L, 1);
 	SpriteBatch *t = luax_checkspritebatch(L, 1);
-	int id = luaL_checkinteger(L, 2);
+	int id = luaL_checkint(L, 2);
 
 
 	Quad *quad = nullptr;
 	Quad *quad = nullptr;
 	int startidx = 3;
 	int startidx = 3;

+ 1 - 1
src/modules/image/CompressedData.cpp

@@ -49,7 +49,7 @@ void *CompressedData::getData() const
 
 
 int CompressedData::getMipmapCount() const
 int CompressedData::getMipmapCount() const
 {
 {
-	return dataImages.size();
+	return (int) dataImages.size();
 }
 }
 
 
 size_t CompressedData::getSize(int miplevel) const
 size_t CompressedData::getSize(int miplevel) const

+ 2 - 2
src/modules/image/magpie/ImageIOHandler.cpp

@@ -129,8 +129,8 @@ ImageIOHandler::DecodedImage ImageIOHandler::decode(love::filesystem::FileData *
 	if (!image)
 	if (!image)
 		throw love::Exception("Could not decode image!");
 		throw love::Exception("Could not decode image!");
 
 
-	img.width = CGImageGetWidth(image);
-	img.height = CGImageGetHeight(image);
+	img.width  = (int) CGImageGetWidth(image);
+	img.height = (int) CGImageGetHeight(image);
 
 
 	CGImageAlphaInfo alphainfo = CGImageGetAlphaInfo(image);
 	CGImageAlphaInfo alphainfo = CGImageGetAlphaInfo(image);
 
 

+ 3 - 3
src/modules/image/wrap_CompressedData.cpp

@@ -34,7 +34,7 @@ CompressedData *luax_checkcompresseddata(lua_State *L, int idx)
 int w_CompressedData_getWidth(lua_State *L)
 int w_CompressedData_getWidth(lua_State *L)
 {
 {
 	CompressedData *t = luax_checkcompresseddata(L, 1);
 	CompressedData *t = luax_checkcompresseddata(L, 1);
-	int miplevel = luaL_optinteger(L, 2, 1);
+	int miplevel = luaL_optint(L, 2, 1);
 	int width = 0;
 	int width = 0;
 
 
 	luax_catchexcept(L, [&](){ width = t->getWidth(miplevel - 1); });
 	luax_catchexcept(L, [&](){ width = t->getWidth(miplevel - 1); });
@@ -46,7 +46,7 @@ int w_CompressedData_getWidth(lua_State *L)
 int w_CompressedData_getHeight(lua_State *L)
 int w_CompressedData_getHeight(lua_State *L)
 {
 {
 	CompressedData *t = luax_checkcompresseddata(L, 1);
 	CompressedData *t = luax_checkcompresseddata(L, 1);
-	int miplevel = luaL_optinteger(L, 2, 1);
+	int miplevel = luaL_optint(L, 2, 1);
 	int height = 0;
 	int height = 0;
 
 
 	luax_catchexcept(L, [&](){ height = t->getHeight(miplevel - 1); });
 	luax_catchexcept(L, [&](){ height = t->getHeight(miplevel - 1); });
@@ -58,7 +58,7 @@ int w_CompressedData_getHeight(lua_State *L)
 int w_CompressedData_getDimensions(lua_State *L)
 int w_CompressedData_getDimensions(lua_State *L)
 {
 {
 	CompressedData *t = luax_checkcompresseddata(L, 1);
 	CompressedData *t = luax_checkcompresseddata(L, 1);
-	int miplevel = luaL_optinteger(L, 2, 1);
+	int miplevel = luaL_optint(L, 2, 1);
 	int width = 0, height = 0;
 	int width = 0, height = 0;
 
 
 	luax_catchexcept(L, [&]()
 	luax_catchexcept(L, [&]()

+ 2 - 2
src/modules/joystick/sdl/JoystickModule.cpp

@@ -84,7 +84,7 @@ love::joystick::Joystick *JoystickModule::getJoystick(int joyindex)
 
 
 int JoystickModule::getIndex(const love::joystick::Joystick *joystick)
 int JoystickModule::getIndex(const love::joystick::Joystick *joystick)
 {
 {
-	for (size_t i = 0; i < activeSticks.size(); i++)
+	for (int i = 0; i < (int) activeSticks.size(); i++)
 	{
 	{
 		if (activeSticks[i] == joystick)
 		if (activeSticks[i] == joystick)
 			return i;
 			return i;
@@ -132,7 +132,7 @@ love::joystick::Joystick *JoystickModule::addJoystick(int deviceindex)
 
 
 	if (!joystick)
 	if (!joystick)
 	{
 	{
-		joystick = new Joystick(joysticks.size());
+		joystick = new Joystick((int) joysticks.size());
 		joysticks.push_back(joystick);
 		joysticks.push_back(joystick);
 	}
 	}
 
 

+ 1 - 1
src/modules/math/BezierCurve.cpp

@@ -174,7 +174,7 @@ Vector BezierCurve::evaluate(double t) const
 	return points[0];
 	return points[0];
 }
 }
 
 
-vector<Vector> BezierCurve::render(size_t accuracy) const
+vector<Vector> BezierCurve::render(int accuracy) const
 {
 {
 	if (controlPoints.size() < 2)
 	if (controlPoints.size() < 2)
 		throw Exception("Invalid Bezier curve: Not enough control points.");
 		throw Exception("Invalid Bezier curve: Not enough control points.");

+ 1 - 1
src/modules/math/BezierCurve.h

@@ -112,7 +112,7 @@ public:
 	 * @param accuracy The 'fineness' of the curve.
 	 * @param accuracy The 'fineness' of the curve.
 	 * @returns A polygon chain that approximates the bezier curve.
 	 * @returns A polygon chain that approximates the bezier curve.
 	 **/
 	 **/
-	std::vector<Vector> render(size_t accuracy = 4) const;
+	std::vector<Vector> render(int accuracy = 4) const;
 
 
 private:
 private:
 	std::vector<Vector> controlPoints;
 	std::vector<Vector> controlPoints;

+ 6 - 6
src/modules/math/wrap_BezierCurve.cpp

@@ -52,7 +52,7 @@ int w_BezierCurve_getDerivative(lua_State *L)
 int w_BezierCurve_getControlPoint(lua_State *L)
 int w_BezierCurve_getControlPoint(lua_State *L)
 {
 {
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
-	int idx = luaL_checkinteger(L, 2);
+	int idx = luaL_checkint(L, 2);
 
 
 	if (idx > 0) // 1-indexing
 	if (idx > 0) // 1-indexing
 		idx--;
 		idx--;
@@ -69,7 +69,7 @@ int w_BezierCurve_getControlPoint(lua_State *L)
 int w_BezierCurve_setControlPoint(lua_State *L)
 int w_BezierCurve_setControlPoint(lua_State *L)
 {
 {
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
-	int idx = luaL_checkinteger(L, 2);
+	int idx = luaL_checkint(L, 2);
 	float vx = (float) luaL_checknumber(L, 3);
 	float vx = (float) luaL_checknumber(L, 3);
 	float vy = (float) luaL_checknumber(L, 4);
 	float vy = (float) luaL_checknumber(L, 4);
 
 
@@ -85,7 +85,7 @@ int w_BezierCurve_insertControlPoint(lua_State *L)
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
 	float vx = (float) luaL_checknumber(L, 2);
 	float vx = (float) luaL_checknumber(L, 2);
 	float vy = (float) luaL_checknumber(L, 3);
 	float vy = (float) luaL_checknumber(L, 3);
-	int idx = luaL_optinteger(L, 4, -1);
+	int idx = luaL_optint(L, 4, -1);
 
 
 	if (idx > 0) // 1-indexing
 	if (idx > 0) // 1-indexing
 		idx--;
 		idx--;
@@ -148,13 +148,13 @@ int w_BezierCurve_evaluate(lua_State *L)
 int w_BezierCurve_render(lua_State *L)
 int w_BezierCurve_render(lua_State *L)
 {
 {
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
 	BezierCurve *curve = luax_checkbeziercurve(L, 1);
-	int accuracy = luaL_optinteger(L, 2, 5);
+	int accuracy = luaL_optint(L, 2, 5);
 
 
 	std::vector<Vector> points;
 	std::vector<Vector> points;
 	luax_catchexcept(L, [&](){ points = curve->render(accuracy); });
 	luax_catchexcept(L, [&](){ points = curve->render(accuracy); });
 
 
-	lua_createtable(L, points.size()*2, 0);
-	for (size_t i = 0; i < points.size(); ++i)
+	lua_createtable(L, (int) points.size() * 2, 0);
+	for (int i = 0; i < (int) points.size(); ++i)
 	{
 	{
 		lua_pushnumber(L, points[i].x);
 		lua_pushnumber(L, points[i].x);
 		lua_rawseti(L, -2, 2*i+1);
 		lua_rawseti(L, -2, 2*i+1);

+ 13 - 13
src/modules/math/wrap_Math.cpp

@@ -110,9 +110,9 @@ int w_newBezierCurve(lua_State *L)
 	std::vector<Vector> points;
 	std::vector<Vector> points;
 	if (lua_istable(L, 1))
 	if (lua_istable(L, 1))
 	{
 	{
-		size_t top = lua_objlen(L, 1);
+		int top = (int) lua_objlen(L, 1);
 		points.reserve(top / 2);
 		points.reserve(top / 2);
-		for (size_t i = 1; i <= top; i += 2)
+		for (int i = 1; i <= top; i += 2)
 		{
 		{
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i+1);
 			lua_rawgeti(L, 1, i+1);
@@ -127,9 +127,9 @@ int w_newBezierCurve(lua_State *L)
 	}
 	}
 	else
 	else
 	{
 	{
-		size_t top = lua_gettop(L);
+		int top = (int) lua_gettop(L);
 		points.reserve(top / 2);
 		points.reserve(top / 2);
-		for (size_t i = 1; i <= top; i += 2)
+		for (int i = 1; i <= top; i += 2)
 		{
 		{
 			Vector v;
 			Vector v;
 			v.x = (float) luaL_checknumber(L, i);
 			v.x = (float) luaL_checknumber(L, i);
@@ -149,9 +149,9 @@ int w_triangulate(lua_State *L)
 	std::vector<Vertex> vertices;
 	std::vector<Vertex> vertices;
 	if (lua_istable(L, 1))
 	if (lua_istable(L, 1))
 	{
 	{
-		size_t top = lua_objlen(L, 1);
+		int top = (int) lua_objlen(L, 1);
 		vertices.reserve(top / 2);
 		vertices.reserve(top / 2);
-		for (size_t i = 1; i <= top; i += 2)
+		for (int i = 1; i <= top; i += 2)
 		{
 		{
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i+1);
 			lua_rawgeti(L, 1, i+1);
@@ -166,9 +166,9 @@ int w_triangulate(lua_State *L)
 	}
 	}
 	else
 	else
 	{
 	{
-		size_t top = lua_gettop(L);
+		int top = (int) lua_gettop(L);
 		vertices.reserve(top / 2);
 		vertices.reserve(top / 2);
-		for (size_t i = 1; i <= top; i += 2)
+		for (int i = 1; i <= top; i += 2)
 		{
 		{
 			Vertex v;
 			Vertex v;
 			v.x = (float) luaL_checknumber(L, i);
 			v.x = (float) luaL_checknumber(L, i);
@@ -189,8 +189,8 @@ int w_triangulate(lua_State *L)
 			triangles = Math::instance.triangulate(vertices);
 			triangles = Math::instance.triangulate(vertices);
 	});
 	});
 
 
-	lua_createtable(L, triangles.size(), 0);
-	for (size_t i = 0; i < triangles.size(); ++i)
+	lua_createtable(L, (int) triangles.size(), 0);
+	for (int i = 0; i < (int) triangles.size(); ++i)
 	{
 	{
 		const Triangle &tri = triangles[i];
 		const Triangle &tri = triangles[i];
 
 
@@ -219,9 +219,9 @@ int w_isConvex(lua_State *L)
 	std::vector<Vertex> vertices;
 	std::vector<Vertex> vertices;
 	if (lua_istable(L, 1))
 	if (lua_istable(L, 1))
 	{
 	{
-		size_t top = lua_objlen(L, 1);
+		int top = (int) lua_objlen(L, 1);
 		vertices.reserve(top / 2);
 		vertices.reserve(top / 2);
-		for (size_t i = 1; i <= top; i += 2)
+		for (int i = 1; i <= top; i += 2)
 		{
 		{
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i+1);
 			lua_rawgeti(L, 1, i+1);
@@ -257,7 +257,7 @@ static int getGammaArgs(lua_State *L, float color[4])
 
 
 	if (lua_istable(L, 1))
 	if (lua_istable(L, 1))
 	{
 	{
-		int n = lua_objlen(L, 1);
+		int n = (int) lua_objlen(L, 1);
 		for (int i = 1; i <= n && i <= 4; i++)
 		for (int i = 1; i <= n && i <= 4; i++)
 		{
 		{
 			lua_rawgeti(L, 1, i);
 			lua_rawgeti(L, 1, i);

+ 3 - 3
src/modules/physics/box2d/Physics.cpp

@@ -97,7 +97,7 @@ int Physics::newPolygonShape(lua_State *L)
 	bool istable = lua_istable(L, 1);
 	bool istable = lua_istable(L, 1);
 
 
 	if (istable)
 	if (istable)
-		argc = lua_objlen(L, 1);
+		argc = (int) lua_objlen(L, 1);
 
 
 	if (argc % 2 != 0)
 	if (argc % 2 != 0)
 		return luaL_error(L, "Number of vertex components must be a multiple of two.");
 		return luaL_error(L, "Number of vertex components must be a multiple of two.");
@@ -158,12 +158,12 @@ int Physics::newChainShape(lua_State *L)
 	bool istable = lua_istable(L, 2);
 	bool istable = lua_istable(L, 2);
 
 
 	if (istable)
 	if (istable)
-		argc = lua_objlen(L, 2);
+		argc = (int) lua_objlen(L, 2);
 
 
 	if (argc % 2 != 0)
 	if (argc % 2 != 0)
 		return luaL_error(L, "Number of vertex components must be a multiple of two.");
 		return luaL_error(L, "Number of vertex components must be a multiple of two.");
 
 
-	int vcount = (int)argc/2;
+	int vcount = argc/2;
 	bool loop = luax_toboolean(L, 1);
 	bool loop = luax_toboolean(L, 1);
 	b2Vec2 *vecs = new b2Vec2[vcount];
 	b2Vec2 *vecs = new b2Vec2[vcount];
 
 

+ 1 - 1
src/modules/sound/SoundData.cpp

@@ -176,7 +176,7 @@ int SoundData::getSampleRate() const
 
 
 int SoundData::getSampleCount() const
 int SoundData::getSampleCount() const
 {
 {
-	return (size/channels)/(bitDepth/8);
+	return (int) ((size/channels)/(bitDepth/8));
 }
 }
 
 
 float SoundData::getDuration() const
 float SoundData::getDuration() const

+ 3 - 3
src/modules/sound/lullaby/VorbisDecoder.cpp

@@ -144,7 +144,7 @@ VorbisDecoder::VorbisDecoder(Data *data, const std::string &ext, int bufferSize)
 
 
 	// Initialize OGG file
 	// Initialize OGG file
 	oggFile.dataPtr = (char *) data->getData();
 	oggFile.dataPtr = (char *) data->getData();
-	oggFile.dataSize = data->getSize();
+	oggFile.dataSize = (int) data->getSize();
 	oggFile.dataRead = 0;
 	oggFile.dataRead = 0;
 
 
 	// Open Vorbis handle
 	// Open Vorbis handle
@@ -188,7 +188,7 @@ int VorbisDecoder::decode()
 
 
 	while (size < bufferSize)
 	while (size < bufferSize)
 	{
 	{
-		int result = ov_read(&handle, (char *) buffer + size, bufferSize - size, endian, (getBitDepth() == 16 ? 2 : 1), 1, 0);
+		long result = ov_read(&handle, (char *) buffer + size, bufferSize - size, endian, (getBitDepth() == 16 ? 2 : 1), 1, 0);
 
 
 		if (result == OV_HOLE)
 		if (result == OV_HOLE)
 			continue;
 			continue;
@@ -250,7 +250,7 @@ int VorbisDecoder::getBitDepth() const
 
 
 int VorbisDecoder::getSampleRate() const
 int VorbisDecoder::getSampleRate() const
 {
 {
-	return vorbisInfo->rate;
+	return (int) vorbisInfo->rate;
 }
 }
 
 
 } // lullaby
 } // lullaby

+ 1 - 1
src/modules/sound/lullaby/WaveDecoder.cpp

@@ -140,7 +140,7 @@ int WaveDecoder::decode()
 		size += bytes;
 		size += bytes;
 	}
 	}
 
 
-	return size;
+	return (int) size;
 }
 }
 
 
 bool WaveDecoder::seek(float s)
 bool WaveDecoder::seek(float s)

+ 1 - 1
src/modules/thread/Channel.cpp

@@ -176,7 +176,7 @@ Variant *Channel::peek()
 int Channel::getCount()
 int Channel::getCount()
 {
 {
 	Lock l(mutex);
 	Lock l(mutex);
-	return queue.size();
+	return (int) queue.size();
 }
 }
 
 
 void Channel::clear()
 void Channel::clear()

+ 1 - 1
src/modules/touch/wrap_Touch.cpp

@@ -47,7 +47,7 @@ int w_getTouchIDs(lua_State *L)
 		// We use lightuserdata instead of a lua_Number (double) because doubles
 		// We use lightuserdata instead of a lua_Number (double) because doubles
 		// can't represent all possible id values on 64-bit systems.
 		// can't represent all possible id values on 64-bit systems.
 		lua_pushlightuserdata(L, (void *) (intptr_t) ids[i]);
 		lua_pushlightuserdata(L, (void *) (intptr_t) ids[i]);
-		lua_rawseti(L, -2, i + 1);
+		lua_rawseti(L, -2, (int) i + 1);
 	}
 	}
 
 
 	return 1;
 	return 1;

+ 2 - 2
src/modules/window/wrap_Window.cpp

@@ -196,7 +196,7 @@ int w_getFullscreenModes(lua_State *L)
 
 
 	std::vector<Window::WindowSize> modes = instance()->getFullscreenSizes(displayindex);
 	std::vector<Window::WindowSize> modes = instance()->getFullscreenSizes(displayindex);
 
 
-	lua_createtable(L, modes.size(), 0);
+	lua_createtable(L, (int) modes.size(), 0);
 
 
 	for (size_t i = 0; i < modes.size(); i++)
 	for (size_t i = 0; i < modes.size(); i++)
 	{
 	{
@@ -417,7 +417,7 @@ int w_showMessageBox(lua_State *L)
 		// Array of button names.
 		// Array of button names.
 		for (size_t i = 0; i < numbuttons; i++)
 		for (size_t i = 0; i < numbuttons; i++)
 		{
 		{
-			lua_rawgeti(L, 3, i + 1);
+			lua_rawgeti(L, 3, (int) i + 1);
 			data.buttons.push_back(luax_checkstring(L, -1));
 			data.buttons.push_back(luax_checkstring(L, -1));
 			lua_pop(L, 1);
 			lua_pop(L, 1);
 		}
 		}