Index: trunk/src/lib/lua.cc
===================================================================
--- trunk/src/lib/lua.cc	(revision 173)
+++ trunk/src/lib/lua.cc	(revision 198)
@@ -66,6 +66,6 @@
 
 // only loaded in 5.1 mode to implement lua_compare
-int    (*lua_equal)        (lua_State *L, int idx1, int idx2) = nullptr;
-int    (*lua_lessthan)     (lua_State *L, int idx1, int idx2) = nullptr;
+static int    (*lua_equal)        (lua_State *L, int idx1, int idx2) = nullptr;
+static int    (*lua_lessthan)     (lua_State *L, int idx1, int idx2) = nullptr;
 
 
@@ -75,5 +75,5 @@
 
 #	define NV_LUA_COMPAT_FUN( rt, fn, fp, rt2, fn2, fp2,arg,ret ) \
-		rt call_##fn2##_compat fp { ret fn2##_compat arg; } 
+		static rt call_##fn2##_compat fp { ret fn2##_compat arg; } 
 #	include <nv/lib/detail/lua_functions_compat.inc>
 #	undef NV_LUA_COMPAT_FUN
@@ -85,11 +85,9 @@
 #	define LUA_GLOBALSINDEX_52      2
 #	define LUA_REGISTRYINDEX_51     (-10000)
-#	define lua_upvalueindex_51(i)   (LUA_GLOBALSINDEX_51-(i))
-#	define lua_upvalueindex_52(i)   (LUA_REGISTRYINDEX_52-(i))
-
-int lua_absindex_51 (lua_State *L, int idx) { return (idx > 0 ? idx : idx + lua_gettop(L) + 1); };
-void lua_getglobal_51 (lua_State *L, const char *var) { lua_getfield(L, LUA_GLOBALSINDEX_51, var ); };
-void lua_setglobal_51 (lua_State *L, const char *var) { lua_setfield(L, LUA_GLOBALSINDEX_51, var ); };
-void luaL_requiref_51 (lua_State *L, const char *modname, lua_CFunction openf, int glb)
+
+static int lua_absindex_51 (lua_State *L, int idx) { return (idx > 0 ? idx : idx + lua_gettop(L) + 1); };
+static void lua_getglobal_51 (lua_State *L, const char *var) { lua_getfield(L, LUA_GLOBALSINDEX_51, var ); };
+static void lua_setglobal_51 (lua_State *L, const char *var) { lua_setfield(L, LUA_GLOBALSINDEX_51, var ); };
+static void luaL_requiref_51 (lua_State *L, const char *modname, lua_CFunction openf, int glb)
 {
 	lua_pushcfunction(L, openf);
@@ -105,5 +103,5 @@
 }
 
-void luaL_setmetatable_51 (lua_State *L, const char *tname)
+static void luaL_setmetatable_51 (lua_State *L, const char *tname)
 {
 	luaL_getmetatable(L, tname);
@@ -111,5 +109,5 @@
 }
 
-void *luaL_testudata_51 (lua_State *L, int ud, const char *tname)
+static void *luaL_testudata_51 (lua_State *L, int ud, const char *tname)
 {
 	void *p = lua_touserdata(L, ud);
@@ -128,5 +126,5 @@
 }
 
-const lua_Number *lua_version_51 (lua_State*) 
+static const lua_Number *lua_version_51 (lua_State*) 
 {
 	static const lua_Number version = (lua_Number)LUA_VERSION_NUM;
@@ -134,5 +132,5 @@
 }
 
-void lua_copy_51 (lua_State *L, int fromidx, int toidx)
+static void lua_copy_51 (lua_State *L, int fromidx, int toidx)
 {
 	toidx = lua_absindex( L, toidx );
@@ -141,5 +139,5 @@
 }
 
-int lua_compare_51(lua_State *L, int idx1, int idx2, int op)
+static int lua_compare_51(lua_State *L, int idx1, int idx2, int op)
 {
 	switch (op)
@@ -153,5 +151,5 @@
 }
 
-void lua_rawgetp_51(lua_State *L, int idx, const void *p)
+static void lua_rawgetp_51(lua_State *L, int idx, const void *p)
 {
 	idx = lua_absindex( L, idx );
@@ -161,5 +159,5 @@
 }
 
-void lua_rawsetp_51(lua_State *L, int idx, const void *p)
+static void lua_rawsetp_51(lua_State *L, int idx, const void *p)
 {
 	idx = lua_absindex( L, idx );
@@ -170,5 +168,5 @@
 }
 
-int luaL_getsubtable_51(lua_State *L, int idx, const char *fname)
+static int luaL_getsubtable_51(lua_State *L, int idx, const char *fname)
 {
 	lua_getfield(L, idx, fname);
@@ -184,5 +182,5 @@
 }
 
-void luaL_setfuncs_51(lua_State *L, const luaL_Reg *l, int nup)
+static void luaL_setfuncs_51(lua_State *L, const luaL_Reg *l, int nup)
 {
 	luaL_checkstack(L, nup, "too many upvalues");
@@ -199,10 +197,10 @@
 }
 
-void lua_pushglobaltable_51(lua_State* L)
+static void lua_pushglobaltable_51(lua_State* L)
 {
 	lua_pushvalue( L, LUA_GLOBALSINDEX_51 );
 }
 
-void lua_pushglobaltable_52(lua_State* L)
+static void lua_pushglobaltable_52(lua_State* L)
 {
 	lua_rawgeti( L, LUA_REGISTRYINDEX_52, LUA_GLOBALSINDEX_52 );
