Index: /trunk/nv.lua
===================================================================
--- /trunk/nv.lua	(revision 486)
+++ /trunk/nv.lua	(revision 487)
@@ -151,6 +151,8 @@
 			buildoptions { "-std=c++0x" }
 		end
+	
 	configuration { "windows", "gmake" }
-		linkoptions { "-mwindows" }
+		linkoptions { "-Wl,--subsystem,windows" }
+--		linkoptions { "-mwindows" }
 
 	configuration "linux"
Index: /trunk/nv/core/ascii_printer.hh
===================================================================
--- /trunk/nv/core/ascii_printer.hh	(revision 486)
+++ /trunk/nv/core/ascii_printer.hh	(revision 487)
@@ -26,5 +26,5 @@
 		explicit ascii_printer( terminal * term );
 
-		void print( uchar8 ch, const position& p, uint32 color )
+		void print( char ch, const position& p, uint32 color )
 		{
 			m_terminal->print( p, color, ch );
Index: /trunk/nv/core/random.hh
===================================================================
--- /trunk/nv/core/random.hh	(revision 486)
+++ /trunk/nv/core/random.hh	(revision 487)
@@ -51,5 +51,7 @@
 		{
 			NV_ASSERT( max >= min, "Bad srange argument!" );
-			return static_cast< sint32 >( urand( static_cast< uint32 >( max - min ) + 1 ) + min );
+			// this method probably reduces range //
+			uint32 roll = urand( static_cast<uint32>( max - min ) + 1 );
+			return static_cast< sint32 >( roll ) + min;
 		}
 
Index: /trunk/nv/core/resource.hh
===================================================================
--- /trunk/nv/core/resource.hh	(revision 486)
+++ /trunk/nv/core/resource.hh	(revision 487)
@@ -36,4 +36,5 @@
 	public:
 		resource_handler( resource_type_id id ) : m_type_id( id ) {}
+		virtual ~resource_handler() {}
 
 	protected:
@@ -41,5 +42,5 @@
 		virtual void raw_add( resource_id id, void* value ) = 0;
 		virtual void unlock( resource_id id ) = 0;
-		virtual void release( resource_id id ) = 0;
+		//virtual void release( resource_id id ) = 0;
 		virtual bool exists( resource_id id ) = 0;
 		virtual bool load_resource( const string_view& id ) = 0;
@@ -84,9 +85,11 @@
 		constexpr explicit operator bool() const { return is_valid(); }
 		resource_lock< T > lock() const { return resource_lock< T >( *this, resource_unchecked() ); }
-		~resource()
-		{
-			if ( m_handler ) m_handler->release( m_id );
-		}
-	protected:
+// 		~resource()
+// 		{
+// 			if ( m_handler ) m_handler->release( m_id );
+// 		}
+	protected:
+		explicit resource( resource_id id ) : m_id( id ), m_handler( nullptr ) {}
+
 		resource_id       m_id;
 		resource_handler* m_handler;
@@ -134,9 +137,9 @@
 	public:
 
-		void release( resource_handler* r )
-		{
-			r->release( m_id );
-			m_id = 0;
-		}
+// 		void release( resource_handler* r )
+// 		{
+// 			r->release( m_id );
+// 			m_id = 0;
+// 		}
 		~resource_handle()
 		{
@@ -158,9 +161,9 @@
 			: m_id( r.m_id )
 			, m_handler( r.m_handler )
-			, m_resource( r.m_handler ? r.m_handler->lock<T>( r.m_id, false ) : nullptr ) {}
+			, m_resource( r.m_handler ? r.m_handler->template lock<T>( r.m_id, false ) : nullptr ) {}
 		explicit resource_lock( const resource< T >& r ) 
 			: m_id( r.m_id )
 			, m_handler( r.m_handler )
-			, m_resource( r.m_handler->lock<T>( r.m_id ) ) {}
+			, m_resource( r.m_handler->template lock<T>( r.m_id ) ) {}
 		explicit resource_lock( const resource_handle< T >& r, resource_handler* handler ) : m_id( r.m_id ), m_handler( handler ), m_resource( handler->raw_lock( r.m_id ) ) {}
 		resource_lock( const resource_lock& ) = delete;
@@ -214,6 +217,7 @@
 			auto m = m_handlers.find( resource_type_id( rtti_type_hash<T>::value ) );
 			NV_ASSERT( m != m_handlers.end(), "Resource type unrecognized!" );
-			if ( m->second->exists( id ) || m->second->load_resource( id ) )
-				return m->second->create< T >( id );
+			shash64 hid( id );
+			if ( m->second->exists( hid ) || m->second->load_resource( id ) )
+				return m->second->create< T >( hid );
 			NV_ASSERT( false, "resource_manager.get failed!" );
 			return resource< T >();
@@ -225,7 +229,8 @@
 			auto m = m_handlers.find( resource_type_id( rtti_type_hash<T>::value ) );
 			NV_ASSERT( m != m_handlers.end(), "Resource type unrecognized!" );
-			if ( m->second->exists( id ) )
+			shash64 hid( id );
+			if ( m->second->exists( hid ) )
 			{
-				return m->second->create< T >( id );
+				return m->second->create< T >( hid );
 			}
 			NV_ASSERT( false, "resource_manager.get failed!" );
Index: /trunk/nv/core/types.hh
===================================================================
--- /trunk/nv/core/types.hh	(revision 486)
+++ /trunk/nv/core/types.hh	(revision 487)
@@ -34,5 +34,4 @@
 		constexpr thash64() : inherited_type() {}
 		constexpr explicit thash64( hash_type value ) : inherited_type( value ) {}
-		constexpr thash64( const thash64& value ) = default;
 
 		template < typename T >
@@ -211,5 +210,5 @@
 			( is_pointer<field_type>::value ? TF_POINTER : 0 ) |
 			( is_pod<field_type>::value ? TF_SIMPLETYPE : 0 );
-		f.offset = offset_of( field );
+		f.offset = uint32( offset_of( field ) );
 		f.control = nullptr;
 		f.enumidx = 0;
@@ -229,5 +228,5 @@
 			( is_pointer<TFIELD>::value ? TF_POINTER : 0 ) |
 			( is_pod<TFIELD>::value ? TF_SIMPLETYPE : 0 );
-		f.offset = offset_of( field );
+		f.offset = uint32( offset_of( field ) );
 		f.control = nullptr;
 		f.enumidx = 0;
@@ -248,5 +247,5 @@
 			( is_pointer<field_type>::value ? TF_POINTER : 0 ) |
 			( is_pod<field_type>::value ? TF_SIMPLETYPE : 0 );
-		f.offset = offset_of( field );
+		f.offset = uint32( offset_of( field ) );
 		f.control = m_entry->field_names[ control_name ];
 		f.enumidx = static_cast< sint32 >( control_value );
@@ -266,5 +265,5 @@
 			( is_pointer<TFIELD>::value ? TF_POINTER : 0 ) |
 			( is_pod<TFIELD>::value ? TF_SIMPLETYPE : 0 );
-		f.offset = offset_of( field );
+		f.offset = uint32( offset_of( field ) );
 		f.control = m_entry->field_names[control_name];
 		f.enumidx = static_cast<sint32>( control_value );
Index: /trunk/nv/curses/curses_terminal.hh
===================================================================
--- /trunk/nv/curses/curses_terminal.hh	(revision 486)
+++ /trunk/nv/curses/curses_terminal.hh	(revision 487)
@@ -35,5 +35,5 @@
          * Print a character of the given color to the screen memory
          */
-        virtual void print( position p, uint32 color, unsigned char ch );
+        virtual void print( position p, uint32 color, char ch );
 
         /**
Index: /trunk/nv/engine/animation.hh
===================================================================
--- /trunk/nv/engine/animation.hh	(revision 486)
+++ /trunk/nv/engine/animation.hh	(revision 487)
@@ -85,6 +85,6 @@
 		animator_transition_instance() {}
 
-		animator_transition_instance( const animator_transition_data& data, uint32 source )
-			: animator_transition_data( data ), source( source ), time( 0.0f )
+		animator_transition_instance( const animator_transition_data& data, uint32 src )
+			: animator_transition_data( data ), source( src ), time( 0.0f )
 		{
 
@@ -96,14 +96,14 @@
 	public:
 		vector< animator_transition_instance > m_transitions;
-		uint32 m_current_state;
+		sint32 m_current_state;
 		float m_time;
 
 		animator_layer_instance() : m_current_state( 0 ), m_time( 0.0f ) {}
-		void set_state( uint32 state ) { m_current_state = state; }
-		uint32 get_state() const { return m_current_state; }
-		uint32 get_final_state() const
+		void set_state( uint32 state ) { m_current_state = sint32( state ); }
+		sint32 get_state() const { return m_current_state; }
+		sint32 get_final_state() const
 		{
 			if ( m_transitions.size() > 0 ) 
-				return m_transitions.back().target;
+				return sint32( m_transitions.back().target );
 			return m_current_state;
 		}
@@ -135,5 +135,5 @@
 				{
 					animator_transition_instance& tr = m_transitions.front();
-					m_current_state = tr.target;
+					m_current_state = sint32( tr.target );
 					tr.time += time;
 					if ( tr.time < tr.duration ) break;
@@ -181,5 +181,5 @@
 			for ( uint32 i = 0; i < data->layers.size(); ++i )
 			{
-				m_layers[i].set_state( data->layers[i].def_state );
+				m_layers[i].set_state( uint32( data->layers[i].def_state ) );
 			}
 		}
@@ -190,5 +190,5 @@
 		}
 
-		uint32 base_state() const
+		sint32 base_state() const
 		{
 			// HACK
@@ -203,10 +203,10 @@
 				if ( m_layers[i].m_current_state != -1 )
 				{
-					uint32 last_state = m_layers[i].get_final_state();
-					const animator_state_data& state = data->layers[i].states[last_state];
+					sint32 last_state = m_layers[i].get_final_state();
+					const animator_state_data& state = data->layers[i].states[ uint32( last_state ) ];
 					auto it = state.transitions.find( name );
 					if ( it != state.transitions.end() )
 					{
-						m_layers[i].add_transition( it->second, last_state );
+						m_layers[i].add_transition( it->second, uint32( last_state ) );
 					}
 				}
@@ -228,5 +228,5 @@
 					{
 						const animator_layer_data& layer = data->layers[i];
-						const animator_state_data& state = layer.states[m_layers[i].m_current_state];
+						const animator_state_data& state = layer.states[ uint32( m_layers[i].m_current_state ) ];
 						if ( state.poses.size() > 0 )
 							animate_state( m_transforms, state, data->layers[i], data->poses, get_frame( state, m_layers[i].m_time ) );
@@ -258,13 +258,16 @@
 			const animator_layer_instance& linst = m_layers[layer_id];
 			m_layers[layer_id].update( dtime );
-			if ( m_layers[layer_id].m_transitions.size() > 0 )
-			{
-				animate_layer( ldata, linst.m_transitions.front(), data->poses, linst.m_time );
-			}
-			else
-			{
-				const animator_state_data& state = ldata.states[linst.m_current_state];
-				if ( state.poses.size() > 0 )
-					animate_state( m_transforms, state, ldata, data->poses, get_frame( state, linst.m_time ) );
+			if ( linst.m_current_state != -1 )
+			{
+				if ( m_layers[layer_id].m_transitions.size() > 0 )
+				{
+					animate_layer( ldata, linst.m_transitions.front(), data->poses, linst.m_time );
+				}
+				else
+				{
+					const animator_state_data& state = ldata.states[ uint32( linst.m_current_state ) ];
+					if ( state.poses.size() > 0 )
+						animate_state( m_transforms, state, ldata, data->poses, get_frame( state, linst.m_time ) );
+				}
 			}
 			m_transforms.delocalize( data->poses->get_tree() );
Index: /trunk/nv/engine/image_manager.hh
===================================================================
--- /trunk/nv/engine/image_manager.hh	(revision 486)
+++ /trunk/nv/engine/image_manager.hh	(revision 487)
Index: /trunk/nv/engine/resource_system.hh
===================================================================
--- /trunk/nv/engine/resource_system.hh	(revision 486)
+++ /trunk/nv/engine/resource_system.hh	(revision 487)
@@ -77,10 +77,10 @@
 		{
 			if ( exists( id ) )
-				return create< T >( id );
+				return this->template create< T >( id );
 			else
 			{
 				if ( this->load_resource( id ) )
 				{
-					return create< T >( id );
+					return this->template create< T >( id );
 				}
 			}
@@ -91,5 +91,5 @@
 		resource_type get( uint64 id )
 		{
-			if ( exists( shash64( id ) ) ) return create< T >( shash64( id ) );
+			if ( exists( shash64( id ) ) ) return this->template create< T >( shash64( id ) );
 			// NV_ASSERT( false, "resource_manager.get failed!" );
 			return resource_type();
@@ -120,5 +120,5 @@
 			}
 			m_store[id] = resource;
-			return create< T >( id );
+			return this->template create< T >( id );
 		}
 
@@ -140,6 +140,6 @@
 		}
 
-		virtual void unlock( resource_id ) {};
-		virtual void release( resource_id ) {};
+		virtual void unlock( resource_id ) {}
+		virtual void release( resource_id ) {}
 		virtual void release( stored_type ) {}
 
Index: /trunk/nv/gfx/poses.hh
===================================================================
--- /trunk/nv/gfx/poses.hh	(revision 486)
+++ /trunk/nv/gfx/poses.hh	(revision 487)
@@ -90,5 +90,5 @@
 			pose.m_transforms.resize( m_node_tree.size() );
 
-			for ( sint32 i = 0; i < sint32( m_node_tree.size() ); ++i )
+			for ( uint32 i = 0; i < m_node_tree.size(); ++i )
 			{
 				const data_channel_set* node = nullptr;
Index: /trunk/nv/gfx/skeleton_instance.hh
===================================================================
--- /trunk/nv/gfx/skeleton_instance.hh	(revision 486)
+++ /trunk/nv/gfx/skeleton_instance.hh	(revision 487)
@@ -69,5 +69,5 @@
 		}
 
-		uint32 size() const { return m_offsets.size(); };
+		uint32 size() const { return m_offsets.size(); }
 	protected:
 		dynamic_array< value_type >   m_offsets;
@@ -84,6 +84,6 @@
 		void prepare( const mesh_nodes_data* node_data, const data_node_list& bone_data );
 		void prepare( const data_node_list& pose_data, const data_node_list& bone_data );
-		uint32 size() const { return m_indices.size(); };
-		uint32 skeleton_size() const { return m_bone_count; };
+		uint32 size() const { return m_indices.size(); }
+		uint32 skeleton_size() const { return m_bone_count; }
 	protected:
 		dynamic_array< sint16 > m_indices;
Index: /trunk/nv/interface/data_channel.hh
===================================================================
--- /trunk/nv/interface/data_channel.hh	(revision 486)
+++ /trunk/nv/interface/data_channel.hh	(revision 487)
@@ -63,5 +63,5 @@
 		const T& extract( uint16 slot_index, uint32 index ) const
 		{
-			NV_ASSERT( slot < m_desc.size(), "Bas slot passed to extract!" )
+			NV_ASSERT( slot_index < m_desc.size(), "Bas slot passed to extract!" );
 			return *reinterpret_cast<const T*>( m_data + m_desc.element_size()*index + m_desc[slot_index].offset );
 		}
Index: /trunk/nv/interface/image_loader.hh
===================================================================
--- /trunk/nv/interface/image_loader.hh	(revision 486)
+++ /trunk/nv/interface/image_loader.hh	(revision 487)
@@ -28,5 +28,5 @@
 		virtual image_data* load( stream& ) = 0;
 		virtual image_data* load( stream&, image_format format ) = 0;
-		virtual ~image_loader() {};
+		virtual ~image_loader() {}
 	};
 
Index: /trunk/nv/interface/interpolate.hh
===================================================================
--- /trunk/nv/interface/interpolate.hh	(revision 486)
+++ /trunk/nv/interface/interpolate.hh	(revision 487)
@@ -147,5 +147,5 @@
 	{
 		inline static T interpolate( float f, const T& lhs, const T& rhs ) { return math::slerp( lhs, rhs, f ); }
-		inline static T interpolate( float f, const T& v0, const T& v1, const T& v2, const T& v3 ) { return math::slerp( v1, v2, f ); }
+		inline static T interpolate( float f, const T&, const T& v1, const T& v2, const T& ) { return math::slerp( v1, v2, f ); }
 	};
 
@@ -209,5 +209,5 @@
 		case interpolation::QUADRATIC     : return quadratic_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
 		case interpolation::SQUADRATIC    : return squad_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
-		default: case interpolation::NONE : return no_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
+		default                           : return no_interpolator<T>::interpolate( f, ::nv::forward<Args>( args )... );
 		}
 	}
@@ -224,5 +224,5 @@
 		case interpolation::QUADRATIC     : interpolate_array( result, f, quadratic_interpolator<value_type>( f ), ::nv::forward<Args>( args )... ); break;
 		case interpolation::SQUADRATIC    : interpolate_array( result, f, squad_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
-		default: case interpolation::NONE : interpolate_array( result, f, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
+		default                           : interpolate_array( result, f, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
 		}
 	}
@@ -277,5 +277,5 @@
 		case interpolation::QUADRATIC     : interpolate_blend( result, f, in, blend_factor, normalized_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
 		case interpolation::SQUADRATIC    : interpolate_blend( result, f, in, blend_factor, spherical_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
-		default: case interpolation::NONE : interpolate_blend( result, f, in, blend_factor, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
+		default                           : interpolate_blend( result, f, in, blend_factor, no_interpolator<value_type>(), ::nv::forward<Args>( args )... ); break;
 		}
 	}
Index: /trunk/nv/interface/mesh_data.hh
===================================================================
--- /trunk/nv/interface/mesh_data.hh	(revision 486)
+++ /trunk/nv/interface/mesh_data.hh	(revision 487)
@@ -65,5 +65,5 @@
 
 		data_node_list( data_node_list&& other )
-			: m_name( other.m_name ), m_data( nv::move( other.m_data ) )
+			: m_data( nv::move( other.m_data ) ), m_name( other.m_name )
 		{
 		}
@@ -123,6 +123,6 @@
 			for ( uint8 n = 0; n < uint8( m_data.size() ); ++n )
 			{
-				if ( m_data[n].parent_id != -1 )
-					m_children[m_data[n].parent_id].push( n );
+				if ( m_data[n].parent_id >= 0 )
+					m_children[ uint32( m_data[n].parent_id ) ].push( n );
 			}
 		}
Index: /trunk/nv/interface/terminal.hh
===================================================================
--- /trunk/nv/interface/terminal.hh	(revision 486)
+++ /trunk/nv/interface/terminal.hh	(revision 487)
@@ -36,5 +36,5 @@
          * Print a character of the given color to the screen memory
          */
-        virtual void print( position p, uint32 color, unsigned char ch ) = 0;
+        virtual void print( position p, uint32 color, char ch ) = 0;
 
         /**
Index: /trunk/nv/interface/uniform.hh
===================================================================
--- /trunk/nv/interface/uniform.hh	(revision 486)
+++ /trunk/nv/interface/uniform.hh	(revision 487)
@@ -27,5 +27,5 @@
 	{
 	public: 
-		uniform_base( datatype type, int location, int length ) 
+		uniform_base( datatype type, int location, size_t length ) 
 			: m_type( type ), m_location(location), m_length( length ), m_dirty( true ) {}
 		bool try_type_check( datatype )
@@ -42,13 +42,13 @@
 		datatype get_type() const { return m_type; }
 		int get_location() const { return m_location; }
-		int get_length() const { return m_length; }
+		size_t get_length() const { return m_length; }
 		bool is_dirty() const { return m_dirty; }
 		void clean() { m_dirty = false; }
-		static uniform_base* create( datatype utype, int location, int length );
+		static uniform_base* create( datatype utype, int location, size_t length );
 		virtual ~uniform_base() {}
 	protected:
 		datatype m_type;
 		int      m_location;
-		int      m_length;
+		size_t   m_length;
 		bool     m_dirty;
 	};
@@ -60,5 +60,5 @@
 		typedef T value_type;
 
-		uniform( int location, int length ) 
+		uniform( int location, size_t length )
 			: uniform_base( type_to_enum< T >::type, location, length ), m_value( nullptr )
 		{
@@ -285,5 +285,5 @@
 	};
 
-	inline uniform_base* uniform_base::create( datatype utype, int location, int length )
+	inline uniform_base* uniform_base::create( datatype utype, int location, size_t length )
 	{
 		switch( utype )
Index: /trunk/nv/lib/assimp.hh
===================================================================
--- /trunk/nv/lib/assimp.hh	(revision 486)
+++ /trunk/nv/lib/assimp.hh	(revision 487)
@@ -23,4 +23,6 @@
 #	define NV_ASSIMP_PATH "libassimp32.so"
 #endif
+
+typedef nv::size_t size_t;
 
 extern "C" {
Index: /trunk/nv/rogue/fov.hh
===================================================================
--- /trunk/nv/rogue/fov.hh	(revision 486)
+++ /trunk/nv/rogue/fov.hh	(revision 487)
@@ -23,4 +23,5 @@
 			virtual bool is_transparent( const position& ) const = 0;
 			virtual void set_visible( const position&, bool ) = 0;
+			virtual ~fov_interface() {}
 		};
 
Index: /trunk/nv/stl/algorithm/fill.hh
===================================================================
--- /trunk/nv/stl/algorithm/fill.hh	(revision 486)
+++ /trunk/nv/stl/algorithm/fill.hh	(revision 487)
@@ -18,4 +18,5 @@
 #include <nv/stl/iterator.hh>
 #include <nv/stl/type_traits/common.hh>
+#include <nv/stl/type_traits/properties.hh>
 
 namespace nv
Index: /trunk/nv/stl/container/growing_storage.hh
===================================================================
--- /trunk/nv/stl/container/growing_storage.hh	(revision 486)
+++ /trunk/nv/stl/container/growing_storage.hh	(revision 487)
@@ -134,14 +134,14 @@
 		void push_back( const value_type& e )
 		{
-			if ( try_grow( 1 ) ) copy_construct_object( Storage::data() + m_size - 1, e );
+			if ( try_grow( 1 ) ) copy_construct_object( Storage::data() + sint32( m_size ) - 1, e );
 		}
 		void push_back( value_type&& e )
 		{
-			if ( try_grow( 1 ) ) move_construct_object( Storage::data() + m_size - 1, forward<value_type>( e ) );
+			if ( try_grow( 1 ) ) move_construct_object( Storage::data() + sint32( m_size ) - 1, forward<value_type>( e ) );
 		}
 		template < typename... Args >
 		void emplace_back( Args&&... args )
 		{
-			if ( try_grow( 1 ) ) construct_object( Storage::data() + m_size - 1, forward<Args>( args )... );
+			if ( try_grow( 1 ) ) construct_object( Storage::data() + sint32( m_size ) - 1, forward<Args>( args )... );
 		}
 
@@ -149,5 +149,5 @@
 		{
 			if ( m_size == 0 ) return;
-			InitializePolicy::destroy( Storage::data() + m_size - 1 );
+			InitializePolicy::destroy( Storage::data() + sint32( m_size ) - 1 );
 			m_size.size( m_size - 1 );
 		}
@@ -157,5 +157,5 @@
 		{
 			if ( m_size == 0 ) return iterator();
-			iterator iend = Storage::data() + m_size;
+			iterator iend = Storage::data() + sint32( m_size );
 			InitializePolicy::destroy( position );
 			if ( ( position + 1 ) < iend )
@@ -167,8 +167,9 @@
 		iterator erase( iterator first, iterator last )
 		{
-			iterator iend = Storage::data() + m_size;
+			NV_ASSERT( first <= last, "Bad arguments passed to erase!" );
+			iterator iend = Storage::data() + sint32( m_size );
 			InitializePolicy::destroy( first, last );
 			iterator position = raw_alias_copy( last, iend, first );
-			m_size.size( m_size - ( last - first ) );
+			m_size.size( m_size - size_type( last - first ) );
 			return position;
 		}
@@ -178,5 +179,6 @@
 			// TODO: distance can't be called on destructive iterators - check 
 			//   and use pushback if needed?
-			size_type d        = distance( first, last );
+			NV_ASSERT( first <= last, "Bad arguments passed to append!" );
+			size_type d        = size_type( distance( first, last ) );
 			size_type old_size = m_size;
 			if ( try_grow( d ) )
@@ -191,5 +193,5 @@
 			{
 				iterator iposition = Storage::data() + offset;
-				iterator iend = Storage::data() + m_size - 1;
+				iterator iend = Storage::data() + sint32( m_size ) - 1;
 				raw_alias_copy( iposition, iend, iposition + 1 );
 				copy_construct_object( iposition, value );
@@ -202,10 +204,11 @@
 			// TODO: distance can't be called on destructive iterators - check 
 			//   and use pushback if needed?
+			NV_ASSERT( first <= last, "Bad arguments passed to insert!" );
 			ptrdiff_t offset = position - Storage::data();
-			size_type d = distance( first, last );
+			size_type d = size_type( distance( first, last ) );
 			if ( try_grow( d ) )
 			{
 				iterator iposition = Storage::data() + offset;
-				iterator iend = Storage::data() + m_size - d;
+				iterator iend = Storage::data() + sint32( m_size ) - d;
 				raw_alias_copy( iposition, iend, iposition + d );
 				InitializePolicy::copy( first, last, iposition );
@@ -217,5 +220,5 @@
 			size_type old_size = m_size;
 			resize_impl( new_size );
-			if ( m_size > old_size ) InitializePolicy::initialize( Storage::data() + old_size, Storage::data() + m_size );
+			if ( m_size > old_size ) InitializePolicy::initialize( Storage::data() + old_size, Storage::data() + sint32( m_size ) );
 		}
 
@@ -224,5 +227,5 @@
 			size_type old_size = m_size;
 			resize_impl( new_size );
-			if ( m_size > old_size ) uninitialized_construct( Storage::data() + old_size, Storage::data() + m_size );
+			if ( m_size > old_size ) uninitialized_construct( Storage::data() + old_size, Storage::data() + sint32( m_size ) );
 		}
 
@@ -231,5 +234,5 @@
 			size_type old_size = m_size;
 			resize_impl( new_size );
-			if ( m_size > old_size ) uninitialized_fill( Storage::data() + old_size, Storage::data() + m_size, value );
+			if ( m_size > old_size ) uninitialized_fill( Storage::data() + old_size, Storage::data() + sint32( m_size ), value );
 		}
 
@@ -249,6 +252,7 @@
 			// TODO: distance can't be called on destructive iterators - check 
 			//   and use pushback if needed?
-			if ( m_size > 0 ) InitializePolicy::destroy( Storage::data(), Storage::data() + m_size );
-			size_type d = distance( first, last );
+			NV_ASSERT( first <= last, "Bad arguments passed to insert!" );
+			if ( m_size > 0 ) InitializePolicy::destroy( Storage::data(), Storage::data() + sint32( m_size ) );
+			size_type d = size_type( distance( first, last ) );
 			if ( try_resize( d, false ) )
 				InitializePolicy::copy( first, last, Storage::data() );
@@ -265,5 +269,5 @@
 			if ( m_size > 0 )
 			{
-				InitializePolicy::destroy( Storage::data(), Storage::data() + m_size );
+				InitializePolicy::destroy( Storage::data(), Storage::data() + sint32( m_size ) );
 				m_size = size_impl_type();
 			}
@@ -285,5 +289,5 @@
 				if ( new_size < old_size )
 				{
-					InitializePolicy::destroy( Storage::data() + new_size, Storage::data() + old_size );
+					InitializePolicy::destroy( Storage::data() + sint32( new_size ), Storage::data() + sint32( old_size ) );
 				}
 				if ( try_resize( new_size, true ) )
Index: /trunk/nv/stl/functional/hash.hh
===================================================================
--- /trunk/nv/stl/functional/hash.hh	(revision 486)
+++ /trunk/nv/stl/functional/hash.hh	(revision 487)
@@ -174,5 +174,4 @@
 		constexpr hash_value() : m_value( 0 ) {}
 		constexpr explicit hash_value( hash_type value ) : m_value( value ) {}
- 		constexpr hash_value( const hash_value& ) = default;
 
 		constexpr bool is_valid() const { return m_value != 0; }
Index: /trunk/nv/stl/hash_store.hh
===================================================================
--- /trunk/nv/stl/hash_store.hh	(revision 486)
+++ /trunk/nv/stl/hash_store.hh	(revision 487)
@@ -74,4 +74,7 @@
 	public:
 		typedef hash_table_base< hash_store_entry_policy< T, H > > base_type;
+		typedef typename base_type::iterator           iterator;
+		typedef typename base_type::const_iterator     const_iterator;
+		typedef typename base_type::insert_return_type insert_return_type;
 		typedef H key_type;
 		typedef H query_type;
Index: /trunk/nv/stl/math/angle.hh
===================================================================
--- /trunk/nv/stl/math/angle.hh	(revision 486)
+++ /trunk/nv/stl/math/angle.hh	(revision 487)
@@ -139,5 +139,5 @@
 
 		template < typename T, typename enable_if< is_floating_point<T>::value >::type* = nullptr >
-		inline T angle(	T a, T y )
+		inline T angle(	T a, T b )
 		{
 			return acos( clamp( dot( a, b ), T( -1 ), T( 1 ) ) );
@@ -156,5 +156,5 @@
 			const T result( acos( clamp( dot( a, b ), T( -1 ), T( 1 ) ) ) );
 
-			if ( all( epsilon_equal( y, math::rotate( a, result ), T( 0.0001 ) ) ) )
+			if ( all( epsilon_equal( b, math::rotate( a, result ), T( 0.0001 ) ) ) )
 				return result;
 			else
Index: /trunk/nv/stl/math/exponential.hh
===================================================================
--- /trunk/nv/stl/math/exponential.hh	(revision 486)
+++ /trunk/nv/stl/math/exponential.hh	(revision 487)
@@ -44,5 +44,5 @@
 		inline T exp2( T x )
 		{
-			return exp( ln_two<T>() );
+			return exp( ln_two<T>() * x );
 		}
 
Index: /trunk/nv/stl/math/matrix_transform.hh
===================================================================
--- /trunk/nv/stl/math/matrix_transform.hh	(revision 486)
+++ /trunk/nv/stl/math/matrix_transform.hh	(revision 487)
@@ -175,6 +175,6 @@
 
 			tmat4<T> result( T( 0 ) );
-			result[0][0] = ( static_cast<T>( 2 ) * zNear ) / ( right - left );
-			result[1][1] = ( static_cast<T>( 2 ) * zNear ) / ( top - bottom );
+			result[0][0] = ( static_cast<T>( 2 ) * z_near ) / ( right - left );
+			result[1][1] = ( static_cast<T>( 2 ) * z_near ) / ( top - bottom );
 			result[2][2] = ep - static_cast<T>( 1 );
 			result[2][3] = static_cast<T>( -1 );
@@ -217,7 +217,6 @@
 		{
 			NV_ASSERT( delta.x > T( 0 ) && delta.y > T( 0 ), "bad delta passed to pick_matrix!" );
-			if ( !( delta.x > T( 0 ) && delta.y > T( 0 ) ) ) return result;
-
-			tmat4<T> result( 1 );
+			if ( !( delta.x > T( 0 ) && delta.y > T( 0 ) ) ) return tmat4<T>( 1 );
+
 			tvec3<T> temp(
 				( T( viewport[2] ) - T( 2 ) * ( center.x - T( viewport[0] ) ) ) / delta.x,
@@ -226,5 +225,5 @@
 			);
 
-			result = translate( result, temp );
+			tmat4<T> result = translate( result, temp );
 			return scale( result, tvec3<T>( T( viewport[2] ) / delta.x, T( viewport[3] ) / delta.y, T( 1 ) ) );
 		}
Index: /trunk/nv/stl/math/quaternion.hh
===================================================================
--- /trunk/nv/stl/math/quaternion.hh	(revision 486)
+++ /trunk/nv/stl/math/quaternion.hh	(revision 487)
@@ -41,14 +41,14 @@
 			{
 				NV_ASSERT( i >= 0 && i < 4, "index out of range" );
-				return ( &x )[i]
+				return ( &x )[i];
 			}
 			inline const T& operator[]( length_type i ) const
 			{
 				NV_ASSERT( i >= 0 && i < 4, "index out of range" );
-				return ( &x )[i]
+				return ( &x )[i];
 			}
 
 			constexpr tquat() 
-				: x( 0 ), y( 0 ), z( 0 ), w( 1 ) {};
+				: x( 0 ), y( 0 ), z( 0 ), w( 1 ) {}
 			constexpr tquat( const tquat<T>& q ) 
 				: x( q.x ), y( q.y ), z( q.z ), w( q.w ) {}
Index: /trunk/nv/stl/memory/common.hh
===================================================================
--- /trunk/nv/stl/memory/common.hh	(revision 487)
+++ /trunk/nv/stl/memory/common.hh	(revision 487)
@@ -0,0 +1,18 @@
+// Copyright (C) 2015-2015 ChaosForge Ltd
+// http://chaosforge.org/
+//
+// This file is part of Nova libraries. 
+// For conditions of distribution and use, see copying.txt file in root folder.
+
+/**
+* @file common.hh
+* @author Kornel Kisielewicz
+* @brief memory common utilities
+*/
+
+#ifndef NV_STL_MEMORY_COMMON_HH
+#define NV_STL_MEMORY_COMMON_HH
+
+#include <nv/common.hh>
+
+#endif // NV_STL_MEMORY_COMMON_HH
Index: /trunk/nv/stl/priority_queue.hh
===================================================================
--- /trunk/nv/stl/priority_queue.hh	(revision 486)
+++ /trunk/nv/stl/priority_queue.hh	(revision 487)
@@ -80,5 +80,5 @@
 		void emplace( Args&&... args )
 		{
-			m_data.emplace_back( ::std::forward<Args>( args )... );
+			m_data.emplace_back( ::nv::forward<Args>( args )... );
 			push_heap( m_data.begin(), m_data.end(), m_compare );
 		}
Index: /trunk/nv/stl/string.hh
===================================================================
--- /trunk/nv/stl/string.hh	(revision 486)
+++ /trunk/nv/stl/string.hh	(revision 487)
@@ -134,5 +134,4 @@
 
 		constexpr explicit string_hash( hash_type value ) : inherited_type( value ) {}
-  		constexpr string_hash( const string_hash& value ) = default;
 	};
 
Index: /trunk/src/core/ascii_printer.cc
===================================================================
--- /trunk/src/core/ascii_printer.cc	(revision 486)
+++ /trunk/src/core/ascii_printer.cc	(revision 487)
@@ -20,5 +20,5 @@
 	for ( char c : text )
 	{
-		m_terminal->print( coord, color, static_cast<unsigned char>( c ) );
+		m_terminal->print( coord, color, c );
 		++coord.x;
 		if ( coord.x >= m_terminal->get_size().x ) break;
Index: /trunk/src/core/io_event.cc
===================================================================
--- /trunk/src/core/io_event.cc	(revision 486)
+++ /trunk/src/core/io_event.cc	(revision 487)
@@ -64,7 +64,6 @@
 	;
 
-	uint32 counter = 0;
 	db->create_type<io_event_code>()
-#	define NV_IO_EVENT( id ) .value( #id, counter++ )
+#	define NV_IO_EVENT( id ) .value( #id, id )
 #		include <nv/detail/io_event_list.inc>
 #	undef NV_IO_EVENT
Index: /trunk/src/core/random.cc
===================================================================
--- /trunk/src/core/random.cc	(revision 486)
+++ /trunk/src/core/random.cc	(revision 487)
@@ -22,5 +22,5 @@
 {
 	m_state[0] = static_cast<uint32>( seed & mt_full_mask );
-	for ( int i = 1; i < mersenne_n; i++ )
+	for ( uint32 i = 1; i < mersenne_n; i++ )
 	{
 		m_state[i]  = ( 1812433253UL * ( m_state[i - 1] ^ ( m_state[i - 1] >> 30 ) ) + i );
@@ -71,5 +71,5 @@
 
 random::random( random::seed_type seed /*= 0 */ )
-	: m_remaining( 0 ), m_next( nullptr ), m_seeded( 0 )
+	: m_next( nullptr ), m_remaining( 0 ), m_seeded( 0 )
 {
 	mt_init( seed == 0 ? randomized_seed() : seed );
Index: /trunk/src/curses/curses_terminal.cc
===================================================================
--- /trunk/src/curses/curses_terminal.cc	(revision 486)
+++ /trunk/src/curses/curses_terminal.cc	(revision 487)
@@ -53,5 +53,5 @@
 }
 
-void curses_terminal::print( position p, uint32 color, unsigned char ch )
+void curses_terminal::print( position p, uint32 color, char ch )
 {
 	m_update_needed = true;
@@ -64,5 +64,5 @@
 		attrset((static_cast<uint32>(color+1) << 24)  & 0xff000000ul);
 	}
-	mvaddch( p.y-1, p.x-1, ch );
+	mvaddch( p.y-1, p.x-1, chtype(ch) );
 	::move( m_cursor.y-1, m_cursor.x-1 );
 }
Index: /trunk/src/engine/animation.cc
===================================================================
--- /trunk/src/engine/animation.cc	(revision 486)
+++ /trunk/src/engine/animation.cc	(revision 487)
@@ -61,9 +61,9 @@
 		layer.def_state = -1;
 
-		if ( layer.mask != -1 )
+		if ( layer.mask >= 0 )
 		{
 			const auto& tree = animator->poses->get_tree();
 			layer.mask_vector.resize( tree.size(), false );
-			fill_mask_vector_rec( layer.mask_vector, tree, layer.mask );
+			fill_mask_vector_rec( layer.mask_vector, tree, uint32( layer.mask ) );
 		}
 
Index: /trunk/src/formats/assimp_loader.cc
===================================================================
--- /trunk/src/formats/assimp_loader.cc	(revision 486)
+++ /trunk/src/formats/assimp_loader.cc	(revision 487)
@@ -215,9 +215,9 @@
 		{
 			aiBone* bone  = mesh->mBones[m];
-			for (unsigned int w=0; w<bone->mNumWeights; w++)
+			for ( size_t w=0; w<bone->mNumWeights; w++)
 			{
 				assimp_skinned_vtx& v = vtx[ bone->mWeights[w].mVertexId ];
 				bool found = false;
-				for ( int i = 0 ; i < 4; ++i )
+				for ( size_t i = 0 ; i < 4; ++i )
 				{
 					if ( v.boneweight[i] <= 0.0f ) 
@@ -409,5 +409,5 @@
 			{
 				assimp_skinned_vtx& vertex = channel.data()[v];
-				for ( int i = 0; i < 4; ++i )
+				for ( size_t i = 0; i < 4; ++i )
 				{
 					if ( vertex.boneweight[i] > 0.0f )
@@ -429,6 +429,6 @@
 			mat4 tr = nv::math::inverse( assimp_mat4_cast( m_data->node_by_name[bone_data[i].name]->mTransformation ) );
 			int pid = bone_data[i].parent_id;
-			if ( pid != -1 )
-				bone_data[i].transform = tr * bone_data[pid].transform;
+			if ( pid >= 0 )
+				bone_data[i].transform = tr * bone_data[ size_t( pid ) ].transform;
 			else
 				bone_data[i].transform = tr;
@@ -492,8 +492,6 @@
 {
 	int this_is_incorrect;
-	return m_mesh_count == 0 || m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0;
-}
-
-int indent = 0;
+	return m_mesh_count == 0 || ( m_data->scene->mNumAnimations > 0 && m_data->skeletons.size() == 0 );
+}
 
 void nv::assimp_loader::scan_nodes( const void* node ) const
@@ -537,8 +535,7 @@
 	transform t = nv::transform( nv::assimp_mat4_cast( node->mTransformation ) );
 
-	nodes[ this_id ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 );
-
-	infos[this_id].name      = make_name( name );
-	infos[this_id].parent_id = parent_id;
+	nodes[ uint32( this_id ) ] = anode ? create_keys( anode, t ) : data_channel_set_creator::create_set( 0 );
+	infos[ uint32( this_id ) ].name      = make_name( name );
+	infos[ uint32( this_id ) ].parent_id = parent_id;
 	// This value is ignored by the create_transformed_keys, but needed by create_direct_keys!
 	// TODO: find a common solution!
Index: /trunk/src/formats/nmd_loader.cc
===================================================================
--- /trunk/src/formats/nmd_loader.cc	(revision 486)
+++ /trunk/src/formats/nmd_loader.cc	(revision 487)
@@ -66,5 +66,5 @@
 {
 	if ( count == 0 ) return;
-	source.seek( count * sizeof( nmd_attribute ), origin::CUR );
+	source.seek( long( count * sizeof( nmd_attribute ) ), origin::CUR );
 }
 
@@ -220,9 +220,5 @@
 void nv::nmd_dump_bones( stream& stream_out, const data_node_list& nodes )
 {
-	uint32 total = sizeof( nmd_animation_header );
-	for ( auto node : nodes )
-	{
-		total += sizeof( nmd_element_header );
-	}
+	uint32 total = sizeof( nmd_animation_header ) + sizeof( nmd_element_header ) * nodes.size();
 
 	nmd_element_header header;
Index: /trunk/src/gfx/image.cc
===================================================================
--- /trunk/src/gfx/image.cc	(revision 486)
+++ /trunk/src/gfx/image.cc	(revision 487)
@@ -26,6 +26,7 @@
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
+	NV_ASSERT( size.x >= 0 && size.y >= 0, "bad parameters passed to image!" );
 	sint32 bsize = m_size.x * m_size.y * static_cast<sint32>( m_depth );
-	m_data = new uint8[ bsize ];
+	m_data = new uint8[ size_t( bsize ) ];
 
 	if ( reversed )
Index: /trunk/src/gfx/mesh_creator.cc
===================================================================
--- /trunk/src/gfx/mesh_creator.cc	(revision 486)
+++ /trunk/src/gfx/mesh_creator.cc	(revision 487)
@@ -265,6 +265,7 @@
 	delete[] tangents2;
 
-	uint32 n_channel_index = m_data->get_channel_index( slot::NORMAL );
-	data_channel_set_creator( m_data ).set_channel( n_channel_index, merge_channels( *m_nrm_channel, g_channel ) );
+	int n_channel_index = m_data->get_channel_index( slot::NORMAL );
+	NV_ASSERT( n_channel_index >= 0, "Normal channel not found!" );
+	data_channel_set_creator( m_data ).set_channel( uint32( n_channel_index ), merge_channels( *m_nrm_channel, g_channel ) );
 	initialize();
 }
Index: /trunk/src/gfx/texture_font.cc
===================================================================
--- /trunk/src/gfx/texture_font.cc	(revision 486)
+++ /trunk/src/gfx/texture_font.cc	(revision 487)
@@ -80,5 +80,5 @@
 static uint8* convert_to_rgba(uint8* rgb, const int lines, const int line_count, const int line_bpitch )
 {
-	uint8* result = new uint8[ lines * line_count * 4 ];
+	uint8* result = new uint8[ static_cast< uint32 >( lines * line_count * 4 ) ];
 	uint8* rgba   = result;
 	for(int l=0; l<lines; ++l) 
Index: /trunk/src/gl/gl_context.cc
===================================================================
--- /trunk/src/gl/gl_context.cc	(revision 486)
+++ /trunk/src/gl/gl_context.cc	(revision 487)
@@ -216,5 +216,5 @@
 			glBindBufferBase( buffer_type_to_enum( info->type ), index, info->glid );
 		else
-			glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, offset, size );
+			glBindBufferRange( buffer_type_to_enum( info->type ), index, info->glid, static_cast<GLintptr>( offset ), static_cast<GLsizeiptr>( size ) );
 	}
 }
@@ -790,5 +790,5 @@
 		else
 		{
-			glDrawArrays( primitive_to_enum(prim), first, static_cast<GLsizei>( count ) );
+			glDrawArrays( primitive_to_enum(prim), static_cast<GLint>( first ), static_cast<GLsizei>( count ) );
 		}
 		unbind( va );
Index: /trunk/src/gl/gl_device.cc
===================================================================
--- /trunk/src/gl/gl_device.cc	(revision 486)
+++ /trunk/src/gl/gl_device.cc	(revision 487)
@@ -358,6 +358,6 @@
 	if ( info )
 	{
-		int result = glGetUniformBlockIndex( info->glid, name.data() );
-		if ( result >= 0 ) return result;
+		GLuint result = glGetUniformBlockIndex( info->glid, name.data() );
+		if ( result != GL_INVALID_INDEX ) return static_cast<int>( result );
 		if ( fatal )
 		{
@@ -427,18 +427,19 @@
 		if ( ubase->is_dirty() )
 		{
-			int uloc = ubase->get_location();
+			GLint   uloc = ubase->get_location();
+			GLsizei size = static_cast<GLsizei>( ubase->get_length() );
 			switch( ubase->get_type() )
 			{
-			case FLOAT          : glUniform1fv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break;
-			case INT            : glUniform1iv( uloc, ubase->get_length(), static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break;
-			case FLOAT_VECTOR_2 : glUniform2fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
-			case FLOAT_VECTOR_3 : glUniform3fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
-			case FLOAT_VECTOR_4 : glUniform4fv( uloc, ubase->get_length(), reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
-			case INT_VECTOR_2   : glUniform2iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
-			case INT_VECTOR_3   : glUniform3iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
-			case INT_VECTOR_4   : glUniform4iv( uloc, ubase->get_length(), reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
-			case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break;
-			case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break;
-			case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, ubase->get_length(), GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break;
+			case FLOAT          : glUniform1fv( uloc, size, static_cast< uniform< enum_to_type< FLOAT >::type >*>( ubase )->get_value() ); break;
+			case INT            : glUniform1iv( uloc, size, static_cast< uniform< enum_to_type< INT >::type >*>( ubase )->get_value() ); break;
+			case FLOAT_VECTOR_2 : glUniform2fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
+			case FLOAT_VECTOR_3 : glUniform3fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
+			case FLOAT_VECTOR_4 : glUniform4fv( uloc, size, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
+			case INT_VECTOR_2   : glUniform2iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_2 >::type >*>( ubase )->get_value())); break;
+			case INT_VECTOR_3   : glUniform3iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_3 >::type >*>( ubase )->get_value())); break;
+			case INT_VECTOR_4   : glUniform4iv( uloc, size, reinterpret_cast<const GLint*>( static_cast< uniform< enum_to_type< INT_VECTOR_4 >::type >*>( ubase )->get_value())); break;
+			case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*>( ubase )->get_value())); break;
+			case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*>( ubase )->get_value())); break;
+			case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, size, GL_FALSE, reinterpret_cast<const GLfloat*>( static_cast< uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*>( ubase )->get_value())); break;
 			default : break; // error?
 			}
@@ -507,5 +508,5 @@
 		}
 
-		uniform_base* u = uniform_base::create( utype, uni_loc, uni_len );
+		uniform_base* u = uniform_base::create( utype, uni_loc, size_t( uni_len ) );
 		NV_ASSERT( u, "Unknown uniform type!" );
 		(*p->m_uniform_map)[ name ] = u;
Index: /trunk/src/gui/gui_ascii_renderer.cc
===================================================================
--- /trunk/src/gui/gui_ascii_renderer.cc	(revision 486)
+++ /trunk/src/gui/gui_ascii_renderer.cc	(revision 487)
@@ -18,5 +18,5 @@
 	bool   clear;
 	bool   border;
-	uchar8 border_chars[8];
+	char   border_chars[8];
 	uint32 border_color;
 	uint32 text_color;
@@ -67,5 +67,5 @@
 				er->border_color = uint32( border_color );
 			for ( uint32 i = 0; i < 8 && i < path.length(); i++ )
-				er->border_chars[i] = static_cast< uchar8 >( path[i] );
+				er->border_chars[i] = path[i];
 		}
 	}
@@ -102,5 +102,5 @@
 		for ( char c : e->m_text )
 		{
-			m_terminal->print( p, er->text_color, static_cast< unsigned char >( c ) );
+			m_terminal->print( p, er->text_color, c );
 			++p.x;
 		}
Index: /trunk/src/gui/gui_gfx_renderer.cc
===================================================================
--- /trunk/src/gui/gui_gfx_renderer.cc	(revision 486)
+++ /trunk/src/gui/gui_gfx_renderer.cc	(revision 487)
@@ -311,5 +311,5 @@
 		}
 
-		e->m_text;
+//		e->m_text;
 		if ( !e->m_text.empty() )
 		{
Index: /trunk/src/gui/gui_style.cc
===================================================================
--- /trunk/src/gui/gui_style.cc	(revision 486)
+++ /trunk/src/gui/gui_style.cc	(revision 487)
@@ -33,7 +33,7 @@
 	if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TTABLE ) ) return false;
 	vec = vec4();
-	for ( int i = 0; i < 4; ++i )
+	for ( size_t i = 0; i < 4; ++i )
 	{
-		lua_rawgeti( m_lua, -1, i+1 );
+		lua_rawgeti( m_lua, -1, int(i+1) );
 		if ( lua_isnil( m_lua, -1 ) ) return true;
 		vec[i] = static_cast< float >( lua_tonumber( m_lua, -1 ) );
Index: /trunk/src/image/miniz.cc
===================================================================
--- /trunk/src/image/miniz.cc	(revision 486)
+++ /trunk/src/image/miniz.cc	(revision 487)
@@ -3,4 +3,16 @@
 
 using namespace nv;
+
+#define MINIZ_NO_TIME
+#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES
+
+#define MINIZ_HAS_64BIT_REGISTERS 0
+#define TINFL_USE_64BIT_BITBUF 0
+
+#if NV_COMPILER == NV_CLANG
+#pragma clang diagnostic ignored "-Wunused-macros"
+#pragma clang diagnostic ignored "-Wold-style-cast"
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#endif
 
 #if defined( _M_IX86 ) || defined( _M_X64 ) || defined( __i386__ ) || defined( __i386 ) || defined( __i486__ ) || defined( __i486 ) || defined( i386 ) || defined( __ia64__ ) || defined( __x86_64__ )
Index: /trunk/src/image/png_loader.cc
===================================================================
--- /trunk/src/image/png_loader.cc	(revision 486)
+++ /trunk/src/image/png_loader.cc	(revision 487)
@@ -10,4 +10,13 @@
 
 using namespace nv;
+
+#if NV_COMPILER == NV_CLANG
+#pragma clang diagnostic ignored "-Wunused-macros"
+#pragma clang diagnostic ignored "-Wold-style-cast"
+#pragma clang diagnostic ignored "-Wsign-conversion"
+#pragma clang diagnostic ignored "-Wreserved-id-macro"
+#pragma clang diagnostic ignored "-Wmissing-prototypes"
+#define NULL 0
+#endif
 
 enum
@@ -322,10 +331,15 @@
 };
 
+static int iabs( int a )
+{
+	return a < 0 ? -a : a;
+}
+
 static int stbi__paeth( int a, int b, int c )
 {
 	int p = a + b - c;
-	int pa = abs( p - a );
-	int pb = abs( p - b );
-	int pc = abs( p - c );
+	int pa = iabs( p - a );
+	int pb = iabs( p - b );
+	int pc = iabs( p - c );
 	if ( pa <= pb && pa <= pc ) return a;
 	if ( pb <= pc ) return b;
@@ -1050,5 +1064,5 @@
 		case 3: format.format = RGB; break;
 		case 4: format.format = RGBA; break;
-		default: return false;
+		default: return nullptr;
 		}
 		size = ivec2( x, y );
Index: /trunk/src/io/c_stream.cc
===================================================================
--- /trunk/src/io/c_stream.cc	(revision 486)
+++ /trunk/src/io/c_stream.cc	(revision 487)
@@ -50,5 +50,5 @@
 {
 	NV_ASSERT( buffer != nullptr && max_count != 0, "Bad parameter passed to write!" );
-	char* result = ::fgets( buffer, max_count, reinterpret_cast<FILE*>( m_file ) );
+	char* result = ::fgets( buffer, static_cast<int>( max_count ), reinterpret_cast<FILE*>( m_file ) );
 	if ( !result ) return false;
 	return true;
Index: /trunk/src/lib/gl.cc
===================================================================
--- /trunk/src/lib/gl.cc	(revision 486)
+++ /trunk/src/lib/gl.cc	(revision 487)
@@ -161,7 +161,7 @@
 	if ( wgl_library_loaded ) return true;
 
-	HGLRC (NV_GL_APIENTRY *wgl_createcontext) (HDC)        = nullptr;
-	BOOL  (NV_GL_APIENTRY *wgl_makecurrent)   (HDC, HGLRC) = nullptr;
-	BOOL  (NV_GL_APIENTRY *wgl_deletecontext) (HGLRC)      = nullptr;
+	HGLRC ( NV_GL_APIENTRY *wgl_createcontext) (HDC)        = nullptr;
+	BOOL  ( NV_GL_APIENTRY *wgl_makecurrent)   (HDC, HGLRC) = nullptr;
+	BOOL  ( NV_GL_APIENTRY *wgl_deletecontext) (HGLRC)      = nullptr;
 
 	void_assign( wgl_createcontext, gl_library.get("wglCreateContext") );
Index: /trunk/src/lua/lua_math.cc
===================================================================
--- /trunk/src/lua/lua_math.cc	(revision 486)
+++ /trunk/src/lua/lua_math.cc	(revision 487)
@@ -11,5 +11,5 @@
 #include "nv/stl/type_traits/common.hh"
 
-static int nlua_swizzel_lookup[256];
+static size_t nlua_swizzel_lookup[256];
 
 using nv::lua::detail::is_vec;
@@ -18,5 +18,5 @@
 using nv::lua::detail::push_vec;
 
-inline bool nlua_is_swizzel( const unsigned char* str, int max )
+inline bool nlua_is_swizzel( const unsigned char* str, size_t max )
 {
 	while (*str)
@@ -279,7 +279,7 @@
 	{
  		switch (len) {
-		case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
-		case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
-		case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
+		case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
+		case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
+		case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
  		default: break;
 		}
Index: /trunk/src/stl/assert.cc
===================================================================
--- /trunk/src/stl/assert.cc	(revision 486)
+++ /trunk/src/stl/assert.cc	(revision 487)
@@ -28,7 +28,14 @@
 #	else // NV_COMPILER
 #	if NV_COMPILER == NV_CLANG
-extern "C" {
-	extern void __assert(const char *, const char *, unsigned int, const char *) NV_NORETURN;
+// extern "C" {
+// 	extern void __assert(const char *, const char *, unsigned int, const char *) NV_NORETURN;
+// }
+
+int error_here;
+static void __assert( const char *, const char *, unsigned int, const char * ) NV_NORETURN
+{
+	//no-op
 }
+
 #define NV_ASSERT_IMPL __assert
 #	else
