eris: upgrade flagbits to 16 bits
This commit is contained in:
@@ -135,7 +135,7 @@ LuaDefine(table_getflagbits, "c") {
|
||||
LuaArg tab;
|
||||
LuaRet bits;
|
||||
LuaStack LS(L, tab, bits);
|
||||
unsigned char ubits = lua_getflagbits(L, tab.index());
|
||||
uint16_t ubits = lua_getflagbits(L, tab.index());
|
||||
LS.set(bits, ubits);
|
||||
return LS.result();
|
||||
}
|
||||
@@ -143,7 +143,7 @@ LuaDefine(table_getflagbits, "c") {
|
||||
LuaDefine(table_setflagbits, "c") {
|
||||
LuaArg tab, bits;
|
||||
LuaStack LS(L, tab, bits);
|
||||
unsigned char ubits = LS.ckinteger(bits);
|
||||
uint16_t ubits = LS.ckinteger(bits);
|
||||
lua_setflagbits(L, tab.index(), ubits);
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
@@ -905,8 +905,8 @@ static void
|
||||
p_literaltable(Info *info) { /* ... tbl */
|
||||
eris_checkstack(info->L, 3);
|
||||
|
||||
unsigned char bits = lua_getflagbits(info->L, -1);
|
||||
WRITE_VALUE(bits, uint8_t);
|
||||
uint16_t bits = lua_getflagbits(info->L, -1);
|
||||
WRITE_VALUE(bits, uint16_t);
|
||||
|
||||
/* Persist all key / value pairs. */
|
||||
lua_pushnil(info->L); /* ... tbl nil */
|
||||
@@ -946,7 +946,7 @@ u_literaltable(Info *info) { /* ... */
|
||||
eris_checkstack(info->L, 3);
|
||||
|
||||
lua_newtable(info->L); /* ... tbl */
|
||||
unsigned char bits = READ_VALUE(uint8_t);
|
||||
uint16_t bits = READ_VALUE(uint16_t);
|
||||
lua_setflagbits(info->L, -1, bits);
|
||||
|
||||
/* Preregister table for handling of cycles (keys, values or metatable). */
|
||||
|
||||
@@ -898,7 +898,7 @@ LUA_API void lua_setuservalue (lua_State *L, int idx) {
|
||||
}
|
||||
|
||||
|
||||
LUA_API void lua_setflagbits (lua_State *L, int idx, unsigned char bits) {
|
||||
LUA_API void lua_setflagbits (lua_State *L, int idx, unsigned short bits) {
|
||||
TValue *obj;
|
||||
Table *tab;
|
||||
lua_lock(L);
|
||||
@@ -909,7 +909,7 @@ LUA_API void lua_setflagbits (lua_State *L, int idx, unsigned char bits) {
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
LUA_API void lua_modflagbits (lua_State *L, int idx, unsigned char set, unsigned char clear) {
|
||||
LUA_API void lua_modflagbits (lua_State *L, int idx, unsigned short set, unsigned short clear) {
|
||||
TValue *obj;
|
||||
Table *tab;
|
||||
lua_lock(L);
|
||||
@@ -921,7 +921,7 @@ LUA_API void lua_modflagbits (lua_State *L, int idx, unsigned char set, unsigned
|
||||
lua_unlock(L);
|
||||
}
|
||||
|
||||
LUA_API unsigned char lua_getflagbits (lua_State *L, int idx) {
|
||||
LUA_API unsigned short lua_getflagbits (lua_State *L, int idx) {
|
||||
TValue *obj;
|
||||
Table *tab;
|
||||
obj = index2addr(L, idx);
|
||||
|
||||
@@ -556,8 +556,8 @@ typedef struct Node {
|
||||
typedef struct Table {
|
||||
CommonHeader;
|
||||
lu_byte flags; /* 1<<p means tagmethod(p) is not present */
|
||||
lu_byte flagbits; /* flag bits reserved for the user */
|
||||
lu_byte lsizenode; /* log2 of size of `node' array */
|
||||
unsigned short flagbits; /* flag bits reserved for the user */
|
||||
int sizearray; /* size of `array' array */
|
||||
int nnkeys; /* number of non-nil keys in both array and hash */
|
||||
int lastdelseq; /* sequence number of last deleted */
|
||||
|
||||
@@ -237,17 +237,17 @@ LUA_API void (lua_getuservalue) (lua_State *L, int idx);
|
||||
/*
|
||||
** set functions (stack -> Lua)
|
||||
*/
|
||||
LUA_API void (lua_setglobal) (lua_State *L, const char *var);
|
||||
LUA_API void (lua_settable) (lua_State *L, int idx);
|
||||
LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
|
||||
LUA_API void (lua_rawset) (lua_State *L, int idx);
|
||||
LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
|
||||
LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
|
||||
LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
|
||||
LUA_API void (lua_setuservalue) (lua_State *L, int idx);
|
||||
LUA_API void (lua_setflagbits) (lua_State *L, int idx, unsigned char bits);
|
||||
LUA_API void (lua_modflagbits) (lua_State *L, int idx, unsigned char set, unsigned char clear);
|
||||
LUA_API unsigned char (lua_getflagbits) (lua_State *L, int idx);
|
||||
LUA_API void (lua_setglobal) (lua_State *L, const char *var);
|
||||
LUA_API void (lua_settable) (lua_State *L, int idx);
|
||||
LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
|
||||
LUA_API void (lua_rawset) (lua_State *L, int idx);
|
||||
LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
|
||||
LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
|
||||
LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
|
||||
LUA_API void (lua_setuservalue) (lua_State *L, int idx);
|
||||
LUA_API void (lua_setflagbits) (lua_State *L, int idx, unsigned short bits);
|
||||
LUA_API void (lua_modflagbits) (lua_State *L, int idx, unsigned short set, unsigned short clear);
|
||||
LUA_API unsigned short (lua_getflagbits) (lua_State *L, int idx);
|
||||
|
||||
/*
|
||||
** 'load' and 'call' functions (load and run Lua code)
|
||||
|
||||
Reference in New Issue
Block a user