浏览代码

luaH_[gs]etnum renamed to luaH_[gs]etint (as they only accept integers,
not generic numbers)

Roberto Ierusalimschy 16 年之前
父节点
当前提交
3135a6bbab
共有 4 个文件被更改,包括 10 次插入10 次删除
  1. 3 3
      lapi.c
  2. 2 2
      ldebug.c
  3. 3 3
      ltable.h
  4. 2 2
      lvm.c

+ 3 - 3
lapi.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lapi.c,v 2.86 2009/07/15 17:57:03 roberto Exp roberto $
+** $Id: lapi.c,v 2.87 2009/07/15 18:37:19 roberto Exp roberto $
 ** Lua API
 ** Lua API
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -562,7 +562,7 @@ LUA_API void lua_rawgeti (lua_State *L, int idx, int n) {
   lua_lock(L);
   lua_lock(L);
   o = index2addr(L, idx);
   o = index2addr(L, idx);
   api_check(L, ttistable(o));
   api_check(L, ttistable(o));
-  setobj2s(L, L->top, luaH_getnum(hvalue(o), n));
+  setobj2s(L, L->top, luaH_getint(hvalue(o), n));
   api_incr_top(L);
   api_incr_top(L);
   lua_unlock(L);
   lua_unlock(L);
 }
 }
@@ -683,7 +683,7 @@ LUA_API void lua_rawseti (lua_State *L, int idx, int n) {
   api_checknelems(L, 1);
   api_checknelems(L, 1);
   o = index2addr(L, idx);
   o = index2addr(L, idx);
   api_check(L, ttistable(o));
   api_check(L, ttistable(o));
-  setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1);
+  setobj2t(L, luaH_setint(L, hvalue(o), n), L->top-1);
   luaC_barriert(L, hvalue(o), L->top-1);
   luaC_barriert(L, hvalue(o), L->top-1);
   L->top--;
   L->top--;
   lua_unlock(L);
   lua_unlock(L);

+ 2 - 2
ldebug.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ldebug.c,v 2.51 2009/06/01 19:09:26 roberto Exp roberto $
+** $Id: ldebug.c,v 2.52 2009/06/10 16:57:53 roberto Exp roberto $
 ** Debug Interface
 ** Debug Interface
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -191,7 +191,7 @@ static void collectvalidlines (lua_State *L, Closure *f) {
     sethvalue(L, L->top, t);
     sethvalue(L, L->top, t);
     incr_top(L);
     incr_top(L);
     for (i=0; i<f->l.p->sizelineinfo; i++)
     for (i=0; i<f->l.p->sizelineinfo; i++)
-      setbvalue(luaH_setnum(L, t, lineinfo[i]), 1);
+      setbvalue(luaH_setint(L, t, lineinfo[i]), 1);
   }
   }
 }
 }
 
 

+ 3 - 3
ltable.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltable.h,v 2.10 2006/01/10 13:13:06 roberto Exp roberto $
+** $Id: ltable.h,v 2.11 2006/07/11 15:53:29 roberto Exp roberto $
 ** Lua tables (hash)
 ** Lua tables (hash)
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -18,8 +18,8 @@
 #define key2tval(n)	(&(n)->i_key.tvk)
 #define key2tval(n)	(&(n)->i_key.tvk)
 
 
 
 
-LUAI_FUNC const TValue *luaH_getnum (Table *t, int key);
-LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key);
+LUAI_FUNC const TValue *luaH_getint (Table *t, int key);
+LUAI_FUNC TValue *luaH_setint (lua_State *L, Table *t, int key);
 LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
 LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);
 LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
 LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key);
 LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);
 LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);

+ 2 - 2
lvm.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lvm.c,v 2.94 2009/07/01 20:31:25 roberto Exp roberto $
+** $Id: lvm.c,v 2.95 2009/07/15 18:38:16 roberto Exp roberto $
 ** Lua virtual machine
 ** Lua virtual machine
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -754,7 +754,7 @@ void luaV_execute (lua_State *L) {
           luaH_resizearray(L, h, last);  /* pre-alloc it at once */
           luaH_resizearray(L, h, last);  /* pre-alloc it at once */
         for (; n > 0; n--) {
         for (; n > 0; n--) {
           TValue *val = ra+n;
           TValue *val = ra+n;
-          setobj2t(L, luaH_setnum(L, h, last--), val);
+          setobj2t(L, luaH_setint(L, h, last--), val);
           luaC_barriert(L, h, val);
           luaC_barriert(L, h, val);
         }
         }
         L->top = ci->top;  /* correct top (in case of previous open call) */
         L->top = ci->top;  /* correct top (in case of previous open call) */