MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / DumpConstants

Function DumpConstants

Source/Misc/lua/src/lua.c:5744–5773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5742static void DumpFunction(const Proto* f, const TString* p, DumpState* D);
5743
5744static void DumpConstants(const Proto* f, DumpState* D)
5745{
5746int i,n=f->sizek;
5747DumpInt(n,D);
5748for (i=0; i<n; i++)
5749{
5750const TValue* o=&f->k[i];
5751DumpChar(ttype(o),D);
5752switch (ttype(o))
5753{
5754case LUA_TNIL:
5755 break;
5756case LUA_TBOOLEAN:
5757 DumpChar(bvalue(o),D);
5758 break;
5759case LUA_TNUMBER:
5760 DumpNumber(nvalue(o),D);
5761 break;
5762case LUA_TSTRING:
5763 DumpString(rawtsvalue(o),D);
5764 break;
5765default:
5766 lua_assert(0); /* cannot happen */
5767 break;
5768}
5769}
5770n=f->sizep;
5771DumpInt(n,D);
5772for (i=0; i<n; i++) DumpFunction(f->p[i],f->source,D);
5773}
5774
5775static void DumpDebug(const Proto* f, DumpState* D)
5776{

Callers 1

DumpFunctionFunction · 0.85

Calls 5

DumpIntFunction · 0.85
DumpCharFunction · 0.85
DumpNumberFunction · 0.85
DumpStringFunction · 0.85
DumpFunctionFunction · 0.85

Tested by

no test coverage detected