aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/luajit-2.0/src/lj_obj.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-23 23:36:30 +1000
committerDavid Walter Seikel2012-01-23 23:36:30 +1000
commit6523585c66c04cea54df50013df8886b589847d8 (patch)
tree0b22aee7064166d88595eda260ca2d17c0773da5 /libraries/luajit-2.0/src/lj_obj.c
parentUpdate the EFL to what I'm actually using, coz I'm using some stuff not yet r... (diff)
downloadSledjHamr-6523585c66c04cea54df50013df8886b589847d8.zip
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.gz
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.bz2
SledjHamr-6523585c66c04cea54df50013df8886b589847d8.tar.xz
Add luaproc and LuaJIT libraries.
Two versions of LuaJIT, the stable release, and the dev version. Try the dev version first, until ih fails badly.
Diffstat (limited to '')
-rw-r--r--libraries/luajit-2.0/src/lj_obj.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libraries/luajit-2.0/src/lj_obj.c b/libraries/luajit-2.0/src/lj_obj.c
new file mode 100644
index 0000000..1476f0b
--- /dev/null
+++ b/libraries/luajit-2.0/src/lj_obj.c
@@ -0,0 +1,35 @@
1/*
2** Miscellaneous object handling.
3** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h
4*/
5
6#define lj_obj_c
7#define LUA_CORE
8
9#include "lj_obj.h"
10
11/* Object type names. */
12LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */
13 "no value", "nil", "boolean", "userdata", "number", "string",
14 "table", "function", "userdata", "thread", "proto", "cdata"
15};
16
17LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */
18 "nil", "boolean", "boolean", "userdata", "string", "upval", "thread",
19 "proto", "function", "trace", "cdata", "table", "userdata", "number"
20};
21
22/* Compare two objects without calling metamethods. */
23int lj_obj_equal(cTValue *o1, cTValue *o2)
24{
25 if (itype(o1) == itype(o2)) {
26 if (tvispri(o1))
27 return 1;
28 if (!tvisnum(o1))
29 return gcrefeq(o1->gcr, o2->gcr);
30 } else if (!tvisnumber(o1) || !tvisnumber(o2)) {
31 return 0;
32 }
33 return numberVnum(o1) == numberVnum(o2);
34}
35