aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-11 09:45:00 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-11 09:45:00 -0300
commit71c716e5a88a6993369505c79cd1383ef27366c4 (patch)
treec8b32cf297e5a6faca854c527fd9ea2056f615db
parent51ad2f11623c25874b6a0e721e0597df784068ff (diff)
downloadlua-71c716e5a88a6993369505c79cd1383ef27366c4.tar.gz
lua-71c716e5a88a6993369505c79cd1383ef27366c4.tar.bz2
lua-71c716e5a88a6993369505c79cd1383ef27366c4.zip
avoid C identifiers beginning with '_'
-rw-r--r--ldebug.c10
-rw-r--r--ldo.c6
-rw-r--r--lobject.h20
-rw-r--r--lstate.c10
-rw-r--r--lstate.h6
-rw-r--r--ltable.h6
-rw-r--r--luadebug.h4
7 files changed, 31 insertions, 31 deletions
diff --git a/ldebug.c b/ldebug.c
index 6f9bf9e9..48ea5a0b 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.100 2002/02/05 22:39:12 roberto Exp $ 2** $Id: ldebug.c,v 1.101 2002/03/08 19:10:32 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -59,7 +59,7 @@ LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
59 lua_lock(L); 59 lua_lock(L);
60 if (L->ci - L->base_ci <= level) status = 0; /* there is no such level */ 60 if (L->ci - L->base_ci <= level) status = 0; /* there is no such level */
61 else { 61 else {
62 ar->_ci = (L->ci - L->base_ci) - level; 62 ar->i_ci = (L->ci - L->base_ci) - level;
63 status = 1; 63 status = 1;
64 } 64 }
65 lua_unlock(L); 65 lua_unlock(L);
@@ -129,7 +129,7 @@ LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
129 Proto *fp; 129 Proto *fp;
130 lua_lock(L); 130 lua_lock(L);
131 name = NULL; 131 name = NULL;
132 ci = L->base_ci + ar->_ci; 132 ci = L->base_ci + ar->i_ci;
133 fp = getluaproto(ci); 133 fp = getluaproto(ci);
134 if (fp) { /* is a Lua function? */ 134 if (fp) { /* is a Lua function? */
135 name = luaF_getlocalname(fp, n, currentpc(L, ci)); 135 name = luaF_getlocalname(fp, n, currentpc(L, ci));
@@ -147,7 +147,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
147 Proto *fp; 147 Proto *fp;
148 lua_lock(L); 148 lua_lock(L);
149 name = NULL; 149 name = NULL;
150 ci = L->base_ci + ar->_ci; 150 ci = L->base_ci + ar->i_ci;
151 fp = getluaproto(ci); 151 fp = getluaproto(ci);
152 L->top--; /* pop new value */ 152 L->top--; /* pop new value */
153 if (fp) { /* is a Lua function? */ 153 if (fp) { /* is a Lua function? */
@@ -216,7 +216,7 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
216 int status = 1; 216 int status = 1;
217 lua_lock(L); 217 lua_lock(L);
218 if (*what != '>') { /* function is active? */ 218 if (*what != '>') { /* function is active? */
219 ci = L->base_ci + ar->_ci; 219 ci = L->base_ci + ar->i_ci;
220 f = ci->base - 1; 220 f = ci->base - 1;
221 } 221 }
222 else { 222 else {
diff --git a/ldo.c b/ldo.c
index 321523af..1d468019 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.161 2002/03/07 18:14:29 roberto Exp roberto $ 2** $Id: ldo.c,v 1.162 2002/03/08 19:11:03 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -124,7 +124,7 @@ void luaD_lineHook (lua_State *L, int line, lua_Hook linehook) {
124 if (L->allowhooks) { 124 if (L->allowhooks) {
125 lua_Debug ar; 125 lua_Debug ar;
126 ar.event = "line"; 126 ar.event = "line";
127 ar._ci = L->ci - L->base_ci; 127 ar.i_ci = L->ci - L->base_ci;
128 ar.currentline = line; 128 ar.currentline = line;
129 dohook(L, &ar, linehook); 129 dohook(L, &ar, linehook);
130 } 130 }
@@ -135,7 +135,7 @@ static void luaD_callHook (lua_State *L, lua_Hook callhook, const char *event) {
135 if (L->allowhooks) { 135 if (L->allowhooks) {
136 lua_Debug ar; 136 lua_Debug ar;
137 ar.event = event; 137 ar.event = event;
138 ar._ci = L->ci - L->base_ci; 138 ar.i_ci = L->ci - L->base_ci;
139 L->ci->pc = NULL; /* function is not active */ 139 L->ci->pc = NULL; /* function is not active */
140 dohook(L, &ar, callhook); 140 dohook(L, &ar, callhook);
141 } 141 }
diff --git a/lobject.h b/lobject.h
index 873fdc93..a33f28b4 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.124 2002/02/08 22:42:41 roberto Exp roberto $ 2** $Id: lobject.h,v 1.125 2002/03/05 12:42:47 roberto Exp roberto $
3** Type definitions for Lua objects 3** Type definitions for Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -63,29 +63,29 @@ typedef struct lua_TObject {
63 63
64/* Macros to set values */ 64/* Macros to set values */
65#define setnvalue(obj,x) \ 65#define setnvalue(obj,x) \
66 { TObject *_o=(obj); _o->tt=LUA_TNUMBER; _o->value.n=(x); } 66 { TObject *i_o=(obj); i_o->tt=LUA_TNUMBER; i_o->value.n=(x); }
67 67
68#define chgnvalue(obj,x) ((obj)->value.n=(x)) 68#define chgnvalue(obj,x) ((obj)->value.n=(x))
69 69
70#define setbvalue(obj,x) \ 70#define setbvalue(obj,x) \
71 { TObject *_o=(obj); _o->tt=LUA_TBOOLEAN; _o->value.b=(x); } 71 { TObject *i_o=(obj); i_o->tt=LUA_TBOOLEAN; i_o->value.b=(x); }
72 72
73#define setsvalue(obj,x) \ 73#define setsvalue(obj,x) \
74 { TObject *_o=(obj); _o->tt=LUA_TSTRING; _o->value.ts=(x); } 74 { TObject *i_o=(obj); i_o->tt=LUA_TSTRING; i_o->value.ts=(x); }
75 75
76#define setuvalue(obj,x) \ 76#define setuvalue(obj,x) \
77 { TObject *_o=(obj); _o->tt=LUA_TUSERDATA; _o->value.u=(x); } 77 { TObject *i_o=(obj); i_o->tt=LUA_TUSERDATA; i_o->value.u=(x); }
78 78
79#define setclvalue(obj,x) \ 79#define setclvalue(obj,x) \
80 { TObject *_o=(obj); _o->tt=LUA_TFUNCTION; _o->value.cl=(x); } 80 { TObject *i_o=(obj); i_o->tt=LUA_TFUNCTION; i_o->value.cl=(x); }
81 81
82#define sethvalue(obj,x) \ 82#define sethvalue(obj,x) \
83 { TObject *_o=(obj); _o->tt=LUA_TTABLE; _o->value.h=(x); } 83 { TObject *i_o=(obj); i_o->tt=LUA_TTABLE; i_o->value.h=(x); }
84 84
85#define setnilvalue(obj) ((obj)->tt=LUA_TNIL) 85#define setnilvalue(obj) ((obj)->tt=LUA_TNIL)
86 86
87#define setupvalue(obj,x,t) \ 87#define setupvalue(obj,x,t) \
88 { TObject *_o=(obj); _o->tt=(t); _o->value.v=(x); } 88 { TObject *i_o=(obj); i_o->tt=(t); i_o->value.v=(x); }
89 89
90#define setobj(obj1,obj2) \ 90#define setobj(obj1,obj2) \
91 { TObject *o1=(obj1); const TObject *o2=(obj2); \ 91 { TObject *o1=(obj1); const TObject *o2=(obj2); \
@@ -213,8 +213,8 @@ typedef union Closure {
213*/ 213*/
214 214
215typedef struct Node { 215typedef struct Node {
216 TObject _key; 216 TObject i_key;
217 TObject _val; 217 TObject i_val;
218 struct Node *next; /* for chaining */ 218 struct Node *next; /* for chaining */
219} Node; 219} Node;
220 220
diff --git a/lstate.c b/lstate.c
index 45a0cec9..5f7e48a6 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 1.85 2002/03/05 16:22:54 roberto Exp roberto $ 2** $Id: lstate.c,v 1.86 2002/03/07 18:14:29 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -46,7 +46,7 @@ static void stack_init (lua_State *L, lua_State *OL) {
46static void f_luaopen (lua_State *L, void *ud) { 46static void f_luaopen (lua_State *L, void *ud) {
47 UNUSED(ud); 47 UNUSED(ud);
48 /* create a new global state */ 48 /* create a new global state */
49 L->_G = luaM_new(L, global_State); 49 L->l_G = luaM_new(L, global_State);
50 G(L)->strt.size = 0; 50 G(L)->strt.size = 0;
51 G(L)->strt.nuse = 0; 51 G(L)->strt.nuse = 0;
52 G(L)->strt.hash = NULL; 52 G(L)->strt.hash = NULL;
@@ -91,7 +91,7 @@ LUA_API lua_State *lua_newthread (lua_State *OL) {
91 lua_lock(OL); 91 lua_lock(OL);
92 L = luaM_new(OL, lua_State); 92 L = luaM_new(OL, lua_State);
93 preinit_state(L); 93 preinit_state(L);
94 L->_G = OL->_G; 94 L->l_G = OL->l_G;
95 OL->next->previous = L; /* insert L into linked list */ 95 OL->next->previous = L; /* insert L into linked list */
96 L->next = OL->next; 96 L->next = OL->next;
97 OL->next = L; 97 OL->next = L;
@@ -111,7 +111,7 @@ LUA_API lua_State *lua_open (void) {
111 L = luaM_new(NULL, lua_State); 111 L = luaM_new(NULL, lua_State);
112 if (L) { /* allocation OK? */ 112 if (L) { /* allocation OK? */
113 preinit_state(L); 113 preinit_state(L);
114 L->_G = NULL; 114 L->l_G = NULL;
115 L->next = L->previous = L; 115 L->next = L->previous = L;
116 if (luaD_runprotected(L, f_luaopen, NULL) != 0) { 116 if (luaD_runprotected(L, f_luaopen, NULL) != 0) {
117 /* memory allocation error: free partial state */ 117 /* memory allocation error: free partial state */
@@ -146,7 +146,7 @@ static void close_state (lua_State *L) {
146 lua_assert(G(L)->roottable == NULL); 146 lua_assert(G(L)->roottable == NULL);
147 luaS_freeall(L); 147 luaS_freeall(L);
148 luaM_freearray(L, G(L)->Mbuffer, G(L)->Mbuffsize, char); 148 luaM_freearray(L, G(L)->Mbuffer, G(L)->Mbuffsize, char);
149 luaM_freelem(NULL, L->_G); 149 luaM_freelem(NULL, L->l_G);
150 } 150 }
151 luaE_closethread(NULL, L); 151 luaE_closethread(NULL, L);
152} 152}
diff --git a/lstate.h b/lstate.h
index 48293f05..af56ee40 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.77 2002/02/14 21:47:29 roberto Exp roberto $ 2** $Id: lstate.h,v 1.78 2002/03/07 18:11:51 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -132,7 +132,7 @@ struct lua_State {
132 StkId stack; /* stack base */ 132 StkId stack; /* stack base */
133 CallInfo *end_ci; /* points after end of ci array*/ 133 CallInfo *end_ci; /* points after end of ci array*/
134 CallInfo *base_ci; /* array of CallInfo's */ 134 CallInfo *base_ci; /* array of CallInfo's */
135 global_State *_G; 135 global_State *l_G;
136 struct lua_longjmp *errorJmp; /* current error recover point */ 136 struct lua_longjmp *errorJmp; /* current error recover point */
137 UpVal *openupval; /* list of open upvalues in this stack */ 137 UpVal *openupval; /* list of open upvalues in this stack */
138 lua_State *next; /* circular double linked list of states */ 138 lua_State *next; /* circular double linked list of states */
@@ -145,7 +145,7 @@ struct lua_State {
145}; 145};
146 146
147 147
148#define G(L) (L->_G) 148#define G(L) (L->l_G)
149 149
150 150
151void luaE_closethread (lua_State *OL, lua_State *L); 151void luaE_closethread (lua_State *OL, lua_State *L);
diff --git a/ltable.h b/ltable.h
index 854f5344..c42f1059 100644
--- a/ltable.h
+++ b/ltable.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ 2** $Id: ltable.h,v 1.40 2002/02/14 21:41:08 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*/
@@ -11,8 +11,8 @@
11 11
12 12
13#define node(t,i) (&(t)->node[i]) 13#define node(t,i) (&(t)->node[i])
14#define key(n) (&(n)->_key) 14#define key(n) (&(n)->i_key)
15#define val(n) (&(n)->_val) 15#define val(n) (&(n)->i_val)
16 16
17#define settableval(p,v) setobj(cast(TObject *, p), v) 17#define settableval(p,v) setobj(cast(TObject *, p), v)
18 18
diff --git a/luadebug.h b/luadebug.h
index bf0a359d..4ffc4706 100644
--- a/luadebug.h
+++ b/luadebug.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luadebug.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ 2** $Id: luadebug.h,v 1.24 2002/02/08 22:42:41 roberto Exp roberto $
3** Debugging API 3** Debugging API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -38,7 +38,7 @@ struct lua_Debug {
38 int linedefined; /* (S) */ 38 int linedefined; /* (S) */
39 char short_src[LUA_IDSIZE]; /* (S) */ 39 char short_src[LUA_IDSIZE]; /* (S) */
40 /* private part */ 40 /* private part */
41 int _ci; /* active function */ 41 int i_ci; /* active function */
42}; 42};
43 43
44 44