Index: trunk/src/curses/curses_terminal.cc
===================================================================
--- trunk/src/curses/curses_terminal.cc	(revision 322)
+++ trunk/src/curses/curses_terminal.cc	(revision 323)
@@ -58,5 +58,5 @@
 	if ( color > 7 )
 	{
-		attrset((static_cast<uint32>(color-7) << 24)  & 0xff000000ul | 0x00800000ul);
+		attrset((static_cast<uint32>(color-7) << 24)  & ( 0xff000000ul | 0x00800000ul ) );
 	}
 	else
Index: trunk/src/engine/particle_engine.cc
===================================================================
--- trunk/src/engine/particle_engine.cc	(revision 322)
+++ trunk/src/engine/particle_engine.cc	(revision 323)
@@ -577,5 +577,5 @@
 	case particle_origin::CENTER        : break;
 	case particle_origin::TOP_LEFT      : lb = vec2(0.f,-1.f); rt = vec2(1.f,0.f);  break;
-	case particle_origin::TOP_CENTER    : lb.y = -1.f; rt.y = 0.f; break;  break;
+	case particle_origin::TOP_CENTER    : lb.y = -1.f; rt.y = 0.f; break;
 	case particle_origin::TOP_RIGHT     : lb = vec2(-1.f,-1.f); rt = vec2(); break;
 	case particle_origin::CENTER_LEFT   : lb.x = 0.f; rt.x = 1.f; break;
@@ -663,5 +663,5 @@
 {
 	if ( info->count > 0 )
-		for ( sint32 i = info->count-1; i >= 0; --i )
+		for ( sint32 i = (sint32)info->count-1; i >= 0; --i )
 		{
 			particle& pinfo = info->particles[i];
@@ -723,5 +723,5 @@
 					{
 						float emission_angle = glm::radians( edata.angle );
-						float cos_theta = r.frange( cos( emission_angle ), 1.0f );
+						float cos_theta = r.frange( glm::cos( emission_angle ), 1.0f );
 						float sin_theta = glm::sqrt(1.0f - cos_theta * cos_theta );
 						float phi       = r.frange( 0.0f, 2*glm::pi<float>() );
Index: trunk/src/engine/program_manager.cc
===================================================================
--- trunk/src/engine/program_manager.cc	(revision 322)
+++ trunk/src/engine/program_manager.cc	(revision 323)
@@ -57,5 +57,5 @@
 		for ( uint32 i = 1; i <= count; ++i )
 		{
-			std::string include( inctable.get<std::string,int>(i) );
+			std::string include( inctable.get<std::string,uint32>(i) );
 			if ( i == count ) out += "#line 1\n";
 			out += nv::slurp( include );
Index: trunk/src/engine/resource_system.cc
===================================================================
--- trunk/src/engine/resource_system.cc	(revision 322)
+++ trunk/src/engine/resource_system.cc	(revision 323)
@@ -29,5 +29,5 @@
 	clear();
 	lua::table_guard table( m_lua, get_storage_name() );
-	uint32 count = table.get_integer( "__counter" );
+	uint32 count = table.get_unsigned( "__counter" );
 	for ( auto i : range( count ) )
 	{
Index: trunk/src/formats/assimp_loader.cc
===================================================================
--- trunk/src/formats/assimp_loader.cc	(revision 322)
+++ trunk/src/formats/assimp_loader.cc	(revision 323)
@@ -14,5 +14,5 @@
 using namespace nv;
 
-const int MAX_BONES = 64;
+const unsigned MAX_BONES = 64;
 
 struct assimp_plain_vtx 
@@ -90,5 +90,5 @@
 	m_mesh_count = 0;
 	NV_LOG( nv::LOG_NOTICE, "AssImp loading file..." );
-	int size = (int)source.size();
+	size_t size = source.size();
 	char* data  = new char[ size ];
 	source.read( data, size, 1 );
@@ -159,5 +159,5 @@
 					if ( v.boneweight[i] <= 0.0f ) 
 					{
-						v.boneindex[i] = m;
+						v.boneindex[i]  = (int)m;
 						v.boneweight[i] = bone->mWeights[w].mWeight;
 						found = true;
@@ -289,5 +289,5 @@
 	for ( unsigned int m = 0; m < m_mesh_count; ++m )
 	{
-		sint16 translate[MAX_BONES];
+		uint16 translate[MAX_BONES];
 		std::vector< mesh_node_data > bones;
 		const aiMesh*  mesh  = scene->mMeshes[ m ];
@@ -304,5 +304,5 @@
 				{
 					NV_ASSERT( final_bones.size() < MAX_BONES, "Too many bones to merge!" );
-					sint16 index = (sint16)final_bones.size();
+					uint16 index = (uint16)final_bones.size();
 					final_bones.push_back( bone );
 					names[ bone.name ] = index;
@@ -311,5 +311,5 @@
 				else
 				{
-					translate[b] = (sint16)iname->second;
+					translate[b] = iname->second;
 				}
 			}
@@ -326,5 +326,5 @@
 						if ( vertex.boneweight[i] > 0.0f ) 
 						{
-							vertex.boneindex[i] = translate[vertex.boneindex[i]];
+							vertex.boneindex[i] = (int)translate[vertex.boneindex[i]];
 						}
 					}
Index: trunk/src/formats/md3_loader.cc
===================================================================
--- trunk/src/formats/md3_loader.cc	(revision 322)
+++ trunk/src/formats/md3_loader.cc	(revision 323)
@@ -234,5 +234,5 @@
 
 md3_loader::md3_loader( bool merge_all )
-	: m_md3( nullptr ), m_merge_all( merge_all )
+	: m_merge_all( merge_all ), m_md3( nullptr )
 {
 	if ( !s_normal_ready )
@@ -286,5 +286,5 @@
 {
 	md3_t* md3 = (md3_t*)m_md3;
-	key_raw_channel* result = key_raw_channel::create<md3_key>( md3->header.num_frames );
+	key_raw_channel* result = key_raw_channel::create<md3_key>( (uint32)md3->header.num_frames );
 	// TODO: is this brain damaged in efficiency (loop nest order) or what?
 	for ( sint32 f = 0; f < md3->header.num_frames; ++f )
@@ -322,5 +322,5 @@
 {
 	mesh_data* data = new mesh_data;
-	release_mesh_frame( data, -1, index );
+	release_mesh_frame( data, -1, (sint32)index );
 	return data;
 }
@@ -329,22 +329,22 @@
 {
 	md3_t* md3 = (md3_t*)m_md3;
-	sint32 num_surfaces  = md3->header.num_surfaces;
-	sint32 num_verts     = 0;
-	sint32 current_frame = ( frame == -1 ? 0 : frame );
-	sint32 frame_count   = ( frame == -1 ? md3->header.num_frames : 1 );
-	sint32 current_surf  = ( surface == -1 ? 0 : surface );
-	sint32 surf_count    = ( surface == -1 ? md3->header.num_surfaces : 1 );
-	sint32 index_count   = 0;
+	uint32 num_surfaces  = (uint32)md3->header.num_surfaces;
+	uint32 num_verts     = 0;
+	uint32 current_frame = ( frame == -1 ? 0 : (uint32)frame );
+	uint32 frame_count   = ( frame == -1 ? (uint32)md3->header.num_frames : 1 );
+	uint32 current_surf  = ( surface == -1 ? 0 : (uint32)surface );
+	uint32 surf_count    = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 );
+	uint32 index_count   = 0;
 
 	if ( surface >= 0 )
 	{
-		index_count = md3->surfaces[surface].header.num_triangles * 3;
-		num_verts   = md3->surfaces[surface].header.num_verts;
+		index_count = (uint32)md3->surfaces[(uint32)surface].header.num_triangles * 3;
+		num_verts   = (uint32)md3->surfaces[(uint32)surface].header.num_verts;
 	}
 	else
-		for ( sint32 i = 0; i < num_surfaces; ++i )
-		{
-			index_count += md3->surfaces[i].header.num_triangles * 3;
-			num_verts   += md3->surfaces[i].header.num_verts;
+		for ( uint32 i = 0; i < num_surfaces; ++i )
+		{
+			index_count += (uint32)md3->surfaces[i].header.num_triangles * 3;
+			num_verts   += (uint32)md3->surfaces[i].header.num_verts;
 		}
 
@@ -362,21 +362,21 @@
 	while ( surf_count > 0 )
 	{
-		const md3_surface_t& surface = md3->surfaces[ current_surf ];
-		const uint32         vcount  = static_cast< uint32 >( surface.header.num_verts );
-		const uint32         tcount  = static_cast< uint32 >( surface.header.num_triangles );
+		const md3_surface_t& sface  = md3->surfaces[ current_surf ];
+		const uint32         vcount = static_cast< uint32 >( sface.header.num_verts );
+		const uint32         tcount = static_cast< uint32 >( sface.header.num_triangles );
 
 		for (uint32 j = 0; j < vcount; ++j )
 		{
-			vtx_t[index++].texcoord = md3_texcoord( surface.st[j] );
+			vtx_t[index++].texcoord = md3_texcoord( sface.st[j] );
 		}
 
 		for (size_t j = 0; j < tcount; ++j )
 		{
-			const md3_triangle_t& t = surface.triangles[j];
+			const md3_triangle_t& t = sface.triangles[j];
 			icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[0] );
 			icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[1] );
 			icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[2] );
 		}
-		index_base += surface.header.num_verts;
+		index_base += sface.header.num_verts;
 		++current_surf;
 		--surf_count;
@@ -386,16 +386,16 @@
 	while ( frame_count > 0 )
 	{
-		current_surf  = ( surface == -1 ? 0 : surface );
-		surf_count    = ( surface == -1 ? md3->header.num_surfaces : 1 );
+		current_surf  = ( surface == -1 ? 0 : (uint32)surface );
+		surf_count    = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 );
 
 		while ( surf_count > 0 )
 		{
-			md3_surface_t& surface = md3->surfaces[current_surf];
-			sint32         vcount  = surface.header.num_verts;
-			sint32         offset  = vcount * current_frame;
-			sint32         limit   = vcount + offset;
-			for (sint32 j = offset; j < limit; ++j )
+			md3_surface_t& sface  = md3->surfaces[current_surf];
+			uint32         vcount = (uint32)sface.header.num_verts;
+			uint32         offset = vcount * current_frame;
+			uint32         limit  = vcount + offset;
+			for (uint32 j = offset; j < limit; ++j )
 			{
-				md3_vertex_t& v = surface.vertices[j];
+				md3_vertex_t& v = sface.vertices[j];
 				vtx_pn[index].position = vec3( v.x * MD3_XYZ_SCALE, v.z * MD3_XYZ_SCALE, v.y * MD3_XYZ_SCALE );
 				vtx_pn[index].normal   = s_normal_cache[ v.normal ];
@@ -418,5 +418,5 @@
 {
 	md3_t* md3 = (md3_t*)m_md3;
-	uint32 node_count = md3->header.num_tags;
+	uint32 node_count = (uint32)md3->header.num_tags;
 	if ( node_count == 0 ) return nullptr;;
 	mesh_node_data* nodes = new mesh_node_data[ node_count ];
@@ -451,9 +451,9 @@
 	else
 	{
-		count = md3->header.num_surfaces;
+		count = (uint32)md3->header.num_surfaces;
 		data = new mesh_data[ count ];
 		for ( uint32 i = 0; i < count; ++i )
 		{
-			release_mesh_frame( &data[i], -1, i );
+			release_mesh_frame( &data[i], -1, (sint32)i );
 			data[i].set_name( (char*)md3->surfaces[i].header.name );
 		}
Index: trunk/src/formats/md5_loader.cc
===================================================================
--- trunk/src/formats/md5_loader.cc	(revision 322)
+++ trunk/src/formats/md5_loader.cc	(revision 323)
@@ -135,7 +135,7 @@
 			mesh_data* mesh = new mesh_data("md5_mesh");
 
-			int num_verts   = 0;
-			int num_tris    = 0;
-			int num_weights = 0;
+			uint32 num_verts   = 0;
+			uint32 num_tris    = 0;
+			uint32 num_weights = 0;
 
 			discard( sstream, "{" );
@@ -170,5 +170,5 @@
 					next_line( sstream );
 					std::string line;
-					for ( int i = 0; i < num_verts; ++i )
+					for ( uint32 i = 0; i < num_verts; ++i )
 					{
 						size_t weight_count;
@@ -194,5 +194,5 @@
 					next_line( sstream );
 					std::string line;
-					for ( int i = 0; i < num_tris; ++i )
+					for ( uint32 i = 0; i < num_tris; ++i )
 					{
 						size_t ti0;
@@ -214,5 +214,5 @@
 					next_line( sstream );
 					std::string line;
-					for ( int i = 0; i < num_weights; ++i )
+					for ( uint32 i = 0; i < num_weights; ++i )
 					{
 						md5_weight weight;
@@ -368,5 +368,5 @@
 			if ( j < weight_count )
 			{
-				vdata.boneindex[j]  = weights[start_weight + j].joint_id;
+				vdata.boneindex[j]  = (int)weights[start_weight + j].joint_id;
 				vdata.boneweight[j] = weights[start_weight + j].bias;
 			}
Index: trunk/src/formats/nmd_loader.cc
===================================================================
--- trunk/src/formats/nmd_loader.cc	(revision 322)
+++ trunk/src/formats/nmd_loader.cc	(revision 323)
@@ -242,5 +242,5 @@
 
 		nmd_node_header nheader;
-		nheader.parent_id = (uint16)node->parent_id;
+		nheader.parent_id = node->parent_id;
 		nheader.transform = node->transform;
 		stream_out.write( &nheader, sizeof( nheader ), 1 );
Index: trunk/src/gfx/image.cc
===================================================================
--- trunk/src/gfx/image.cc	(revision 322)
+++ trunk/src/gfx/image.cc	(revision 323)
@@ -89,18 +89,20 @@
 	fill( r, 255 );
 
-	sint32 bpos       = (r.pos.y*m_size.x + r.pos.x ) * static_cast<sint32>( m_depth );
-	sint32 bline      = m_size.x*static_cast<sint32>( m_depth );
+	uint32 bpos       = static_cast< uint32 >( r.pos.y*m_size.x + r.pos.x ) * m_depth;
+	uint32 bline      = static_cast< uint32 >( m_size.x ) * m_depth;
 
+	uint32 rsizex     = static_cast< uint32 >( r.size.x );
+	uint32 rsizey     = static_cast< uint32 >( r.size.y );
 	const uint8* data = idata->get_data();
-	sint32 depth      = idata->get_depth();
-	sint32 dstride    = r.size.x * static_cast<sint32>( depth );
+	size_t depth      = idata->get_depth();
+	uint32 dstride    = rsizex * depth;
 
-	for( int y = 0; y < r.size.y; ++y )
+	for( uint32 y = 0; y < rsizey; ++y )
 	{
-		sint32 pos = bpos + bline * y;
-		for( int x = 0; x < r.size.x; ++x )
+		uint32 pos = bpos + bline * y;
+		for( uint32 x = 0; x < rsizex; ++x )
 		{
-			sint32 xy = pos + x * m_depth;
-			for( int e = 0; e < depth; ++e )
+			uint32 xy = pos + x * m_depth;
+			for( size_t e = 0; e < depth; ++e )
 			{
 				m_data[ xy + e ] = data[ y*dstride + x * depth + e ];
Index: trunk/src/gfx/mesh_creator.cc
===================================================================
--- trunk/src/gfx/mesh_creator.cc	(revision 322)
+++ trunk/src/gfx/mesh_creator.cc	(revision 323)
@@ -128,5 +128,5 @@
 		const vertex_descriptor& desc   = channel->desc;
 		uint8* raw_data = channel->data;
-		int vtx_size = desc.size;
+		uint32 vtx_size = desc.size;
 		int p_offset = -1;
 		int n_offset = -1;
@@ -135,7 +135,7 @@
 			switch ( desc.slots[i].vslot )
 			{
-				case slot::POSITION : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) p_offset = desc.slots[i].offset; break;
-				case slot::NORMAL   : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) n_offset = desc.slots[i].offset; break;
-				case slot::TANGENT  : if ( desc.slots[i].etype == FLOAT_VECTOR_4 ) t_offset = desc.slots[i].offset; break;
+				case slot::POSITION : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) p_offset = (int)desc.slots[i].offset; break;
+				case slot::NORMAL   : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) n_offset = (int)desc.slots[i].offset; break;
+				case slot::TANGENT  : if ( desc.slots[i].etype == FLOAT_VECTOR_4 ) t_offset = (int)desc.slots[i].offset; break;
 				default             : break;
 			}
@@ -173,5 +173,5 @@
 	size_t n_offset = 0;
 	if ( ch_n == -1 ) return;
-	mesh_raw_channel* channel = m_data->m_channels[ch_n];
+	mesh_raw_channel* channel = m_data->m_channels[ (unsigned) ch_n ];
 	for ( uint32 i = 0; i < channel->desc.count; ++i )
 		if ( channel->desc.slots[i].vslot == slot::NORMAL )
@@ -211,5 +211,5 @@
 				if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) 
 				{
-					p_offset  = desc.slots[i].offset; 
+					p_offset  = (int)desc.slots[i].offset; 
 					p_channel = channel;
 				}
@@ -217,5 +217,5 @@
 			case slot::NORMAL   : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) 
 				{
-					n_offset  = desc.slots[i].offset; 
+					n_offset  = (int)desc.slots[i].offset; 
 					n_channel = m_data->m_channels[ c ];
 					n_channel_index = c;
@@ -224,5 +224,5 @@
 			case slot::TEXCOORD : if ( desc.slots[i].etype == FLOAT_VECTOR_2 ) 
 				{
-					t_offset  = desc.slots[i].offset; 
+					t_offset  = (int)desc.slots[i].offset; 
 					t_channel = channel;
 				}
@@ -420,8 +420,8 @@
 	int och_ti = other->get_channel_index( slot::TEXCOORD );
 	if ( ch_pi == -1 || ch_ti == -1 ) return;
-	size_t size   = m_data->m_channels[ ch_ti ]->count;
-	size_t osize  =  other->m_channels[ och_ti ]->count;
-	size_t count  = m_data->m_channels[ ch_pi ]->count;
-	size_t ocount =  other->m_channels[ och_pi ]->count;
+	size_t size   = m_data->m_channels[ (unsigned)ch_ti ]->count;
+	size_t osize  =  other->m_channels[ (unsigned)och_ti ]->count;
+	size_t count  = m_data->m_channels[ (unsigned)ch_pi ]->count;
+	size_t ocount =  other->m_channels[ (unsigned)och_pi ]->count;
 	if ( count % size != 0 || ocount % osize != 0 ) return;
 	if ( count / size != ocount / osize ) return;
Index: trunk/src/gfx/skeletal_mesh.cc
===================================================================
--- trunk/src/gfx/skeletal_mesh.cc	(revision 322)
+++ trunk/src/gfx/skeletal_mesh.cc	(revision 323)
@@ -53,6 +53,6 @@
 				for ( size_t j = 0; j < 4; ++j )
 				{
-					int   index  = vert.boneindex[j];
-					float weight = vert.boneweight[j];
+					unsigned index = (unsigned)vert.boneindex[j];
+					float weight   = vert.boneweight[j];
 					const quat& orient      = m_transform[index].get_orientation();
 					const transform& offset = m_pos_offset[index];
@@ -152,5 +152,5 @@
 		if ( bi != bone_names.end() )
 		{
-			bone_id = bi->second;
+			bone_id = (sint16)bi->second;
 		}
 		m_bone_ids[n] = bone_id;
Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 322)
+++ trunk/src/gl/gl_device.cc	(revision 323)
@@ -132,8 +132,8 @@
 	texture result = m_textures.create();
 	gl_texture_info* info = m_textures.get( result );
-	info->format  = aformat;
-	info->sampler = asampler;
-	info->size    = size;
-	info->glid    = glid;
+	info->format   = aformat;
+	info->tsampler = asampler;
+	info->size     = size;
+	info->glid     = glid;
 	return result;
 }
Index: trunk/src/gl/gl_enum.cc
===================================================================
--- trunk/src/gl/gl_enum.cc	(revision 322)
+++ trunk/src/gl/gl_enum.cc	(revision 323)
@@ -232,5 +232,5 @@
 	case BYTE_VECTOR_3  : return GL_INT_VEC3;
 	case BYTE_VECTOR_4  : return GL_INT_VEC4;
-	NV_RETURN_COVERED_DEFAULT( 0 );
+	default : return 0; // TODO: throw!
 	}
 }
Index: trunk/src/gl/gl_window.cc
===================================================================
--- trunk/src/gl/gl_window.cc	(revision 322)
+++ trunk/src/gl/gl_window.cc	(revision 323)
@@ -19,7 +19,7 @@
 
 #if NV_SDL_VERSION == NV_SDL_20
-	uint32 ucode = ke.keysym.sym;
-#else
-	uint32 ucode = ke.keysym.unicode;
+	uint32 ucode = (uint32)ke.keysym.sym;
+#else
+	uint32 ucode = (uint32)ke.keysym.unicode;
 #endif
 
@@ -34,5 +34,5 @@
 			int capslock = !!(ke.keysym.mod & KMOD_CAPS);
 			if ((shifted ^ capslock) != 0) {
-				kevent.key.ascii = (char8)SDL_toupper(ucode);
+				kevent.key.ascii = (char8)SDL_toupper((int)ucode);
 			}
 		}
Index: trunk/src/lib/gl.cc
===================================================================
--- trunk/src/lib/gl.cc	(revision 322)
+++ trunk/src/lib/gl.cc	(revision 323)
@@ -19,14 +19,9 @@
 // for wgl support
 #if NV_PLATFORM == NV_WINDOWS
-#    ifndef WIN32_LEAN_AND_MEAN
-#      define WIN32_LEAN_AND_MEAN 1
-#    endif
 #include <windows.h>
-#    undef WIN32_LEAN_AND_MEAN
-#endif
-
-// extern added for wgl needs only!
-#define NV_GL_FUN( rtype, fname, fparams ) extern "C" rtype (NV_GL_APIENTRY *fname) fparams = nullptr;
-#define NV_GL_FUN_REN( rtype, fname, rname, fparams ) extern "C" rtype (NV_GL_APIENTRY *rname) fparams = nullptr;
+#endif
+
+#define NV_GL_FUN( rtype, fname, fparams ) rtype (NV_GL_APIENTRY *fname) fparams = nullptr;
+#define NV_GL_FUN_REN( rtype, fname, rname, fparams ) rtype (NV_GL_APIENTRY *rname) fparams = nullptr;
 #define NV_GL_FUN_EXT NV_GL_FUN
 #include <nv/lib/detail/gl_functions.inc>
@@ -41,5 +36,5 @@
 static nv::library gl_library;
 static nv::gl_extensions gl_loaded_extensions = nv::gl_extensions(0);
-extern "C" void* (NV_GL_APIENTRY *gl_ext_loader) ( const char* ) = nullptr;
+static void* (NV_GL_APIENTRY *gl_ext_loader) ( const char* ) = nullptr;
 static bool gl_library_loaded = false;
 static bool wgl_library_loaded = false;
@@ -52,10 +47,10 @@
 };
 
-static const char *gl_extension_ids[] = {
-	"UNKNOWN",
-#define NV_GL_EXTENSION( count, id, name ) #id,
-#include <nv/lib/detail/gl_ext/gl_ext_info.inc>
-#undef NV_GL_EXTENSION
-};
+// static const char *gl_extension_ids[] = {
+// 	"UNKNOWN",
+// #define NV_GL_EXTENSION( count, id, name ) #id,
+// #include <nv/lib/detail/gl_ext/gl_ext_info.inc>
+// #undef NV_GL_EXTENSION
+// };
 
 
@@ -184,7 +179,7 @@
 	wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
 
-	DWORD err = GetLastError();
+	/*DWORD err = */GetLastError();
 	RegisterClass(&wndClass);
-	err = GetLastError();
+	/*err = */GetLastError();
 
 
@@ -235,5 +230,4 @@
 }
 
-
 bool nv::load_gl_extension( gl_extensions extension )
 {
Index: trunk/src/lua/lua_map_tile.cc
===================================================================
--- trunk/src/lua/lua_map_tile.cc	(revision 322)
+++ trunk/src/lua/lua_map_tile.cc	(revision 323)
@@ -27,20 +27,20 @@
 
 
-bool nlua_is_map_tile( lua_State* L, int index )
-{
-	return luaL_testudata( L, index, NLUA_MAP_TILE_METATABLE ) != 0;
-}
-
-map_tile nlua_to_map_tile( lua_State* L, int index )
-{
-	return *(map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE );
-}
-
-map_tile* nlua_to_pmap_tile( lua_State* L, int index )
+// static bool nlua_is_map_tile( lua_State* L, int index )
+// {
+// 	return luaL_testudata( L, index, NLUA_MAP_TILE_METATABLE ) != 0;
+// }
+// 
+// static map_tile nlua_to_map_tile( lua_State* L, int index )
+// {
+// 	return *(map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE );
+// }
+
+static map_tile* nlua_to_pmap_tile( lua_State* L, int index )
 {
 	return (map_tile*)luaL_checkudata( L, index, NLUA_MAP_TILE_METATABLE );
 }
 
-void nlua_push_map_tile( lua_State* L, const map_tile& tile )
+static void nlua_push_map_tile( lua_State* L, const map_tile& tile )
 {
 	map_tile* result = (map_tile*)lua_newuserdata( L, sizeof(map_tile) );
@@ -79,5 +79,5 @@
 			if ( lua_isstring( L, -2 ) && lua_objlen( L, -2 ) == 1 )
 			{
-				translation[ 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 */
@@ -86,8 +86,8 @@
 	}
 
-	for ( int line = 0; line < tile.size_x; line++ )
-		for ( int row = 0; row < tile.size_y; row++ )
-		{
-			nv::char8 gylph = code[ row * ( tile.size_x + 1 ) + line ];
+	for ( nv::uint16 line = 0; line < tile.size_x; line++ )
+		for ( nv::uint16 row = 0; row < tile.size_y; row++ )
+		{
+			nv::char8 gylph = (nv::char8)code[ row * ( tile.size_x + 1 ) + line ];
 			// TODO: check for errors
 			tile.data[ row * tile.size_x + line ] = translation[ gylph ];
@@ -203,7 +203,7 @@
 	switch ( nv::random::get().urand( 4 ) )
 	{
-	case 1 : nlua_map_tile_flip_x( L );
-	case 2 : nlua_map_tile_flip_y( L );
-	case 3 : nlua_map_tile_flip_xy( L );
+	case 1 : nlua_map_tile_flip_x( L ); break;
+	case 2 : nlua_map_tile_flip_y( L ); break;
+	case 3 : nlua_map_tile_flip_xy( L ); break;
 	default:
 		break;
Index: trunk/src/lua/lua_nova.cc
===================================================================
--- trunk/src/lua/lua_nova.cc	(revision 322)
+++ trunk/src/lua/lua_nova.cc	(revision 323)
@@ -9,6 +9,6 @@
 #include "nv/lua/lua_raw.hh"
 
-const char* NV_STATE      = "NV_STATE";
-const char* NV_BLUEPRINTS = "NV_BLUEPRINTS";
+static const char* NV_STATE      = "NV_STATE";
+static const char* NV_BLUEPRINTS = "NV_BLUEPRINTS";
 
 // static nv::lua::state* nova_get_state( lua_State * L )
@@ -73,4 +73,5 @@
 			return true;
 		}
+		break;
 	case LUA_TSTRING :
 		if ( lua_type( L, ivalue ) != LUA_TTABLE )
@@ -86,4 +87,5 @@
 		lua_concat( L, 3 );
 		lua_call( L, 3, 0 );
+		break;
 	case LUA_TNUMBER :
 		if (lua_tointeger( L, itype ) != lua_type( L, ivalue ) && lua_tointeger( L, itype ) > 0)
@@ -91,5 +93,6 @@
 			luaL_error( L, "lua.nova - \"%s.%s\" - type mismatch, %s expected, %s found!", lua_tolstring( L, iid, 0 ), lua_tolstring( L, ifield, 0 ), lua_typename( L, lua_tointeger( L, itype ) ), lua_typename( L, lua_type( L, ivalue ) ) );
 		}
-
+		break;
+	default : return false;
 	}
 	return false;
@@ -784,5 +787,5 @@
 
 
-int luaopen_nova( lua_State * L )
+static int luaopen_nova( lua_State * L )
 {
 	lua_createtable( L, 0, 0 );
