update to lua 5.3, remove lua unsigned api

This commit is contained in:
Cloud Wu
2015-01-05 16:25:42 +08:00
parent 4a2b253b40
commit c7b5015e10
76 changed files with 6960 additions and 5058 deletions

View File

@@ -433,7 +433,7 @@ pack_dict(lua_State *L, struct bson *b, bool isarray) {
luaL_error(L, "Invalid array key type : %s", lua_typename(L, kt));
return;
}
sz = bson_numstr(numberkey, lua_tounsigned(L,-2)-1);
sz = bson_numstr(numberkey, (unsigned int)lua_tointeger(L,-2)-1);
key = numberkey;
append_one(b, L, key, sz);
@@ -912,7 +912,7 @@ ltimestamp(lua_State *L) {
luaL_addlstring(&b, (const char *)&inc, sizeof(inc));
++inc;
} else {
uint32_t i = lua_tounsigned(L,2);
uint32_t i = (uint32_t)lua_tointeger(L,2);
luaL_addlstring(&b, (const char *)&i, sizeof(i));
}
luaL_addlstring(&b, (const char *)&d, sizeof(d));
@@ -996,8 +996,8 @@ lsubtype(lua_State *L, int subtype, const uint8_t * buf, size_t sz) {
}
const uint32_t * ts = (const uint32_t *)buf;
lua_pushvalue(L, lua_upvalueindex(8));
lua_pushunsigned(L, ts[1]);
lua_pushunsigned(L, ts[0]);
lua_pushinteger(L, (lua_Integer)ts[1]);
lua_pushinteger(L, (lua_Integer)ts[0]);
return 3;
}
case BSON_REGEX: {