MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaK_intK

Function luaK_intK

depends/lua/src/lcode.c:471–476  ·  view source on GitHub ↗

** Add an integer to list of constants and return its index. ** Integers use userdata as keys to avoid collision with floats with ** same value; conversion to 'void*' is used only for hashing, so there ** are no "precision" problems. */

Source from the content-addressed store, hash-verified

469** are no "precision" problems.
470*/
471int luaK_intK (FuncState *fs, lua_Integer n) {
472 TValue k, o;
473 setpvalue(&k, cast(void*, cast(size_t, n)));
474 setivalue(&o, n);
475 return addk(fs, &k, &o);
476}
477
478/*
479** Add a float to list of constants and return its index.

Callers 3

fornumFunction · 0.85
discharge2regFunction · 0.85
luaK_exp2RKFunction · 0.85

Calls 2

castFunction · 0.85
addkFunction · 0.85

Tested by

no test coverage detected