recent core_lua.c changes: fix build with clang 3.5
Posted: Mon Jan 05, 2015 11:09 pm
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);