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

Function dumpConstants

extlibs/lua/src/ldump.c:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106static void dumpFunction(DumpState *D, const Proto *f, TString *psource);
107
108static void dumpConstants (DumpState *D, const Proto *f) {
109 int i;
110 int n = f->sizek;
111 dumpInt(D, n);
112 for (i = 0; i < n; i++) {
113 const TValue *o = &f->k[i];
114 int tt = ttypetag(o);
115 dumpByte(D, tt);
116 switch (tt) {
117 case LUA_VNUMFLT:
118 dumpNumber(D, fltvalue(o));
119 break;
120 case LUA_VNUMINT:
121 dumpInteger(D, ivalue(o));
122 break;
123 case LUA_VSHRSTR:
124 case LUA_VLNGSTR:
125 dumpString(D, tsvalue(o));
126 break;
127 default:
128 lua_assert(tt == LUA_VNIL || tt == LUA_VFALSE || tt == LUA_VTRUE);
129 }
130 }
131}
132
133
134static void dumpProtos (DumpState *D, const Proto *f) {

Callers 1

dumpFunctionFunction · 0.85

Calls 5

dumpIntFunction · 0.85
dumpByteFunction · 0.85
dumpNumberFunction · 0.85
dumpIntegerFunction · 0.85
dumpStringFunction · 0.85

Tested by

no test coverage detected