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

Function lpb_checkview

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

Source from the content-addressed store, hash-verified

886}
887
888static pb_Slice lpb_checkview(lua_State *L, int idx, pb_Slice *ps) {
889 pb_Slice src = lpb_checkslice(L, idx);
890 lua_Integer r[2] = {1, -1}, range = rangerelat(L, idx+1, r, pb_len(src));
891 pb_Slice ret;
892 if (ps) *ps = src, ps->start = src.p;
893 ret.p = src.p + r[0] - 1;
894 ret.end = ret.p + range;
895 ret.start = src.p;
896 return ret;
897}
898
899static void lpb_enterview(lua_State *L, lpb_Slice *s, pb_Slice view) {
900 if (s->used >= s->size) {

Callers 1

lpb_initsliceFunction · 0.85

Calls 3

lpb_checksliceFunction · 0.85
rangerelatFunction · 0.85
pb_lenFunction · 0.85

Tested by

no test coverage detected