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

Function isSCnumber

3rd/lua-5.4.3/src/lcode.c:1237–1251  ·  view source on GitHub ↗

** Check whether expression 'e' is a literal integer or float in ** proper range to fit in a register (sB or sC). */

Source from the content-addressed store, hash-verified

1235** proper range to fit in a register (sB or sC).
1236*/
1237static int isSCnumber (expdesc *e, int *pi, int *isfloat) {
1238 lua_Integer i;
1239 if (e->k == VKINT)
1240 i = e->u.ival;
1241 else if (e->k == VKFLT && luaV_flttointeger(e->u.nval, &i, F2Ieq))
1242 *isfloat = 1;
1243 else
1244 return 0; /* not a number */
1245 if (!hasjumps(e) && fitsC(i)) {
1246 *pi = int2sC(cast_int(i));
1247 return 1;
1248 }
1249 else
1250 return 0;
1251}
1252
1253
1254/*

Callers 3

codeorderFunction · 0.85
codeeqFunction · 0.85
luaK_infixFunction · 0.85

Calls 2

luaV_flttointegerFunction · 0.85
fitsCFunction · 0.85

Tested by

no test coverage detected