MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / loadConstants

Function loadConstants

lib/lua/src/lundump.c:155–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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