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

Function posrelat

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

Source from the content-addressed store, hash-verified

229}
230
231static lua_Integer posrelat(lua_Integer pos, size_t len) {
232 if (pos >= 0) return pos;
233 else if (0u - (size_t)pos > len) return 0;
234 else return (lua_Integer)len + pos + 1;
235}
236
237static lua_Integer rangerelat(lua_State *L, int idx, lua_Integer r[2], size_t len) {
238 r[0] = posrelat(luaL_optinteger(L, idx, 1), len);

Callers 4

rangerelatFunction · 0.85
lpb_unpacklocFunction · 0.85
Lslice_levelFunction · 0.85
Lslice_leaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected