MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaK_intK

Function luaK_intK

3rd/lua-5.4.3/src/lcode.c:587–592  ·  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

585** are no "precision" problems.
586*/
587static int luaK_intK (FuncState *fs, lua_Integer n) {
588 TValue k, o;
589 setpvalue(&k, cast_voidp(cast_sizet(n)));
590 setivalue(&o, n);
591 return addk(fs, &k, &o);
592}
593
594/*
595** Add a float to list of constants and return its index.

Callers 2

luaK_intFunction · 0.85
luaK_exp2KFunction · 0.85

Calls 1

addkFunction · 0.85

Tested by

no test coverage detected