From bcbbb53bf2066c64614127f361e158970a14cab2 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Fri, 17 Nov 2017 13:31:16 -0800 Subject: bugfix: fixed the C compiler warning "SO C90 forbids mixed declarations and code" on older operating systems. --- lua_cjson.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lua_cjson.c') diff --git a/lua_cjson.c b/lua_cjson.c index 6c7eb4e..c0bdce1 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -710,6 +710,8 @@ static void json_append_data(lua_State *l, json_config_t *cfg, int current_depth, strbuf_t *json) { int len; + int as_array = 0; + int has_metatable; switch (lua_type(l, -1)) { case LUA_TSTRING: @@ -728,8 +730,7 @@ static void json_append_data(lua_State *l, json_config_t *cfg, current_depth++; json_check_encode_depth(l, cfg, current_depth, json); - int as_array = 0; - int has_metatable = lua_getmetatable(l, -1); + has_metatable = lua_getmetatable(l, -1); if (has_metatable) { lua_pushlightuserdata(l, &json_array); -- cgit v1.2.3-55-g6feb