diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2015-05-28 09:43:25 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2015-05-28 09:43:25 -0700 |
commit | 0b64534a4450d6d198ce617209ebe38816b028ef (patch) | |
tree | 6e528d4ffc3a56d16a24ebfa8f4894cae0d39968 /upb/bindings | |
parent | e6dddd6c175cb23946c2d36180b3c2ef8d30e6ec (diff) | |
parent | 2cff15d35e4ff862e6a0811ae9e509c3d3352514 (diff) |
Merge pull request #21 from google/tablestrings
Restructure tables for C89 port and smaller size.
Diffstat (limited to 'upb/bindings')
-rw-r--r-- | upb/bindings/lua/upb/table.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/upb/bindings/lua/upb/table.c b/upb/bindings/lua/upb/table.c index e574ab0..4bda63d 100644 --- a/upb/bindings/lua/upb/table.c +++ b/upb/bindings/lua/upb/table.c @@ -66,9 +66,11 @@ static void lupbtable_pushent(lua_State *L, const upb_tabent *e, lua_newtable(L); if (!upb_tabent_isempty(e)) { if (inttab) { - lua_pushnumber(L, e->key.num); + lua_pushnumber(L, e->key); } else { - lua_pushlstring(L, e->key.s.str, e->key.s.length); + uint32_t len; + const char *str = upb_tabstr(e->key, &len); + lua_pushlstring(L, str, len); } lua_setfield(L, -2, "key"); lupbtable_pushval(L, e->val, ctype); |