MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / loadConstants

Function loadConstants

extlibs/lua/src/lundump.c:149–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148
149static void loadConstants (LoadState *S, Proto *f) {
150 int i;
151 int n = loadInt(S);
152 f->k = luaM_newvectorchecked(S->L, n, TValue);
153 f->sizek = n;
154 for (i = 0; i < n; i++)
155 setnilvalue(&f->k[i]);
156 for (i = 0; i < n; i++) {
157 TValue *o = &f->k[i];
158 int t = loadByte(S);
159 switch (t) {
160 case LUA_VNIL:
161 setnilvalue(o);
162 break;
163 case LUA_VFALSE:
164 setbfvalue(o);
165 break;
166 case LUA_VTRUE:
167 setbtvalue(o);
168 break;
169 case LUA_VNUMFLT:
170 setfltvalue(o, loadNumber(S));
171 break;
172 case LUA_VNUMINT:
173 setivalue(o, loadInteger(S));
174 break;
175 case LUA_VSHRSTR:
176 case LUA_VLNGSTR:
177 setsvalue2n(S->L, o, loadString(S));
178 break;
179 default: lua_assert(0);
180 }
181 }
182}
183
184
185static void loadProtos (LoadState *S, Proto *f) {

Callers 1

loadFunctionFunction · 0.85

Calls 5

loadIntFunction · 0.85
loadByteFunction · 0.85
loadNumberFunction · 0.85
loadIntegerFunction · 0.85
loadStringFunction · 0.85

Tested by

no test coverage detected