Index: trunk/src/lua/lua_map_tile.cc
===================================================================
--- trunk/src/lua/lua_map_tile.cc	(revision 395)
+++ trunk/src/lua/lua_map_tile.cc	(revision 406)
@@ -40,10 +40,10 @@
 static map_tile* nlua_to_pmap_tile( lua_State* L, int index )
 {
-	return (map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE );
+	return reinterpret_cast<map_tile*>( luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE ) );
 }
 
 static void nlua_push_map_tile( lua_State* L, const map_tile& tile )
 {
-	map_tile* result = (map_tile*)lua_newuserdata( L, sizeof(map_tile) );
+	map_tile* result = reinterpret_cast<map_tile*>( lua_newuserdata( L, sizeof(map_tile) ) );
 	*result = tile;
 	luaL_setmetatable( L, NLUA_MAP_TILE_METATABLE );
@@ -65,9 +65,9 @@
 	map_tile tile;
 
-	tile.size_y = (nv::uint16)( nv::count( code.begin(), code.end(), '\n' ) + 1 );
-	tile.size_x = (nv::uint16)( code.find( '\n' ) );
+	tile.size_y = nv::uint16( nv::count( code.begin(), code.end(), '\n' ) + 1 );
+	tile.size_x = nv::uint16( code.find( '\n' ) );
 	if ( tile.size_x == 0 )
 	{
-		tile.size_x = (nv::uint16)code.length();
+		tile.size_x = nv::uint16( code.length() );
 	}
 	tile.data  = new nv::uint8[ tile.size_x * tile.size_y ];
@@ -85,5 +85,5 @@
 			if ( lua_isstring( L, -2 ) && lua_objlen( L, -2 ) == 1 )
 			{
-				translation[ (nv::uint8)( lua_tostring( L, -2 )[0] ) ] = nv::uint8( map_area->string_to_id( lua_tostring( L, -1 ) ) );
+				translation[ nv::uint8( lua_tostring( L, -2 )[0] ) ] = nv::uint8( map_area->string_to_id( lua_tostring( L, -1 ) ) );
 			}
 			// removes 'value'; keeps 'key' for next iteration */
@@ -95,5 +95,5 @@
 		for ( nv::uint16 row = 0; row < tile.size_y; row++ )
 		{
-			nv::uchar8 gylph = (nv::uchar8)code[ row * ( tile.size_x + 1 ) + line ];
+			nv::uchar8 gylph = nv::uchar8( code[ row * ( tile.size_x + 1 ) + line ] );
 			// TODO: check for errors
 			tile.data[ row * tile.size_x + line ] = translation[ gylph ];
@@ -108,5 +108,5 @@
 {
 	map_tile* old_tile = nlua_to_pmap_tile( L, 1 );
-	map_tile* new_tile = (map_tile*) lua_newuserdata( L, sizeof( map_tile ) );
+	map_tile* new_tile = reinterpret_cast<map_tile*>( lua_newuserdata( L, sizeof( map_tile ) ) );
 	new_tile->size_x = old_tile->size_x;
 	new_tile->size_y = old_tile->size_y;
@@ -246,6 +246,6 @@
 	nv::uint16 org_x = tile->size_x;
 	nv::uint16 org_y = tile->size_y;
-	nv::uint16 new_x = ( nv::uint16 )nv::accumulate( sizes_x.begin(), sizes_x.end(), 0 );
-	nv::uint16 new_y = ( nv::uint16 )nv::accumulate( sizes_y.begin(), sizes_y.end(), 0 );
+	nv::uint16 new_x = nv::uint16( nv::accumulate( sizes_x.begin(), sizes_x.end(), 0 ) );
+	nv::uint16 new_y = nv::uint16( nv::accumulate( sizes_y.begin(), sizes_y.end(), 0 ) );
 
 	nv::uint8* data = new nv::uint8[ new_x * new_y ];
@@ -274,5 +274,5 @@
 static int nlua_map_tile_raw_get( lua_State* L )
 {
-	map_tile* tile = (map_tile*)lua_touserdata( L, 1 );
+	map_tile* tile = reinterpret_cast<map_tile*>( lua_touserdata( L, 1 ) );
 	if ( lua_type( L, 2 ) == LUA_TNUMBER )
 	{
@@ -289,13 +289,13 @@
 static int nlua_map_tile_raw_set( lua_State* L )
 {
-	map_tile* tile = (map_tile*)lua_touserdata( L, 1 );
+	map_tile* tile = reinterpret_cast<map_tile*>( lua_touserdata( L, 1 ) );
 	if ( lua_type( L, 2 ) == LUA_TNUMBER )
 	{
-		tile->data[ ( lua_tointeger( L, 2 ) - 1 ) + ( lua_tointeger( L, 3 ) - 1 ) * tile->size_x ] = (nv::uint8)lua_tointeger( L, 3 );
+		tile->data[ ( lua_tointeger( L, 2 ) - 1 ) + ( lua_tointeger( L, 3 ) - 1 ) * tile->size_x ] = nv::uint8( lua_tointeger( L, 3 ) );
 	}
 	else
 	{
 		nv::ivec2 coord = nv::lua::detail::to_coord( L, 2 );
-		tile->data[ ( coord.x - 1 ) + ( coord.y - 1 ) * tile->size_x ] = (nv::uint8)lua_tointeger( L, 3 );
+		tile->data[ ( coord.x - 1 ) + ( coord.y - 1 ) * tile->size_x ] = nv::uint8( lua_tointeger( L, 3 ) );
 	}
 	return 0;
@@ -304,5 +304,5 @@
 static int nlua_map_tile_ascii_get( lua_State* L )
 {
-	map_tile* tile = (map_tile*)lua_touserdata( L, 1 );
+	map_tile* tile = reinterpret_cast<map_tile*>( lua_touserdata( L, 1 ) );
 	if ( lua_type( L, 2 ) == LUA_TNUMBER )
 	{
@@ -319,13 +319,13 @@
 static int nlua_map_tile_ascii_set( lua_State* L )
 {
-	map_tile* tile = (map_tile*)lua_touserdata( L, 1 );
+	map_tile* tile = reinterpret_cast<map_tile*>( lua_touserdata( L, 1 ) );
 	if ( lua_type( L, 2 ) == LUA_TNUMBER )
 	{
-		tile->ascii[ ( lua_tointeger( L, 2 ) - 1 ) + ( lua_tointeger( L, 3 ) - 1 ) * tile->size_x ] = (nv::uint8)lua_tointeger( L, 3 );
+		tile->ascii[ ( lua_tointeger( L, 2 ) - 1 ) + ( lua_tointeger( L, 3 ) - 1 ) * tile->size_x ] = nv::uint8( lua_tointeger( L, 3 ) );
 	}
 	else
 	{
 		nv::ivec2 coord = nv::lua::detail::to_coord( L, 2 );
-		tile->ascii[ ( coord.x - 1 ) + ( coord.y - 1 ) * tile->size_x ] = (nv::uint8)lua_tointeger( L, 3 );
+		tile->ascii[ ( coord.x - 1 ) + ( coord.y - 1 ) * tile->size_x ] = nv::uint8( lua_tointeger( L, 3 ) );
 	}
 	return 0;
@@ -334,5 +334,5 @@
 static int nlua_map_tile_gc( lua_State* L )
 {
-	map_tile* tile = (map_tile*)lua_touserdata( L, 1 );
+	map_tile* tile = reinterpret_cast<map_tile*>( lua_touserdata( L, 1 ) );
 	if ( tile != nullptr )
 	{
