MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / isSCnumber

Function isSCnumber

lib/lua/src/lcode.c:1256–1270  ·  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

1254** proper range to fit in a register (sB or sC).
1255*/
1256static int isSCnumber (expdesc *e, int *pi, int *isfloat) {
1257 lua_Integer i;
1258 if (e->k == VKINT)
1259 i = e->u.ival;
1260 else if (e->k == VKFLT && luaV_flttointeger(e->u.nval, &i, F2Ieq))
1261 *isfloat = 1;
1262 else
1263 return 0; /* not a number */
1264 if (!hasjumps(e) && fitsC(i)) {
1265 *pi = int2sC(cast_int(i));
1266 return 1;
1267 }
1268 else
1269 return 0;
1270}
1271
1272
1273/*

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