Details
- 'unsigned int' -> 'unsigned' - Some explicit casts to avoid warnings - Test avoids printing the value of 'fail' (which may not be nil)
This commit is contained in:
@@ -100,7 +100,7 @@ LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
|
|||||||
|
|
||||||
LUALIB_API lua_State *(luaL_newstate) (void);
|
LUALIB_API lua_State *(luaL_newstate) (void);
|
||||||
|
|
||||||
LUALIB_API unsigned int luaL_makeseed (lua_State *L);
|
LUALIB_API unsigned luaL_makeseed (lua_State *L);
|
||||||
|
|
||||||
LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx);
|
LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx);
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ static int tcreate (lua_State *L) {
|
|||||||
lua_Unsigned sizerest = (lua_Unsigned)luaL_optinteger(L, 2, 0);
|
lua_Unsigned sizerest = (lua_Unsigned)luaL_optinteger(L, 2, 0);
|
||||||
luaL_argcheck(L, sizeseq <= UINT_MAX, 1, "out of range");
|
luaL_argcheck(L, sizeseq <= UINT_MAX, 1, "out of range");
|
||||||
luaL_argcheck(L, sizerest <= UINT_MAX, 2, "out of range");
|
luaL_argcheck(L, sizerest <= UINT_MAX, 2, "out of range");
|
||||||
lua_createtable(L, sizeseq, sizerest);
|
lua_createtable(L, (unsigned)sizeseq, (unsigned)sizerest);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
lua.h
3
lua.h
@@ -160,8 +160,7 @@ extern const char lua_ident[];
|
|||||||
/*
|
/*
|
||||||
** state manipulation
|
** state manipulation
|
||||||
*/
|
*/
|
||||||
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud,
|
LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud, unsigned seed);
|
||||||
unsigned int seed);
|
|
||||||
LUA_API void (lua_close) (lua_State *L);
|
LUA_API void (lua_close) (lua_State *L);
|
||||||
LUA_API lua_State *(lua_newthread) (lua_State *L);
|
LUA_API lua_State *(lua_newthread) (lua_State *L);
|
||||||
LUA_API int (lua_closethread) (lua_State *L, lua_State *from);
|
LUA_API int (lua_closethread) (lua_State *L, lua_State *from);
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ setmetatable({}, {__gc = function ()
|
|||||||
-- this finalizer should not be called, as object will be
|
-- this finalizer should not be called, as object will be
|
||||||
-- created after 'lua_close' has been called
|
-- created after 'lua_close' has been called
|
||||||
setmetatable({}, {__gc = function () print(3) end})
|
setmetatable({}, {__gc = function () print(3) end})
|
||||||
print(collectgarbage()) -- cannot call collector here
|
print(collectgarbage() or false) -- cannot call collector here
|
||||||
os.exit(0, true)
|
os.exit(0, true)
|
||||||
end})
|
end})
|
||||||
]]
|
]]
|
||||||
@@ -322,7 +322,7 @@ creating 1
|
|||||||
creating 2
|
creating 2
|
||||||
2
|
2
|
||||||
creating 3
|
creating 3
|
||||||
nil
|
false
|
||||||
1
|
1
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user