MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / lessequal

Function lessequal

other_src/lua/src/lvm.cpp:241–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240
241static int lessequal (lua_State *L, const TValue *l, const TValue *r) {
242 int res;
243 if (ttype(l) != ttype(r))
244 return luaG_ordererror(L, l, r);
245 else if (ttisnumber(l))
246 return luai_numle(nvalue(l), nvalue(r));
247 else if (ttisstring(l))
248 return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0;
249 else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */
250 return res;
251 else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */
252 return !res;
253 return luaG_ordererror(L, l, r);
254}
255
256
257int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) {

Callers 1

luaV_executeFunction · 0.70

Calls 3

luaG_ordererrorFunction · 0.70
l_strcmpFunction · 0.70
call_orderTMFunction · 0.70

Tested by

no test coverage detected