| 1685 | } |
| 1686 | |
| 1687 | static int lpbE_pack(lpb_Env* e, const pb_Type* t, int idx) { |
| 1688 | unsigned i; |
| 1689 | lua_State* L = e->L; |
| 1690 | pb_Field** f = pb_sortfield((pb_Type*)t); |
| 1691 | for (i = 0; i < t->field_count; i++) { |
| 1692 | int index = idx + i; |
| 1693 | if (!lua_isnoneornil(L, index)) { |
| 1694 | lpb_encode_onefield(e, t, f[i], index); |
| 1695 | } |
| 1696 | } |
| 1697 | return 0; |
| 1698 | } |
| 1699 | |
| 1700 | static int Lpb_pack(lua_State* L) { |
| 1701 | lpb_State* LS = lpb_lstate(L); |
no test coverage detected