Skip to content

Commit bcbbb53

Browse files
committed
bugfix: fixed the C compiler warning "SO C90 forbids mixed declarations and code" on older operating systems.
1 parent b5e364c commit bcbbb53

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lua_cjson.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,8 @@ static void json_append_data(lua_State *l, json_config_t *cfg,
710710
int current_depth, strbuf_t *json)
711711
{
712712
int len;
713+
int as_array = 0;
714+
int has_metatable;
713715

714716
switch (lua_type(l, -1)) {
715717
case LUA_TSTRING:
@@ -728,8 +730,7 @@ static void json_append_data(lua_State *l, json_config_t *cfg,
728730
current_depth++;
729731
json_check_encode_depth(l, cfg, current_depth, json);
730732

731-
int as_array = 0;
732-
int has_metatable = lua_getmetatable(l, -1);
733+
has_metatable = lua_getmetatable(l, -1);
733734

734735
if (has_metatable) {
735736
lua_pushlightuserdata(l, &json_array);

0 commit comments

Comments
 (0)