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

Function dumpConstants

lib/lua/src/ldump.c:112–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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