recent core_lua.c changes: fix build with clang 3.5

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
lifanov
Cornac
Posts: 32
Joined: Sat Jan 14, 2012 12:53 am

recent core_lua.c changes: fix build with clang 3.5

#1 Post by lifanov »

This fixes a fatal warning with clang 3.5 (-Wreturn-value) by marking one function void and giving a return value to another non-void function.

Code: Select all

diff --git a/src/core_lua.c b/src/core_lua.c
index cdb0255..90811da 100644
--- a/src/core_lua.c
+++ b/src/core_lua.c
@@ -3098,7 +3098,7 @@ static int display_pause_anims(lua_State *L) {
  * Vertex Objects
  **************************************************************/
 
-static update_vertex_size(lua_vertexes *vx, int size) {
+static void update_vertex_size(lua_vertexes *vx, int size) {
        if (size <= vx->size) return;
        vx->size = size;
        vx->vertices = realloc(vx->vertices, 2 * sizeof(GLfloat) * size);
@@ -3169,7 +3169,7 @@ static int gl_vertex_add(lua_State *L) {
 
 static int gl_vertex_toscreen(lua_State *L) {
        lua_vertexes *vx = (lua_vertexes*)auxiliar_checkclass(L, "gl{vertexes}", 1);
-       if (!vx->nb) return;
+       if (!vx->nb) return 0;
        int x = luaL_checknumber(L, 2);
        int y = luaL_checknumber(L, 3);

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: recent core_lua.c changes: fix build with clang 3.5

#2 Post by darkgod »

fixed
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply