(libretro-db) Style nits

This commit is contained in:
twinaphex 2015-09-21 11:42:41 +02:00
parent 9093cd4aba
commit ab325df65d
1 changed files with 18 additions and 47 deletions

View File

@ -19,52 +19,29 @@ static void push_rmsgpack_value(lua_State *L, struct rmsgpack_dom_value *value)
switch(value->type)
{
case RDT_INT:
lua_pushnumber(
L,
value->int_
);
lua_pushnumber(L, value->int_);
break;
case RDT_UINT:
lua_pushnumber(
L,
value->uint_
);
lua_pushnumber(L, value->uint_);
break;
case RDT_BINARY:
lua_pushlstring(
L,
value->binary.buff,
value->binary.len
);
lua_pushlstring(L, value->binary.buff, value->binary.len);
break;
case RDT_BOOL:
lua_pushboolean(
L,
value->bool_
);
lua_pushboolean(L, value->bool_);
break;
case RDT_NULL:
lua_pushnil(L);
break;
case RDT_STRING:
lua_pushlstring(
L,
value->string.buff,
value->binary.len
);
lua_pushlstring(L, value->string.buff, value->binary.len);
break;
case RDT_MAP:
lua_createtable(L, 0, value->map.len);
for (i = 0; i < value->map.len; i++)
{
push_rmsgpack_value(
L,
&value->map.items[i].key
);
push_rmsgpack_value(
L,
&value->map.items[i].value
);
push_rmsgpack_value(L, &value->map.items[i].key);
push_rmsgpack_value(L, &value->map.items[i].value);
lua_settable(L, -3);
}
break;
@ -72,14 +49,8 @@ static void push_rmsgpack_value(lua_State *L, struct rmsgpack_dom_value *value)
lua_createtable(L, value->array.len, 0);
for (i = 0; i < value->array.len; i++)
{
lua_pushnumber(
L,
i + 1
);
push_rmsgpack_value(
L,
&value->array.items[i]
);
lua_pushnumber(L, i + 1);
push_rmsgpack_value(L, &value->array.items[i]);
lua_settable(L, -3);
}
break;