| 1798 | } |
| 1799 | |
| 1800 | static 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 | |
| 1813 | static void lpbD_field(lpb_Env *e, const pb_Field *f, uint32_t tag) { |
| 1814 | lpbD_checktype(e, f, tag); |
no test coverage detected