瀏覽代碼

some warnings

Roberto Ierusalimschy 23 年之前
父節點
當前提交
f42cc90d2d
共有 4 個文件被更改,包括 5 次插入6 次删除
  1. 2 2
      lfunc.c
  2. 1 1
      lparser.c
  3. 2 2
      ltable.c
  4. 0 1
      lua.h

+ 2 - 2
lfunc.c

@@ -29,7 +29,7 @@ Closure *luaF_newCclosure (lua_State *L, int nelems) {
   c->c.next = G(L)->rootcl;
   G(L)->rootcl = c;
   c->c.marked = 0;
-  c->c.nupvalues = nelems;
+  c->c.nupvalues = cast(short, nelems);
   return c;
 }
 
@@ -40,7 +40,7 @@ Closure *luaF_newLclosure (lua_State *L, int nelems) {
   c->c.next = G(L)->rootcl;
   G(L)->rootcl = c;
   c->l.marked = 0;
-  c->l.nupvalues = nelems;
+  c->l.nupvalues = cast(short, nelems);
   return c;
 }
 

+ 1 - 1
lparser.c

@@ -443,7 +443,7 @@ static void funcargs (LexState *ls, expdesc *f) {
     }
     default: {
       luaK_error(ls, "function arguments expected");
-      break;
+      return;
     }
   }
   lua_assert(f->k == VNONRELOC);

+ 2 - 2
ltable.c

@@ -1,5 +1,5 @@
 /*
-** $Id: ltable.c,v 1.93 2001/12/11 22:48:44 roberto Exp roberto $
+** $Id: ltable.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
 ** Lua tables (hash)
 ** See Copyright Notice in lua.h
 */
@@ -275,7 +275,7 @@ Table *luaH_new (lua_State *L, int narray, int lnhash) {
   G(L)->roottable = t;
   t->mark = t;
   t->weakmode = 0;
-  t->flags = ~0;
+  t->flags = cast(unsigned short, ~0);
   /* temporary values (kept only if some malloc fails) */
   t->array = NULL;
   t->sizearray = 0;

+ 0 - 1
lua.h

@@ -155,7 +155,6 @@ LUA_API void  lua_gettable (lua_State *L, int index);
 LUA_API void  lua_rawget (lua_State *L, int index);
 LUA_API void  lua_rawgeti (lua_State *L, int index, int n);
 LUA_API void  lua_newtable (lua_State *L);
-LUA_API void  lua_getweakregistry (lua_State *L);
 LUA_API void  lua_geteventtable (lua_State *L, int objindex);