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

Function lpbD_checktype

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

Source from the content-addressed store, hash-verified

1798}
1799
1800static void lpbD_checktype(lpb_Env *e, const pb_Field *f, uint32_t tag) {
1801 if (pb_wtypebytype(f->type_id) == (int)pb_gettype(tag)) return;
1802 luaL_error(e->L,
1803 "type mismatch for %s%sfield '%s' at offset %d, "
1804 "%s expected for type %s, got %s",
1805 f->packed ? "packed " : "", f->repeated ? "repeated " : "",
1806 (const char*)f->name,
1807 pb_pos(*e->s)+1,
1808 pb_wtypename(pb_wtypebytype(f->type_id), NULL),
1809 pb_typename(f->type_id, NULL),
1810 pb_wtypename(pb_gettype(tag), NULL));
1811}
1812
1813static void lpbD_field(lpb_Env *e, const pb_Field *f, uint32_t tag) {
1814 lpbD_checktype(e, f, tag);

Callers 3

lpbD_fieldFunction · 0.85
lpbD_messageFunction · 0.85
lpb_unpackfieldFunction · 0.85

Calls 5

pb_wtypebytypeFunction · 0.85
luaL_errorFunction · 0.85
pb_posFunction · 0.85
pb_wtypenameFunction · 0.85
pb_typenameFunction · 0.85

Tested by

no test coverage detected