Browse Source

field G renamed to _G to avoid problemas with bugged macro-systems
(there is a macro named G too)

Roberto Ierusalimschy 24 years ago
parent
commit
617008f552
2 changed files with 9 additions and 9 deletions
  1. 5 5
      lstate.c
  2. 4 4
      lstate.h

+ 5 - 5
lstate.c

@@ -1,5 +1,5 @@
 /*
-** $Id: lstate.c,v 1.70 2001/10/25 19:14:14 roberto Exp roberto $
+** $Id: lstate.c,v 1.71 2001/10/31 19:58:11 roberto Exp $
 ** Global State
 ** See Copyright Notice in lua.h
 */
@@ -39,7 +39,7 @@ static void f_luaopen (lua_State *L, void *ud) {
   else
     so->stacksize += LUA_MINSTACK;
   if (so->L != NULL) {  /* shared global state? */
-    L->G = G(so->L);
+    L->_G = G(so->L);
     L->gt = so->L->gt;  /* share table of globals */
     so->L->next->previous = L;  /* insert L into linked list */
     L->next = so->L->next;
@@ -48,7 +48,7 @@ static void f_luaopen (lua_State *L, void *ud) {
     luaD_init(L, so->stacksize);  /* init stack */
   }
   else {  /* create a new global state */
-    L->G = luaM_new(L, global_State);
+    L->_G = luaM_new(L, global_State);
     G(L)->strt.size = 0;
     G(L)->strt.nuse = 0;
     G(L)->strt.hash = NULL;
@@ -81,7 +81,7 @@ LUA_API lua_State *lua_newthread (lua_State *OL, int stacksize) {
   if (OL) lua_lock(OL);
   L = luaM_new(OL, lua_State);
   if (L) {  /* allocation OK? */
-    L->G = NULL;
+    L->_G = NULL;
     L->stack = NULL;
     L->stacksize = 0;
     L->ci = &L->basefunc;
@@ -121,7 +121,7 @@ static void close_state (lua_State *L, lua_State *OL) {
     luaS_freeall(L);
     luaM_freearray(L, G(L)->TMtable, G(L)->sizeTM, struct TM);
     luaM_freearray(L, G(L)->Mbuffer, G(L)->Mbuffsize, l_char);
-    luaM_freelem(NULL, L->G);
+    luaM_freelem(NULL, L->_G);
   }
   luaM_freearray(OL, L->stack, L->stacksize, TObject);
   luaM_freelem(OL, L);

+ 4 - 4
lstate.h

@@ -1,5 +1,5 @@
 /*
-** $Id: lstate.h,v 1.62 2001/10/25 19:12:21 roberto Exp roberto $
+** $Id: lstate.h,v 1.63 2001/10/31 19:58:11 roberto Exp $
 ** Global State
 ** See Copyright Notice in lua.h
 */
@@ -68,7 +68,7 @@ typedef struct global_State {
   Closure *rootcl;  /* list of all C closures and closed Lua closures */
   Table *roottable;  /* list of all tables */
   Udata *rootudata;   /* list of all userdata */
-  UpVal *rootupval;  /* list of all up values */
+  TObject *rootupval;  /* list of all up values */
 } global_State;
 
 
@@ -81,7 +81,7 @@ struct lua_State {
   CallInfo *ci;  /* call info for current function */
   StkId stack_last;  /* last free slot in the stack */
   TObject gt;  /* table for globals */
-  global_State *G;
+  global_State *_G;
   StkId stack;  /* stack base */
   int stacksize;
   lua_Hook callhook;
@@ -95,7 +95,7 @@ struct lua_State {
 };
 
 
-#define G(L)	(L->G)
+#define G(L)	(L->_G)
 
 
 #endif