Commits

Alex Szpakowski committed 10de424

Fixed some compiler warnings

Comments (0)

Files changed (9)

src/common/b64.cpp

 
 static const char cd64[]="|$$$}rstuvwxyz{$$$$$$$>?@ABCDEFGHIJKLMNOPQRSTUVW$$$$$$XYZ[\\]^_`abcdefghijklmnopq";
 
-void b64_decode_block(char in[4], char out[3])
+static void b64_decode_block(char in[4], char out[3])
 {
 	out[0] = (char)(in[0] << 2 | in[1] >> 4);
 	out[1] = (char)(in[1] << 4 | in[2] >> 2);

src/modules/graphics/opengl/Font.cpp

 	unloadVolatile();
 }
 
-bool Font::initializeTexture(GLint format)
+bool Font::initializeTexture(GLenum format)
 {
 	GLint internalformat = (format == GL_LUMINANCE_ALPHA) ? GL_LUMINANCE8_ALPHA8 : GL_RGBA8;
 
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
-	GLint format = (type == FONT_TRUETYPE ? GL_LUMINANCE_ALPHA : GL_RGBA);
+	GLenum format = (type == FONT_TRUETYPE ? GL_LUMINANCE_ALPHA : GL_RGBA);
 
 	// Initialize the texture, attempting smaller sizes if initialization fails.
 	bool initialized = false;

src/modules/graphics/opengl/Font.h

 		};
 	};
 
-	bool initializeTexture(GLint format);
+	bool initializeTexture(GLenum format);
 	void createTexture();
 	Glyph *addGlyph(uint32 glyph);
 	Glyph *findGlyph(uint32 glyph);

src/modules/graphics/opengl/OpenGL.cpp

 		GLenum curgltextureunit;
 		glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *) &curgltextureunit);
 
-		state.curTextureUnit = curgltextureunit - GL_TEXTURE0;
+		state.curTextureUnit = (int) curgltextureunit - GL_TEXTURE0;
 
 		// Retrieve currently bound textures for each texture unit.
 		for (size_t i = 0; i < state.textureUnits.size(); i++)

src/modules/graphics/opengl/VertexBuffer.cpp

 
 	if (is_dirty)
 	{
-		glGetBufferSubDataARB(getTarget(), 0, getSize(), memory_map);
+		glGetBufferSubDataARB(getTarget(), 0, (GLsizeiptr) getSize(), memory_map);
 		is_dirty = false;
 	}
 
 
 	// "orphan" current buffer to avoid implicit synchronisation on the GPU:
 	// http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-AsynchronousBufferTransfers.pdf
-	glBufferDataARB(getTarget(), getSize(), NULL,       getUsage());
-	glBufferDataARB(getTarget(), getSize(), memory_map, getUsage());
+	glBufferDataARB(getTarget(), (GLsizeiptr) getSize(), NULL,       getUsage());
+	glBufferDataARB(getTarget(), (GLsizeiptr) getSize(), memory_map, getUsage());
 
 	is_mapped = false;
 }
 				// Now we tell the driver it only needs to deal with the data
 				// we changed.
 				memcpy(static_cast<char *>(mapdata) + offset, data, size);
-				glFlushMappedBufferRangeAPPLE(getTarget(), offset, size);
+				glFlushMappedBufferRangeAPPLE(getTarget(), (GLintptr) offset, (GLsizei) size);
 			}
 
 			glUnmapBufferARB(getTarget());
 		else
 		{
 			// Fall back to a possibly slower SubData (more chance of syncing.)
-			glBufferSubDataARB(getTarget(), offset, size, data);
+			glBufferSubDataARB(getTarget(), (GLintptr) offset, (GLsizeiptr) size, data);
 		}
 
 		if (getMemoryBacking() != BACKING_FULL)
 		glBufferParameteriAPPLE(getTarget(), GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE);
 
 	// Note that if 'src' is '0', no data will be copied.
-	glBufferDataARB(getTarget(), getSize(), src, getUsage());
+	glBufferDataARB(getTarget(), (GLsizeiptr) getSize(), src, getUsage());
 	GLenum err = glGetError();
 
 	return (GL_NO_ERROR == err);

src/modules/image/magpie/DevilHandler.cpp

 
 	try
 	{
-		bool success = ilLoadL(IL_TYPE_UNKNOWN, (void *)data->getData(), data->getSize()) == IL_TRUE;
+		bool success = ilLoadL(IL_TYPE_UNKNOWN, (void *)data->getData(), (ILuint) data->getSize()) == IL_TRUE;
 
 		if (!success)
 			throw love::Exception("Could not decode image!");
 		if (bpp != sizeof(pixel))
 			throw love::Exception("Could not convert image!");
 
-		img.size = ilGetInteger(IL_IMAGE_SIZE_OF_DATA);
+		img.size = (size_t) ilGetInteger(IL_IMAGE_SIZE_OF_DATA);
 
 		try
 		{

src/modules/math/wrap_Math.cpp

 	}
 	else
 	{
-		size_t top = lua_gettop(L);
+		int top = lua_gettop(L);
 		vertices.reserve(top / 2);
-		for (size_t i = 1; i <= top; i += 2)
+		for (int i = 1; i <= top; i += 2)
 		{
 			Vertex v;
 			v.x = (float) luaL_checknumber(L, i);

src/modules/sound/lullaby/WaveDecoder.cpp

 {
 
 // Callbacks
-wuff_sint32 read_callback(void *userdata, wuff_uint8 *buffer, size_t *size)
+static wuff_sint32 read_callback(void *userdata, wuff_uint8 *buffer, size_t *size)
 {
 	WaveFile *input = (WaveFile *) userdata;
 	size_t bytes_left = input->size - input->offset;
 	return WUFF_SUCCESS;
 }
 
-wuff_sint32 seek_callback(void *userdata, wuff_uint64 offset)
+static wuff_sint32 seek_callback(void *userdata, wuff_uint64 offset)
 {
 	WaveFile *input = (WaveFile *)userdata;
 	input->offset = (size_t) (offset < input->size ? offset : input->size);
 	return WUFF_SUCCESS;
 }
 
-wuff_sint32 tell_callback(void *userdata, wuff_uint64 *offset)
+static wuff_sint32 tell_callback(void *userdata, wuff_uint64 *offset)
 {
 	WaveFile *input = (WaveFile *)userdata;
 	*offset = input->offset;

src/modules/timer/sdl/Timer.cpp

 void Timer::sleep(double seconds) const
 {
 	if (seconds > 0)
-		delay((int)(seconds*1000));
+		delay((unsigned int)(seconds*1000));
 }
 
 double Timer::getDelta() const