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

Function comp_custom

other_src/lua/src/ltablib.cpp:245–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243
244
245static int comp_custom (lua_State *L, const TValue *a, const TValue *b) {
246 int res;
247 lua_pushvalue(L, 2); /* comparison function, see sort() */
248 lua_lock(L);
249 setobj2s(L, L->top, a); L->top++;
250 setobj2s(L, L->top, b); L->top++;
251 lua_unlock(L);
252 lua_call(L, 2, 1);
253 res = lua_toboolean(L, -1);
254 lua_pop(L, 1);
255 return res;
256}
257
258
259static void mergesort (SortInfo *sortInfo, TValue* data, int size) {

Callers

nothing calls this directly

Calls 3

lua_pushvalueFunction · 0.70
lua_callFunction · 0.70
lua_tobooleanFunction · 0.70

Tested by

no test coverage detected