MCPcopy Create free account
hub / github.com/Tencent/UnLua / lpb_checkinteger

Function lpb_checkinteger

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:337–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337static uint64_t lpb_checkinteger(lua_State *L, int idx) {
338 int isint;
339 uint64_t v = lpb_tointegerx(L, idx, &isint);
340 if (!isint) {
341 if (lua_type(L, idx) == LUA_TSTRING)
342 luaL_error(L, "integer format error: '%s'", lua_tostring(L, idx));
343 typeerror(L, idx, "number/string");
344 }
345 return v;
346}
347
348static void lpb_pushinteger(lua_State *L, int64_t n, int u, int mode) {
349 if (mode != LPB_NUMBER && ((u && n < 0) || n < INT_MIN || n > UINT_MAX)) {

Callers 9

Lconv_encode_int32Function · 0.85
Lconv_encode_uint32Function · 0.85
Lconv_encode_sint32Function · 0.85
Lconv_decode_sint32Function · 0.85
Lconv_encode_sint64Function · 0.85
Lconv_decode_sint64Function · 0.85
Lconv_decode_floatFunction · 0.85
Lconv_decode_doubleFunction · 0.85
lpb_packfmtFunction · 0.85

Calls 4

lpb_tointegerxFunction · 0.85
lua_typeFunction · 0.85
luaL_errorFunction · 0.85
typeerrorFunction · 0.85

Tested by

no test coverage detected