MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / LoadConstants

Function LoadConstants

ThirdParty/lua/lua/lundump.c:114–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114static void LoadConstants (LoadState *S, Proto *f) {
115 int i;
116 int n = LoadInt(S);
117 f->k = luaM_newvector(S->L, n, TValue);
118 f->sizek = n;
119 for (i = 0; i < n; i++)
120 setnilvalue(&f->k[i]);
121 for (i = 0; i < n; i++) {
122 TValue *o = &f->k[i];
123 int t = LoadByte(S);
124 switch (t) {
125 case LUA_TNIL:
126 setnilvalue(o);
127 break;
128 case LUA_TBOOLEAN:
129 setbvalue(o, LoadByte(S));
130 break;
131 case LUA_TNUMFLT:
132 setfltvalue(o, LoadNumber(S));
133 break;
134 case LUA_TNUMINT:
135 setivalue(o, LoadInteger(S));
136 break;
137 case LUA_TSHRSTR:
138 case LUA_TLNGSTR:
139 setsvalue2n(S->L, o, LoadString(S));
140 break;
141 default:
142 lua_assert(0);
143 }
144 }
145}
146
147
148static 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