** 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. */
| 476 | ** are no "precision" problems. |
| 477 | */ |
| 478 | int luaK_intK (FuncState *fs, lua_Integer n) { |
| 479 | TValue k, o; |
| 480 | setpvalue(&k, cast(void*, cast(size_t, n))); |
| 481 | setivalue(&o, n); |
| 482 | return addk(fs, &k, &o); |
| 483 | } |
| 484 | |
| 485 | /* |
| 486 | ** Add a float to list of constants and return its index. |
no test coverage detected