MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_compare

Function lua_compare

third-party/lua-5.5.0/src/lapi.c:349–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347
348
349LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
350 const TValue *o1;
351 const TValue *o2;
352 int i = 0;
353 lua_lock(L); /* may call tag method */
354 o1 = index2value(L, index1);
355 o2 = index2value(L, index2);
356 if (isvalid(L, o1) && isvalid(L, o2)) {
357 switch (op) {
358 case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
359 case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
360 case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
361 default: api_check(L, 0, "invalid option");
362 }
363 }
364 lua_unlock(L);
365 return i;
366}
367
368
369LUA_API unsigned (lua_numbertocstring) (lua_State *L, int idx, char *buff) {

Callers 4

math_minFunction · 0.70
math_maxFunction · 0.70
tmoveFunction · 0.70
sort_compFunction · 0.70

Calls 4

index2valueFunction · 0.70
luaV_equalobjFunction · 0.70
luaV_lessthanFunction · 0.70
luaV_lessequalFunction · 0.70

Tested by

no test coverage detected