Index: trunk/src/lua/lua_area.cc
===================================================================
--- trunk/src/lua/lua_area.cc	(revision 188)
+++ trunk/src/lua/lua_area.cc	(revision 198)
@@ -34,5 +34,5 @@
 }
 
-void nlua_area_construct( lua_State* L, int sidx )
+static void nlua_area_construct( lua_State* L, int sidx )
 {
 	if ( nlua_is_coord( L, sidx ) )
@@ -412,5 +412,5 @@
 
 
-int luaopen_area( lua_State * L )
+static int luaopen_area( lua_State * L )
 {
 	static const struct luaL_Reg nlua_area_sf [] = {
Index: trunk/src/lua/lua_aux.cc
===================================================================
--- trunk/src/lua/lua_aux.cc	(revision 188)
+++ trunk/src/lua/lua_aux.cc	(revision 198)
@@ -95,5 +95,5 @@
 	if ( dice < 1 )  luaL_argerror( L, 1, "die count lower than 1!" );
 	if ( sides < 1 ) luaL_argerror( L, 2, "side count lower than 1!" );
-	lua_pushnumber( L, nv::random::get().dice( dice, sides ) );
+	lua_pushnumber( L, nv::random::get().dice( static_cast< nv::uint32 >( dice ), static_cast< nv::uint32 >( sides ) ) );
 	return 1;
 }
@@ -111,5 +111,5 @@
 			int arg1 = luaL_checkinteger( L, 1 );
 			if ( arg1 < 1 ) arg1 = 1;
-			lua_pushunsigned( L, nv::random::get().urange( 1, arg1 ) );
+			lua_pushunsigned( L, nv::random::get().urange( 1, static_cast<nv::uint32>( arg1 ) ) );
 		}
 		else
@@ -126,5 +126,5 @@
 static int nluaaux_math_randomseed( lua_State* L )
 {
-	nv::random::get().set_seed( static_cast< nv::uint32 > ( L, 1 ) );
+	nv::random::get().set_seed( lua_tounsigned( L, 1 ) );
 	return 0;
 }
Index: trunk/src/lua/lua_function.cc
===================================================================
--- trunk/src/lua/lua_function.cc	(revision 188)
+++ trunk/src/lua/lua_function.cc	(revision 198)
@@ -11,7 +11,7 @@
 using namespace nv;
 
-lua::function_base::function_base( lua_State* L, const path& a_path, bool global /*= true*/ ) : L(L)
+lua::function_base::function_base( lua_State* a_L, const path& a_path, bool a_global /*= true*/ ) : L(a_L)
 {
-	if ( !a_path.resolve( L, global ) )
+	if ( !a_path.resolve( L, a_global ) )
 	{
 		lua_pop( L, 1 );
@@ -27,5 +27,5 @@
 }
 
-lua::function_base::function_base( const function_base& func ) : L(L)
+lua::function_base::function_base( const function_base& func ) : L(func.L)
 {
 	lua_rawgeti( L, LUA_REGISTRYINDEX, func.m_ref );
Index: trunk/src/lua/lua_map_area.cc
===================================================================
--- trunk/src/lua/lua_map_area.cc	(revision 188)
+++ trunk/src/lua/lua_map_area.cc	(revision 198)
@@ -15,34 +15,34 @@
 typedef nv::flags<512> cell_set;
 
-nv::uint32 nlua_to_cell_id( lua_State* L, int index, nv::map_area* map )
+static nv::uint32 nlua_to_cell_id( lua_State* L, int index, nv::map_area* map )
 {
 	if ( lua_type( L, index ) == LUA_TSTRING ) 
 		return map->string_to_id( lua_tostring( L, index ) );
 	else
-		return (nv::uint32)lua_tointeger( L, index );
-}
-
-cell_set nlua_to_cell_set( lua_State* L, int index, nv::map_area* map )
-{
-	cell_set result;
-	switch ( lua_type( L, index ) )
-	{
-	case LUA_TTABLE :	
-		{
-			lua_pushnil( L );
-			while ( lua_next( L, index ) != 0 )
-			{
-				if ( lua_type( L, -1 ) == LUA_TSTRING )
-					result.set( map->string_to_id( lua_tostring( L, -1 ) ), true );
-				else
-					result.set( lua_tointeger( L, -1 ), true );
-				lua_pop( L, 1 );
-			}
-		} break;
-	case LUA_TSTRING : result.set( map->string_to_id( lua_tostring( L, index ) ), true ); break;
-	case LUA_TNUMBER : result.set( lua_tointeger( L, index ), true ); break;
-	}
-	return result;
-}
+		return lua_tounsigned( L, index );
+}
+
+// static cell_set nlua_to_cell_set( lua_State* L, int index, nv::map_area* map )
+// {
+// 	cell_set result;
+// 	switch ( lua_type( L, index ) )
+// 	{
+// 	case LUA_TTABLE :	
+// 		{
+// 			lua_pushnil( L );
+// 			while ( lua_next( L, index ) != 0 )
+// 			{
+// 				if ( lua_type( L, -1 ) == LUA_TSTRING )
+// 					result.set( map->string_to_id( lua_tostring( L, -1 ) ), true );
+// 				else
+// 					result.set( lua_tounsigned( L, -1 ), true );
+// 				lua_pop( L, 1 );
+// 			}
+// 		} break;
+// 	case LUA_TSTRING : result.set( map->string_to_id( lua_tostring( L, index ) ), true ); break;
+// 	case LUA_TNUMBER : result.set( lua_tounsigned( L, index ), true ); break;
+// 	}
+// 	return result;
+// }
 
 bool nlua_is_map_area( lua_State* L, int index )
@@ -118,5 +118,5 @@
 {
 	nv::map_area* ma = nlua_to_map_area( L, 1 );
-	lua_pushinteger( L, ma->get_cell( nlua_to_coord( L, 2 ) ) );
+	lua_pushunsigned( L, ma->get_cell( nlua_to_coord( L, 2 ) ) );
 	return 1;
 }
@@ -125,5 +125,5 @@
 {
 	nv::map_area* ma = nlua_to_map_area( L, 1 );
-	ma->set_cell( nlua_to_coord( L, 2 ), lua_tointeger( L, 3 ) );
+	ma->set_cell( nlua_to_coord( L, 2 ), lua_tounsigned( L, 3 ) );
 	return 0;
 }
@@ -140,5 +140,5 @@
 	else
 	{
-		lua_pushinteger( L, ma->get_cell( nlua_to_coord( L, 2 ) ) );
+		lua_pushunsigned( L, ma->get_cell( nlua_to_coord( L, 2 ) ) );
 	}
 	return 1;
@@ -148,5 +148,5 @@
 {
 	nv::map_area* ma = nlua_to_map_area( L, 1 );
-	ma->set_cell( nlua_to_coord( L, 2 ), lua_tointeger( L, 3 ) );
+	ma->set_cell( nlua_to_coord( L, 2 ), lua_tounsigned( L, 3 ) );
 	return 0;
 }
@@ -179,5 +179,5 @@
 };
 
-int luaopen_map_area( lua_State * L )
+static int luaopen_map_area( lua_State * L )
 {
 	luaL_newmetatable( L, NLUA_MAP_AREA_METATABLE );
Index: trunk/src/lua/lua_path.cc
===================================================================
--- trunk/src/lua/lua_path.cc	(revision 188)
+++ trunk/src/lua/lua_path.cc	(revision 198)
@@ -23,5 +23,5 @@
 }
 
-lua::path::path( int i )
+lua::path::path( unsigned i )
 	: m_count(0)
 {
@@ -88,5 +88,5 @@
 			else
 			{
-				lua_pushinteger( L, m_elements[i].value );
+				lua_pushunsigned( L, m_elements[i].value );
 			}
 			lua_gettable( L, -2 );
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 188)
+++ trunk/src/lua/lua_state.cc	(revision 198)
@@ -257,5 +257,5 @@
 {
 	lua_getfield( L->L, -1, element.c_str() );
-	int result = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tounsigned( L->L, -1 ) : defval;
+	unsigned result = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tounsigned( L->L, -1 ) : defval;
 	lua_pop( L->L, 1 );
 	return result;
