MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / lua_compare

Function lua_compare

src/Chain/libraries/glua/lapi.cpp:321–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319
320
321LUA_API int lua_compare(lua_State *L, int index1, int index2, int op) {
322 StkId o1, o2;
323 int i = 0;
324 lua_lock(L); /* may call tag method */
325 o1 = index2addr(L, index1);
326 o2 = index2addr(L, index2);
327 if (isvalid(o1) && isvalid(o2)) {
328 switch (op) {
329 case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
330 case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
331 case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
332 default: api_check(L, 0, "invalid option");
333 }
334 }
335 lua_unlock(L);
336 return i;
337}
338
339
340LUA_API size_t lua_stringtonumber(lua_State *L, const char *s) {

Callers 3

sort_compFunction · 0.85
math_minFunction · 0.85
math_maxFunction · 0.85

Calls 4

index2addrFunction · 0.85
luaV_equalobjFunction · 0.85
luaV_lessthanFunction · 0.85
luaV_lessequalFunction · 0.85

Tested by

no test coverage detected