aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-11-12 14:28:45 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-11-12 14:28:45 -0200
commit658e7caf92072fbcb1aac8737e05cb1ea4a90806 (patch)
tree6ff8156ebb68d3f70680b872371962bd8de202a3
parent788506dd586e7da8f8593245286a4e4562c191f1 (diff)
downloadlua-658e7caf92072fbcb1aac8737e05cb1ea4a90806.tar.gz
lua-658e7caf92072fbcb1aac8737e05cb1ea4a90806.tar.bz2
lua-658e7caf92072fbcb1aac8737e05cb1ea4a90806.zip
use prefix in extern names, even those in test files
-rw-r--r--ltests.c22
-rw-r--r--ltests.h8
2 files changed, 15 insertions, 15 deletions
diff --git a/ltests.c b/ltests.c
index c642ff1a..2720516c 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.42 2007/04/17 13:19:53 roberto Exp roberto $ 2** $Id: ltests.c,v 2.43 2007/06/21 13:48:04 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -37,7 +37,7 @@
37#if defined(LUA_DEBUG) 37#if defined(LUA_DEBUG)
38 38
39 39
40int Trick = 0; 40int l_Trick = 0;
41 41
42 42
43static lua_State *lua_state = NULL; 43static lua_State *lua_state = NULL;
@@ -88,7 +88,7 @@ static void pushobject (lua_State *L, const TValue *o) {
88#endif 88#endif
89 89
90 90
91Memcontrol memcontrol = {0L, 0L, 0L, 0L}; 91Memcontrol l_memcontrol = {0L, 0L, 0L, 0L};
92 92
93 93
94static void *checkblock (void *block, size_t size) { 94static void *checkblock (void *block, size_t size) {
@@ -493,20 +493,20 @@ static int get_limits (lua_State *L) {
493 493
494static int mem_query (lua_State *L) { 494static int mem_query (lua_State *L) {
495 if (lua_isnone(L, 1)) { 495 if (lua_isnone(L, 1)) {
496 lua_pushinteger(L, memcontrol.total); 496 lua_pushinteger(L, l_memcontrol.total);
497 lua_pushinteger(L, memcontrol.numblocks); 497 lua_pushinteger(L, l_memcontrol.numblocks);
498 lua_pushinteger(L, memcontrol.maxmem); 498 lua_pushinteger(L, l_memcontrol.maxmem);
499 return 3; 499 return 3;
500 } 500 }
501 else { 501 else {
502 memcontrol.memlimit = luaL_checkint(L, 1); 502 l_memcontrol.memlimit = luaL_checkint(L, 1);
503 return 0; 503 return 0;
504 } 504 }
505} 505}
506 506
507 507
508static int settrick (lua_State *L) { 508static int settrick (lua_State *L) {
509 Trick = lua_tointeger(L, 1); 509 l_Trick = lua_tointeger(L, 1);
510 return 0; 510 return 0;
511} 511}
512 512
@@ -1120,8 +1120,8 @@ static const struct luaL_Reg tests_funcs[] = {
1120 1120
1121 1121
1122static void checkfinalmem (void) { 1122static void checkfinalmem (void) {
1123 lua_assert(memcontrol.numblocks == 0); 1123 lua_assert(l_memcontrol.numblocks == 0);
1124 lua_assert(memcontrol.total == 0); 1124 lua_assert(l_memcontrol.total == 0);
1125} 1125}
1126 1126
1127 1127
@@ -1129,7 +1129,7 @@ int luaB_opentests (lua_State *L) {
1129 void *ud; 1129 void *ud;
1130 atexit(checkfinalmem); 1130 atexit(checkfinalmem);
1131 lua_assert(lua_getallocf(L, &ud) == debug_realloc); 1131 lua_assert(lua_getallocf(L, &ud) == debug_realloc);
1132 lua_assert(ud == cast(void *, &memcontrol)); 1132 lua_assert(ud == cast(void *, &l_memcontrol));
1133 lua_setallocf(L, lua_getallocf(L, NULL), ud); 1133 lua_setallocf(L, lua_getallocf(L, NULL), ud);
1134 lua_state = L; /* keep first state to be opened */ 1134 lua_state = L; /* keep first state to be opened */
1135 luaL_register(L, "T", tests_funcs); 1135 luaL_register(L, "T", tests_funcs);
diff --git a/ltests.h b/ltests.h
index b550fd92..48971eef 100644
--- a/ltests.h
+++ b/ltests.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.h,v 2.18 2006/06/05 19:35:57 roberto Exp roberto $ 2** $Id: ltests.h,v 2.19 2007/09/30 13:09:43 roberto Exp roberto $
3** Internal Header for Debugging of the Lua Implementation 3** Internal Header for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -30,19 +30,19 @@ typedef struct Memcontrol {
30 unsigned long memlimit; 30 unsigned long memlimit;
31} Memcontrol; 31} Memcontrol;
32 32
33LUAI_DATA Memcontrol memcontrol; 33LUAI_DATA Memcontrol l_memcontrol;
34 34
35 35
36/* 36/*
37** generic variable for debug tricks 37** generic variable for debug tricks
38*/ 38*/
39LUAI_DATA int Trick; 39LUAI_DATA int l_Trick;
40 40
41 41
42void *debug_realloc (void *ud, void *block, size_t osize, size_t nsize); 42void *debug_realloc (void *ud, void *block, size_t osize, size_t nsize);
43 43
44#ifdef lua_c 44#ifdef lua_c
45#define luaL_newstate() lua_newstate(debug_realloc, &memcontrol) 45#define luaL_newstate() lua_newstate(debug_realloc, &l_memcontrol)
46#endif 46#endif
47 47
48 48