diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-05-31 15:27:56 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-05-31 15:27:56 -0300 |
commit | 821bd7025ea7ecf399e0b50f920a460b11c649c7 (patch) | |
tree | 98cd8aa59a2cc80b6d52b164cebcb2a46b457f4a | |
parent | 9b7dddad7d3f4546f838834d9674eaf0f2fca3dd (diff) | |
download | lua-821bd7025ea7ecf399e0b50f920a460b11c649c7.tar.gz lua-821bd7025ea7ecf399e0b50f920a460b11c649c7.tar.bz2 lua-821bd7025ea7ecf399e0b50f920a460b11c649c7.zip |
more uniform names for 'equalobj'-related functions
-rw-r--r-- | lapi.c | 4 | ||||
-rw-r--r-- | lcode.c | 4 | ||||
-rw-r--r-- | ltable.c | 6 | ||||
-rw-r--r-- | lvm.c | 6 | ||||
-rw-r--r-- | lvm.h | 10 |
5 files changed, 15 insertions, 15 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.145 2011/04/05 14:26:23 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.146 2011/05/31 18:24:36 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -278,7 +278,7 @@ LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { | |||
278 | StkId o1 = index2addr(L, index1); | 278 | StkId o1 = index2addr(L, index1); |
279 | StkId o2 = index2addr(L, index2); | 279 | StkId o2 = index2addr(L, index2); |
280 | return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 | 280 | return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 |
281 | : luaV_rawequalObj(o1, o2); | 281 | : luaV_rawequalobj(o1, o2); |
282 | } | 282 | } |
283 | 283 | ||
284 | 284 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.54 2011/04/28 14:00:11 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.55 2011/05/31 18:24:36 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -296,7 +296,7 @@ static int addk (FuncState *fs, TValue *key, TValue *v) { | |||
296 | if (ttisnumber(idx)) { | 296 | if (ttisnumber(idx)) { |
297 | lua_Number n = nvalue(idx); | 297 | lua_Number n = nvalue(idx); |
298 | lua_number2int(k, n); | 298 | lua_number2int(k, n); |
299 | if (luaV_rawequalObj(&f->k[k], v)) | 299 | if (luaV_rawequalobj(&f->k[k], v)) |
300 | return k; | 300 | return k; |
301 | /* else may be a collision (e.g., between 0.0 and "\0\0\0\0\0\0\0\0"); | 301 | /* else may be a collision (e.g., between 0.0 and "\0\0\0\0\0\0\0\0"); |
302 | go through and create a new entry for this value */ | 302 | go through and create a new entry for this value */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.55 2011/05/02 16:45:32 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.56 2011/05/31 18:24:36 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -149,7 +149,7 @@ static int findindex (lua_State *L, Table *t, StkId key) { | |||
149 | Node *n = mainposition(t, key); | 149 | Node *n = mainposition(t, key); |
150 | do { /* check whether `key' is somewhere in the chain */ | 150 | do { /* check whether `key' is somewhere in the chain */ |
151 | /* key may be dead already, but it is ok to use it in `next' */ | 151 | /* key may be dead already, but it is ok to use it in `next' */ |
152 | if (luaV_rawequalObj(gkey(n), key) || | 152 | if (luaV_rawequalobj(gkey(n), key) || |
153 | (ttisdeadkey(gkey(n)) && iscollectable(key) && | 153 | (ttisdeadkey(gkey(n)) && iscollectable(key) && |
154 | gcvalue(gkey(n)) == gcvalue(key))) { | 154 | gcvalue(gkey(n)) == gcvalue(key))) { |
155 | i = cast_int(n - gnode(t, 0)); /* key index in hash table */ | 155 | i = cast_int(n - gnode(t, 0)); /* key index in hash table */ |
@@ -482,7 +482,7 @@ const TValue *luaH_get (Table *t, const TValue *key) { | |||
482 | default: { | 482 | default: { |
483 | Node *n = mainposition(t, key); | 483 | Node *n = mainposition(t, key); |
484 | do { /* check whether `key' is somewhere in the chain */ | 484 | do { /* check whether `key' is somewhere in the chain */ |
485 | if (luaV_rawequalObj(gkey(n), key)) | 485 | if (luaV_rawequalobj(gkey(n), key)) |
486 | return gval(n); /* that's it */ | 486 | return gval(n); /* that's it */ |
487 | else n = gnext(n); | 487 | else n = gnext(n); |
488 | } while (n); | 488 | } while (n); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.137 2011/05/05 16:16:33 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.138 2011/05/31 18:24:36 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -174,7 +174,7 @@ static const TValue *get_equalTM (lua_State *L, Table *mt1, Table *mt2, | |||
174 | if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ | 174 | if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ |
175 | tm2 = fasttm(L, mt2, event); | 175 | tm2 = fasttm(L, mt2, event); |
176 | if (tm2 == NULL) return NULL; /* no metamethod */ | 176 | if (tm2 == NULL) return NULL; /* no metamethod */ |
177 | if (luaV_rawequalObj(tm1, tm2)) /* same metamethods? */ | 177 | if (luaV_rawequalobj(tm1, tm2)) /* same metamethods? */ |
178 | return tm1; | 178 | return tm1; |
179 | return NULL; | 179 | return NULL; |
180 | } | 180 | } |
@@ -240,7 +240,7 @@ int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { | |||
240 | /* | 240 | /* |
241 | ** equality of Lua values. L == NULL means raw equality (no metamethods) | 241 | ** equality of Lua values. L == NULL means raw equality (no metamethods) |
242 | */ | 242 | */ |
243 | int luaV_equalval_ (lua_State *L, const TValue *t1, const TValue *t2) { | 243 | int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2) { |
244 | const TValue *tm; | 244 | const TValue *tm; |
245 | lua_assert(ttisequal(t1, t2)); | 245 | lua_assert(ttisequal(t1, t2)); |
246 | switch (ttype(t1)) { | 246 | switch (ttype(t1)) { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.h,v 2.15 2011/04/05 18:32:06 roberto Exp roberto $ | 2 | ** $Id: lvm.h,v 2.16 2011/05/31 18:24:36 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -17,14 +17,14 @@ | |||
17 | 17 | ||
18 | #define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) | 18 | #define tonumber(o,n) (ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL)) |
19 | 19 | ||
20 | #define equalobj(L,o1,o2) (ttisequal(o1, o2) && luaV_equalval_(L, o1, o2)) | 20 | #define equalobj(L,o1,o2) (ttisequal(o1, o2) && luaV_equalobj_(L, o1, o2)) |
21 | 21 | ||
22 | #define luaV_rawequalObj(t1,t2) \ | 22 | #define luaV_rawequalobj(t1,t2) \ |
23 | (ttisequal(t1,t2) && luaV_equalval_(NULL,t1,t2)) | 23 | (ttisequal(t1,t2) && luaV_equalobj_(NULL,t1,t2)) |
24 | 24 | ||
25 | 25 | ||
26 | /* not to called directly */ | 26 | /* not to called directly */ |
27 | LUAI_FUNC int luaV_equalval_ (lua_State *L, const TValue *t1, const TValue *t2); | 27 | LUAI_FUNC int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2); |
28 | 28 | ||
29 | 29 | ||
30 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); | 30 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); |