Index: /trunk/nv/base/assert.hh
===================================================================
--- /trunk/nv/base/assert.hh	(revision 401)
+++ /trunk/nv/base/assert.hh	(revision 402)
@@ -39,8 +39,11 @@
 #endif
 
+// TODO: assert levels
 #if NV_DEBUG
 #define NV_ASSERT(cond, msg) NV_ASSERT_IMPL( (cond) && "assertion failed:" msg )
+#define NV_DEBUG_ASSERT(cond, msg) NV_ASSERT_IMPL( (cond) && "assertion failed:" msg )
 #else  
-#define NV_ASSERT(cond, msg)     ((void)0)
+#define NV_ASSERT(cond, msg) ((void)0)
+#define NV_DEBUG_ASSERT(cond, msg) ((void)0)
 #endif 
 
Index: /trunk/nv/base/capi.hh
===================================================================
--- /trunk/nv/base/capi.hh	(revision 401)
+++ /trunk/nv/base/capi.hh	(revision 402)
@@ -12,4 +12,6 @@
  * This header is temporary
  */
+
+// TODO: sanity checking with NV_DEBUG_ASSERT
 
 #ifndef NV_BASE_CAPI_HH
@@ -110,10 +112,10 @@
 	inline void* nvmemset( void *dest, unsigned char value, size_t count )
 	{
-		return NV_CAPI_CALL( memset )( dest, (int)value, count );
+		return NV_CAPI_CALL( memset )( dest, static_cast<int>( value ), count );
 	}
 
 	inline void* nvmemchr( const void *src, unsigned char value, size_t max_count )
 	{
-		return NV_CAPI_CALL( memchr )( src, (int)value, max_count );
+		return NV_CAPI_CALL( memchr )( src, static_cast<int>( value ), max_count );
 	}
 
Index: /trunk/nv/base/common.hh
===================================================================
--- /trunk/nv/base/common.hh	(revision 401)
+++ /trunk/nv/base/common.hh	(revision 402)
@@ -7,6 +7,4 @@
 #ifndef NV_BASE_COMMON_HH
 #define NV_BASE_COMMON_HH
-
-#define _ITERATOR_DEBUG_LEVEL 0
 
 // NV Library version
@@ -199,5 +197,5 @@
 	using size_t    = decltype( sizeof(0) );
 #endif
-	using ptrdiff_t = decltype((int*)0 - (int*)0);
+	using ptrdiff_t = decltype( static_cast<int*>(0) - static_cast<int*>(0) );
 	using nullptr_t = decltype( nullptr );
 	
@@ -256,5 +254,5 @@
 	inline size_t offset_of( T OBJ::*ptr )
 	{
-		return ( ( size_t )&( ( (OBJ*)0 )->*ptr ) );
+		return static_cast<size_t>( &( ( static_cast<OBJ*>(0) )->*ptr ) );
 	}
 
@@ -262,10 +260,10 @@
 	constexpr T narrow_cast( const U& a )
 	{
-		return static_cast<T>( a & T( -1 ) );
+		return static_cast<T>( a & static_cast<T>( -1 ) );
 	}
 
 } // namespace nv
 
-static_assert( nv::size_t( -1 ) > 0,      "size_t is signed!" );
+static_assert( static_cast<nv::size_t>( -1 ) > 0, "size_t is signed!" );
 static_assert( sizeof( nv::size_t ) >= 4, "size_t is smaller than 4 bytes!" );
 static_assert( sizeof( nv::sint8 ) == 1, "sint8 size isn't 1 bytes" );
Index: /trunk/nv/base/rtti_support.hh
===================================================================
--- /trunk/nv/base/rtti_support.hh	(revision 401)
+++ /trunk/nv/base/rtti_support.hh	(revision 402)
@@ -49,5 +49,5 @@
  		constexpr uint64 rtti_hash_impl( char c, const char* remain, uint64 value )
  		{
- 			return c == 0 ? value : rtti_hash_impl( remain[0], remain + 1, (uint64)(uint64)( value ^ (uint64)c ) * rtti_hash_prime );
+ 			return c == 0 ? value : rtti_hash_impl( remain[0], remain + 1, static_cast<uint64>( value ^ static_cast<uint64>(c) ) * rtti_hash_prime );
  		}
 
@@ -66,5 +66,5 @@
 		static uint64 hash()
 		{
-			static_assert( NV_TYPE_FAIL(T), "Type not registered!" );
+			static_assert( NV_TYPE_FAIL( T ), "Type not registered!" );
 			return 0;
 		}
Index: /trunk/nv/core/library.hh
===================================================================
--- /trunk/nv/core/library.hh	(revision 401)
+++ /trunk/nv/core/library.hh	(revision 402)
@@ -127,11 +127,4 @@
 
 		/**
-		 * Destructor.
-		 *
-		 * It must not throw any exceptions because of the inheritance
-		 */
-		~library_error() throw() {}
-
-		/**
 		 * Returns library name
 		 */
Index: /trunk/nv/core/logging.hh
===================================================================
--- /trunk/nv/core/logging.hh	(revision 401)
+++ /trunk/nv/core/logging.hh	(revision 402)
@@ -78,5 +78,5 @@
 		static bool can_log( log_level level )
 		{
-			return logger_base::is_valid() && (unsigned int)reference().get_level() >= (unsigned int)level;
+			return logger_base::is_valid() && static_cast<unsigned int>( reference().get_level() ) >= static_cast<unsigned int>( level );
 		}
 
@@ -84,5 +84,5 @@
 		{
 			*m_pos = '\0';
-			log( level, string_view( m_message, (size_t)( m_pos - m_message ) ) );
+			log( level, string_view( m_message, static_cast<size_t>( m_pos - m_message ) ) );
 			m_pos = m_message;
 		}
Index: /trunk/nv/detail/io_event_list.inc
===================================================================
--- /trunk/nv/detail/io_event_list.inc	(revision 401)
+++ /trunk/nv/detail/io_event_list.inc	(revision 402)
Index: /trunk/nv/detail/key_list.inc
===================================================================
--- /trunk/nv/detail/key_list.inc	(revision 401)
+++ /trunk/nv/detail/key_list.inc	(revision 402)
Index: /trunk/nv/detail/mouse_list.inc
===================================================================
--- /trunk/nv/detail/mouse_list.inc	(revision 401)
+++ /trunk/nv/detail/mouse_list.inc	(revision 402)
Index: /trunk/nv/stl/algorithm.hh
===================================================================
--- /trunk/nv/stl/algorithm.hh	(revision 401)
+++ /trunk/nv/stl/algorithm.hh	(revision 402)
Index: /trunk/nv/stl/algorithm/fill.hh
===================================================================
--- /trunk/nv/stl/algorithm/fill.hh	(revision 401)
+++ /trunk/nv/stl/algorithm/fill.hh	(revision 402)
@@ -35,5 +35,5 @@
 		void fill_impl( BlockAccessIterator first, BlockAccessIterator last, T value, true_type, block_access_iterator_tag )
 		{
-			raw_fill( first, last, (unsigned char)value );
+			raw_fill( first, last, narrow_cast<unsigned char>( value ) );
 		}
 
@@ -49,5 +49,5 @@
 		BlockAccessIterator fill_n_impl( BlockAccessIterator first, size_t count, T value, true_type, block_access_iterator_tag )
 		{
-			return BlockAccessIterator( raw_fill_n( first, count, (unsigned char)value ) );
+			return BlockAccessIterator( raw_fill_n( first, count, narrow_cast<unsigned char>( value ) ) );
 		}
 
Index: /trunk/nv/stl/algorithm/raw.hh
===================================================================
--- /trunk/nv/stl/algorithm/raw.hh	(revision 401)
+++ /trunk/nv/stl/algorithm/raw.hh	(revision 402)
@@ -19,9 +19,21 @@
 namespace nv
 {
+	
+	// TODO: better debug macros, both here as well as in nv*funcs
+	namespace detail
+	{
+		template< typename T >
+		constexpr size_t byte_distance( const T* first, const T* last )
+		{
+			return static_cast<size_t>( reinterpret_cast<uintptr_t>( last ) - reinterpret_cast<uintptr_t>( first ) );
+		}
+
+	}
 
 	template< typename T >
 	T* raw_copy( const T* first, const T* last, T* out )
 	{
-		return (T*)nvmemcpy( out, first, (size_t)( (uintptr_t)last - (uintptr_t)first ) ) + ( last - first );
+		NV_DEBUG_ASSERT( last - first > 0, "raw_copy range fail!" );
+		return static_cast<T*>( nvmemcpy( out, first, detail::byte_distance( first, last ) ) ) + ( last - first );
 	}
 
@@ -29,5 +41,5 @@
 	T* raw_copy_n( const T* ptr, size_t n, T* out )
 	{
-		return (T*)nvmemcpy( out, ptr, n * sizeof( T ) ) + n;
+		return static_cast<T*>( nvmemcpy( out, ptr, n * sizeof( T ) ) ) + n;
 	}
 
@@ -35,5 +47,6 @@
 	T* raw_alias_copy( const T* first, const T* last, T* out )
 	{
-		return (T*)nvmemmove( out, first, (size_t)( (uintptr_t)last - (uintptr_t)first ) ) + ( last - first );
+		NV_DEBUG_ASSERT( last - first > 0, "raw_alias_copy range fail!" );
+		return static_cast<T*>( nvmemmove( out, first, detail::byte_distance( first, last ) ) ) + ( last - first );
 	}
 
@@ -41,5 +54,5 @@
 	T* raw_alias_copy_n( const T* ptr, size_t n, T* out )
 	{
-		return (T*)nvmemmove( out, ptr, n * sizeof( T ) ) + n;
+		return static_cast<T*>( nvmemmove( out, ptr, n * sizeof( T ) ) ) + n;
 	}
 
@@ -47,5 +60,6 @@
 	T* raw_zero( T* first, T* last )
 	{
-		return (T*)nvmemset( first, 0, (size_t)( (uintptr_t)last - (uintptr_t)first ) ) + ( last - first );
+		NV_DEBUG_ASSERT( last - first > 0, "raw_zero range fail!" );
+		return static_cast<T*>( nvmemset( first, 0, detail::byte_distance( first, last ) ) ) + ( last - first );
 	}
 
@@ -53,5 +67,5 @@
 	T* raw_zero_n( T* ptr, size_t n )
 	{
-		return (T*)nvmemset( ptr, 0, n * sizeof( T ) ) + n;
+		return static_cast<T*>( nvmemset( ptr, 0, n * sizeof( T ) ) ) + n;
 	}
 
@@ -59,5 +73,6 @@
 	T* raw_fill( T* first, T* last, unsigned char value )
 	{
-		return (T*)nvmemset( first, value, (size_t)( (uintptr_t)last - (uintptr_t)first ) ) + ( last - first );
+		NV_DEBUG_ASSERT( last - first > 0, "raw_fill range fail!" );
+		return static_cast<T*>( nvmemset( first, value, detail::byte_distance( first, last ) ) ) + ( last - first );
 	}
 
@@ -65,5 +80,5 @@
 	T* raw_fill_n( T* ptr, size_t n, unsigned char value )
 	{
-		return (T*)nvmemset( ptr, value, n * sizeof( T ) ) + n;
+		return static_cast<T*>( nvmemset( ptr, value, n * sizeof( T ) ) ) + n;
 	}
 
Index: /trunk/nv/stl/container/hash_table.hh
===================================================================
--- /trunk/nv/stl/container/hash_table.hh	(revision 401)
+++ /trunk/nv/stl/container/hash_table.hh	(revision 402)
@@ -56,5 +56,4 @@
 		public:
 			constexpr iterator_base() : m_node( nullptr ) {}
-			constexpr iterator_base( const iterator_base& it ) : m_node( it.m_node ) {}
 			const entry_type* entry() const { return m_node;  }
 			reference operator*() const { return m_node->value; }
@@ -72,12 +71,7 @@
 			typedef iterator_base< IsConst > base_type;
 
-			constexpr node_iterator() : base_type( nullptr ) {}
-			constexpr node_iterator( const node_iterator& it ) : base_type( it.m_node ) {}
-
+			constexpr node_iterator() = default;
 			template < bool B, typename = enable_if_t< IsConst && !B > >
-			constexpr node_iterator( const node_iterator< B >& it )
-				: base_type( it.m_node )
-			{
-			}
+			constexpr node_iterator( const node_iterator< B >& it ) : base_type( it.m_node ) {}
 
 			node_iterator& operator++() { increment(); return *this; }
@@ -236,5 +230,5 @@
 		inline size_type max_size() const { return 2147483647; }
 		inline size_type max_bucket_count() const { return 2147483647; }
-		inline float load_factor() const { return (float)m_element_count / (float)m_bucket_count; }
+		inline float load_factor() const { return static_cast<float>( m_element_count ) / static_cast<float>( m_bucket_count ); }
 		inline float max_load_factor() const { return m_max_load_factor; }
 		inline void max_load_factor( float ml ) { m_max_load_factor = ml; }
@@ -312,5 +306,5 @@
 		void zero()
 		{
-			m_buckets       = (node_type**)&g_hash_table_empty[0];
+			m_buckets       = reinterpret_cast<node_type**>( &g_hash_table_empty[0] );
 			m_bucket_count  = 1;
 			m_element_count = 0;
@@ -343,7 +337,7 @@
 		{
 			NV_ASSERT( new_count > 1, "allocate_buckets fail!" );
-			node_type** buckets = ( node_type** )nvmalloc( ( new_count + 1 ) * sizeof( node_type* ) );
+			node_type** buckets = reinterpret_cast<node_type**>( nvmalloc( ( new_count + 1 ) * sizeof( node_type* ) ) );
 			nvmemset( buckets, 0, ( new_count + 1 ) * sizeof( node_type* ) );
-			buckets[ new_count ] = reinterpret_cast<node_type*>( (uintptr_t)~0 ); // sentinel
+			buckets[ new_count ] = reinterpret_cast<node_type*>( uintptr_t(~0) ); // sentinel
 			return buckets;
 		}
@@ -356,5 +350,5 @@
 		node_type* alloc_node()
 		{
-			return (node_type*)nvmalloc( sizeof( node_type ) );
+			return static_cast<node_type*>( nvmalloc( sizeof( node_type ) ) );
 		}
 
Index: /trunk/nv/stl/container/hash_table_policy.hh
===================================================================
--- /trunk/nv/stl/container/hash_table_policy.hh	(revision 401)
+++ /trunk/nv/stl/container/hash_table_policy.hh	(revision 402)
@@ -279,10 +279,10 @@
 		static uint32 get_bucket_count( uint32 element_count, float load_factor )
 		{
-			uint32 min_count = (uint32)( element_count / load_factor );
+			uint32 min_count = static_cast<uint32>( element_count / load_factor );
 			return get_prime_larger_or_equal_to( min_count );
 		}
 		static uint32 is_rehash_required( uint32 bucket_count, uint32 element_count, float load_factor )
 		{
-			uint32 min_count = (uint32)( element_count / load_factor );
+			uint32 min_count = static_cast<uint32>( element_count / load_factor );
 			if ( bucket_count < 2 || min_count > bucket_count )
 			{
Index: /trunk/nv/stl/functional/hash.hh
===================================================================
--- /trunk/nv/stl/functional/hash.hh	(revision 401)
+++ /trunk/nv/stl/functional/hash.hh	(revision 402)
@@ -61,9 +61,9 @@
 			static constexpr H str_hash_impl( char c, const char* remain, H value )
 			{
-				return c == 0 ? value : str_hash_impl( remain[0], remain + 1, (H)(H)( value ^ (H)c ) * hash_prime );
+				return c == 0 ? value : str_hash_impl( remain[0], remain + 1, static_cast<H>( value ^ static_cast<H>( c ) ) * hash_prime );
 			}
 			static constexpr H hash_impl( const char* current, size_t remain, H value )
 			{
-				return remain == 0 ? value : hash_impl( current + 1, remain - 1, (H)(H)( value ^ (H)(current[0]) ) * hash_prime );
+				return remain == 0 ? value : hash_impl( current + 1, remain - 1, static_cast<H>( value ^ static_cast<H>( current[0] ) ) * hash_prime );
 			}
 		};
@@ -119,5 +119,5 @@
 		{
 			return value == 0.0f ? detail::fnv_hash<H>( &value, 1 ) : 0;
-		};
+		}
 		inline H operator()( float value ) const { return get( value ); }
 	};
@@ -130,5 +130,5 @@
 		{
 			return value == 0.0f ? detail::fnv_hash<H>( &value, 1 ) : 0;
-		};
+		}
 		inline H operator()( float value ) const { return get( value ); }
 	};
Index: /trunk/nv/stl/iterator.hh
===================================================================
--- /trunk/nv/stl/iterator.hh	(revision 401)
+++ /trunk/nv/stl/iterator.hh	(revision 402)
Index: /trunk/nv/stl/limits.hh
===================================================================
--- /trunk/nv/stl/limits.hh	(revision 401)
+++ /trunk/nv/stl/limits.hh	(revision 402)
@@ -36,5 +36,5 @@
 		static constexpr int sc_bit = sizeof( signed char ) * 8;
 		static constexpr char c_min = ( char( 0 ) < char( -1 ) ? 0 : -128 );
-		static constexpr char c_max = ( char( 0 ) < char( -1 ) ? 255 : 127 );
+		static constexpr char c_max = ( char( 0 ) < char( -1 ) ? narrow_cast<char>( 255 ) : 127 );
 		static constexpr int c_bit = sizeof( char ) * 8;
 		static constexpr unsigned short us_min = 0;
Index: /trunk/nv/stl/memory.hh
===================================================================
--- /trunk/nv/stl/memory.hh	(revision 401)
+++ /trunk/nv/stl/memory.hh	(revision 402)
@@ -163,8 +163,8 @@
 	}
 
-	template <typename TYPE>
+	template < typename T >
 	void raw_destroy_object( void* object )
 	{
-		( (TYPE*)object )->TYPE::~TYPE();
+		static_cast<T*>( object )->T::~T();
 	}
 
@@ -183,5 +183,5 @@
 			ForwardIterator it( first );
 			for ( ; it != last; ++it )
-				::new( (void*)&*it ) value_type( value );
+				::new( static_cast<void*>( addressof( *it ) ) ) value_type( value );
 		}
 
@@ -198,5 +198,5 @@
 			ForwardIterator it( first );
 			for ( ; count > 0; --count, ++it )
-				::new ( (void*)&*it ) value_type( value );
+				::new ( static_cast<void*>( addressof( *it ) ) ) value_type( value );
 			return it;
 		}
@@ -214,5 +214,5 @@
 			ForwardIterator it( first );
 			for ( ; it != last; ++it )
-				::new( (void*)&*it ) value_type;
+				::new( static_cast<void*>( addressof( *it ) ) ) value_type;
 		}
 
@@ -229,5 +229,5 @@
 			ForwardIterator it( first );
 			for ( ; count > 0; --count, ++it )
-				::new( (void*)&*it ) value_type;
+				::new( static_cast<void*>( addressof( *it ) ) ) value_type;
 		}
 
@@ -323,5 +323,5 @@
 		ForwardIterator it( first );
 		for ( ; it != last; ++it )
-			::new( (void*)&*it ) value_type( forward<Args>( params )... );
+			::new( static_cast<void*>( addressof( *it ) ) ) value_type( forward<Args>( params )... );
 	}
 
Index: /trunk/nv/stl/string.hh
===================================================================
--- /trunk/nv/stl/string.hh	(revision 401)
+++ /trunk/nv/stl/string.hh	(revision 402)
@@ -168,5 +168,5 @@
 		size_type reverse_distance( ReverseIterator first, ReverseIterator last ) const
 		{
-			return this->size() - 1 - (size_t)nv::distance( first, last );
+			return this->size() - 1 - static_cast<size_t>( nv::distance( first, last ) );
 		}
 	};
@@ -252,5 +252,5 @@
 	{
 		size_type this_size = this->size();
-		int cmp = nvmemcmp( this->data(), rhs.data(), ( nv::min )( this_size, rhs.size() ) );
+		int cmp = nvmemcmp( this->data(), rhs.data(), nv::min( this_size, rhs.size() ) );
 		return cmp != 0 ? cmp : ( this_size == rhs.size() ? 0 : this_size < rhs.size() ? -1 : 1 );
 	}
@@ -282,6 +282,6 @@
 	{
 		if ( pos >= this->size() ) return npos;
-		const_iterator it = nv::find_if( this->cbegin() + (difference_type)pos, this->cend(), [=] ( value_type val ) { return val == c; } );
-		return it == this->cend() ? npos : (size_type)nv::distance( this->cbegin(), it );
+		const_iterator it = nv::find_if( this->cbegin() + static_cast<difference_type>( pos ), this->cend(), [=] ( value_type val ) { return val == c; } );
+		return it == this->cend() ? npos : static_cast<size_type>( nv::distance( this->cbegin(), it ) );
 	}
 	template < typename Storage >
@@ -289,6 +289,6 @@
 	{
 		if ( pos >= this->size() ) return npos;
-		const_iterator it = nv::search( this->cbegin() + (difference_type)pos, this->cend(), s.cbegin(), s.cend() );
-		return it == this->cend() ? npos : (size_type)nv::distance( this->cbegin(), it );
+		const_iterator it = nv::search( this->cbegin() + static_cast<difference_type>( pos ), this->cend(), s.cbegin(), s.cend() );
+		return it == this->cend() ? npos : static_cast<size_type>( nv::distance( this->cbegin(), it ) );
 	}
 
@@ -297,5 +297,5 @@
 	{
 		if ( pos >= this->size() ) return npos;
-		const_reverse_iterator it = nv::find_if( this->crbegin() + (difference_type)pos, this->crend(), [=] ( value_type val ) { return val == c; } );
+		const_reverse_iterator it = nv::find_if( this->crbegin() + static_cast<difference_type>( pos ), this->crend(), [=] ( value_type val ) { return val == c; } );
 		return it == this->crend() ? npos : this->reverse_distance( this->crbegin(), it );
 	}
@@ -304,5 +304,5 @@
 	{
 		if ( pos >= this->size() ) return npos;
-		const_reverse_iterator it = nv::search( this->crbegin() + (difference_type)pos, this->crend(), s.crbegin(), s.crend() );
+		const_reverse_iterator it = nv::search( this->crbegin() + static_cast<difference_type>( pos ), this->crend(), s.crbegin(), s.crend() );
 		return it == this->crend() ? npos : this->reverse_distance( this->crbegin(), it );
 	}
@@ -317,5 +317,5 @@
 	{
 		const_iterator it = nv::find_first_of( this->cbegin(), this->cend(), s.cbegin(), s.cend() );
-		return it == this->cend() ? npos : (size_type)nv::distance( this->cbegin(), it );
+		return it == this->cend() ? npos : static_cast<size_type>( nv::distance( this->cbegin(), it ) );
 	}
 
@@ -337,5 +337,5 @@
 		for ( const_iterator it = this->cbegin(); it != this->cend(); ++it )
 			if ( c != *it )
-			return (size_type)distance( this->cbegin(), it );
+			return static_cast<size_type>( nv::distance( this->cbegin(), it ) );
 		return npos;
 	}
@@ -344,6 +344,6 @@
 	{
 		for ( const_iterator it = this->cbegin(); it != this->cend(); ++it )
-			if ( 0 == nvmemchr( s.data(), (uchar8)*it, s.size() ) )
-			return (size_type)distance( this->cbegin(), it );
+			if ( 0 == nvmemchr( s.data(), static_cast<uchar8>( *it ), s.size() ) )
+			return static_cast<size_type>( nv::distance( this->cbegin(), it ) );
 		return npos;
 	}
@@ -361,5 +361,5 @@
 	{
 		for ( const_reverse_iterator it = this->crbegin(); it != this->crend(); ++it )
-			if ( 0 == nvmemchr( s.data(), (uchar8)*it, s.size() ) )
+			if ( 0 == nvmemchr( s.data(), static_cast<uchar8>( *it ), s.size() ) )
 			return this->reverse_distance( this->crbegin(), it );
 		return npos;
@@ -434,10 +434,16 @@
 #undef NV_STRING_REF_CAST_OPERATORS
 
-size_t sint32_to_buffer( sint32 n, char* str );
-size_t sint64_to_buffer( sint64 n, char* str );
-size_t uint32_to_buffer( uint32 n, char* str );
-size_t uint64_to_buffer( uint64 n, char* str );
-size_t f32_to_buffer( f32 n, char* str );
-size_t f64_to_buffer( f64 n, char* str );
+	size_t sint32_to_buffer( sint32 n, char* str );
+	size_t sint64_to_buffer( sint64 n, char* str );
+	size_t uint32_to_buffer( uint32 n, char* str );
+	size_t uint64_to_buffer( uint64 n, char* str );
+	size_t f32_to_buffer( f32 n, char* str );
+	size_t f64_to_buffer( f64 n, char* str );
+	sint32 buffer_to_sint32( const char* str, char** end );
+	sint64 buffer_to_sint64( const char* s, char** end );
+	uint32 buffer_to_uint32( const char* s, char** end );
+	uint64 buffer_to_uint64( const char* s, char** end );
+	float buffer_to_f32( const char* s, char** end );
+	double buffer_to_f64( const char* s, char** end );
 
 	// const string is movable but not copyable
Index: /trunk/nv/stl/type_traits.hh
===================================================================
--- /trunk/nv/stl/type_traits.hh	(revision 401)
+++ /trunk/nv/stl/type_traits.hh	(revision 402)
@@ -11,5 +11,5 @@
  */
 
- // TODO : "......" function match version?
+ // TODO : "..., ..." function match version?
 // TODO : the following symbols are unimplemented:
 //  * is_constructible, is_trivially_constructible, is_nothrow_constructible
Index: /trunk/nv/stl/type_traits/common.hh
===================================================================
--- /trunk/nv/stl/type_traits/common.hh	(revision 401)
+++ /trunk/nv/stl/type_traits/common.hh	(revision 402)
@@ -182,5 +182,5 @@
 	constexpr typename remove_reference<T>::type&& move( T&& arg ) noexcept
 	{
-		return ( ( typename remove_reference<T>::type&& )arg );
+		return static_cast<typename remove_reference<T>::type&&>( arg );
 	}
 
Index: /trunk/nv/stl/type_traits/function.hh
===================================================================
--- /trunk/nv/stl/type_traits/function.hh	(revision 401)
+++ /trunk/nv/stl/type_traits/function.hh	(revision 402)
@@ -10,5 +10,5 @@
  * @brief type traits - function traits
  */
-// TODO: remove_cv? call traits? support "......"?
+// TODO: remove_cv? call traits? 
 
 #ifndef NV_STL_TRAITS_FUNCTION_HH
@@ -114,14 +114,23 @@
 		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( CALLDECL C::* )( Args... ) const > { typedef R result_type; }; \
 		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( CALLDECL C::* )( Args... ) volatile > { typedef R result_type; }; \
-		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( CALLDECL C::* )( Args... ) const volatile > { typedef R result_type; };
-
+		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( CALLDECL C::* )( Args... ) const volatile > { typedef R result_type; }; \
+		
+//NV_EMIT_WEAK_RESULT_TYPE_CALLDECL()
 NV_EMIT_WEAK_RESULT_TYPE_CALLDECL( __cdecl )
 NV_EMIT_WEAK_RESULT_TYPE_CALLDECL( __fastcall )
 NV_EMIT_WEAK_RESULT_TYPE_CALLDECL( __vectorcall )
+template < typename R, typename... Args > struct weak_result_type_impl< R __cdecl ( Args..., ... ) > { typedef R result_type; }; \
+template < typename R, typename... Args > struct weak_result_type_impl< R( __cdecl & )( Args..., ... ) > { typedef R result_type; }; \
+template < typename R, typename... Args > struct weak_result_type_impl< R( __cdecl * )( Args..., ... ) > { typedef R result_type; }; \
+template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __cdecl C::* )( Args..., ... ) > { typedef R result_type; }; \
+template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __cdecl C::* )( Args..., ... ) const > { typedef R result_type; }; \
+template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __cdecl C::* )( Args..., ... ) volatile > { typedef R result_type; }; \
+template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __cdecl C::* )( Args..., ... ) const volatile > { typedef R result_type; }; \
+
 #	if NV_ARCHITECTURE == NV_32BIT
 NV_EMIT_WEAK_RESULT_TYPE_CALLDECL( __stdcall )
 template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __thiscall C::* )( Args... ) > { typedef R result_type; };
-template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __thiscall C::* )( Args... ) const > { typedef R result_type; }; \
-template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __thiscall C::* )( Args... ) volatile > { typedef R result_type; }; \
+template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __thiscall C::* )( Args... ) const > { typedef R result_type; }; 
+template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __thiscall C::* )( Args... ) volatile > { typedef R result_type; }; 
 template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( __thiscall C::* )( Args... ) const volatile > { typedef R result_type; };
 #	endif
@@ -129,23 +138,23 @@
 #else
 		template < typename R, typename... Args > struct weak_result_type_impl< R( Args... ) > { typedef R result_type; };
-		template < typename R, typename... Args > struct weak_result_type_impl< R( Args...... ) > { typedef R result_type; };
+		template < typename R, typename... Args > struct weak_result_type_impl< R( Args..., ... ) > { typedef R result_type; };
 		template < typename R, typename... Args > struct weak_result_type_impl< R( Args... ) const > { typedef R result_type; };
-		template < typename R, typename... Args > struct weak_result_type_impl< R( Args...... ) const > { typedef R result_type; };
+		template < typename R, typename... Args > struct weak_result_type_impl< R( Args..., ... ) const > { typedef R result_type; };
 		template < typename R, typename... Args > struct weak_result_type_impl< R( Args... ) volatile > { typedef R result_type; };
-		template < typename R, typename... Args > struct weak_result_type_impl< R( Args...... ) volatile > { typedef R result_type; };
+		template < typename R, typename... Args > struct weak_result_type_impl< R( Args..., ... ) volatile > { typedef R result_type; };
 		template < typename R, typename... Args > struct weak_result_type_impl< R( Args... ) const volatile > { typedef R result_type; };
-		template < typename R, typename... Args > struct weak_result_type_impl< R( Args...... ) const volatile > { typedef R result_type; };
+		template < typename R, typename... Args > struct weak_result_type_impl< R( Args..., ... ) const volatile > { typedef R result_type; };
 		template < typename R, typename... Args > struct weak_result_type_impl< R( & )( Args... ) > { typedef R result_type; };
-		template < typename R, typename... Args > struct weak_result_type_impl< R( & )( Args...... ) > { typedef R result_type; };
+		template < typename R, typename... Args > struct weak_result_type_impl< R( & )( Args..., ... ) > { typedef R result_type; };
 		template < typename R, typename... Args > struct weak_result_type_impl< R( * )( Args... ) > { typedef R result_type; };
-		template < typename R, typename... Args > struct weak_result_type_impl< R( * )( Args...... ) > { typedef R result_type; };
+		template < typename R, typename... Args > struct weak_result_type_impl< R( * )( Args..., ... ) > { typedef R result_type; };
 		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args... ) > { typedef R result_type; };
-		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args...... ) > { typedef R result_type; };
+		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args..., ... ) > { typedef R result_type; };
 		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args... ) const > { typedef R result_type; };
-		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args...... ) const > { typedef R result_type; };
+		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args..., ... ) const > { typedef R result_type; };
 		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args... ) volatile > { typedef R result_type; };
-		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args...... ) volatile > { typedef R result_type; };
+		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args..., ... ) volatile > { typedef R result_type; };
 		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args... ) const volatile > { typedef R result_type; };
-		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args...... ) const volatile > { typedef R result_type; };
+		template < typename R, typename C, typename... Args > struct weak_result_type_impl< R( C::* )( Args..., ... ) const volatile > { typedef R result_type; };
 #endif
 	}
Index: /trunk/nv/stl/type_traits/primary.hh
===================================================================
--- /trunk/nv/stl/type_traits/primary.hh	(revision 401)
+++ /trunk/nv/stl/type_traits/primary.hh	(revision 402)
@@ -60,5 +60,5 @@
 	// is_function_pointer / is_member_function pointer - extension
 	// TODO: sanity check - this is very different - http://en.cppreference.com/w/cpp/types/is_function
-	// TODO: "......" function match version?
+	// TODO: "..., ..." function match version?
 	// TODO: call conventions really needed?
 
Index: /trunk/nv/stl/type_traits/properties.hh
===================================================================
--- /trunk/nv/stl/type_traits/properties.hh	(revision 401)
+++ /trunk/nv/stl/type_traits/properties.hh	(revision 402)
@@ -160,8 +160,6 @@
 		template < typename R, typename... Args >
 		struct is_referenceable < R( Args... ) > : true_type {};
-#if NV_COMPILER != NV_MSVC
 		template < typename R, typename... Args >
-		struct is_referenceable < R( Args...... ) > : true_type {};
-#endif
+		struct is_referenceable < R( Args..., ... ) > : true_type {};
 
 		template < typename To, typename From >
@@ -293,5 +291,5 @@
 			static size_two test( ... );
 		public:
-			static constexpr bool value = sizeof( test<T>( 0 ) ) == 1;
+			static constexpr bool value = sizeof( test( static_cast<T*>( nullptr ) ) ) == 1;
 		};
 	}
Index: /trunk/src/core/library.cc
===================================================================
--- /trunk/src/core/library.cc	(revision 401)
+++ /trunk/src/core/library.cc	(revision 402)
@@ -11,23 +11,20 @@
 #   include <windows.h>
 #   define NV_LIB_EXT ".dll"
-#   define NV_LIB_HANDLE HMODULE
-#   define NV_LIB_OPEN( name ) LoadLibraryEx( name, NULL, LOAD_WITH_ALTERED_SEARCH_PATH )
-#   define NV_LIB_GET( handle, name ) GetProcAddress( handle, name )
-#   define NV_LIB_CLOSE( name ) !FreeLibrary( name )
+#   define NV_LIB_OPEN( name ) static_cast<void*>( LoadLibraryEx( name, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) )
+#   define NV_LIB_GET( handle, name ) reinterpret_cast<void*>( GetProcAddress( static_cast<HMODULE>( handle ), name ) )
+#   define NV_LIB_CLOSE( handle ) ( FreeLibrary( static_cast<HMODULE>( handle ) ) != 0 )
 #elif NV_PLATFORM == NV_LINUX || NV_PLATFORM == NV_APPLE
 #   include <dlfcn.h>
 #   define NV_LIB_EXT ".so"
-#   define NV_LIB_HANDLE void*
 #   define NV_LIB_OPEN( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL)
-#   define NV_LIB_GET( handle, name ) dlsym( handle, name )
-#   define NV_LIB_CLOSE( name ) dlclose( name )
+#   define NV_LIB_GET( handle, name ) dlsym( static_cast<void*>( handle ), name )
+#   define NV_LIB_CLOSE( handle ) ( dlclose( static_cast<void*>( handle ) ) == 0 )
 #elif NV_PLATFORM == NV_APPLE
 #   include "macUtils.h"
 #   include <dlfcn.h>
 #   define NV_LIB_EXT ".dylib"
-#   define NV_LIB_HANDLE CFBundleRef
 #   define NV_LIB_OPEN( name ) mac_loadExeBundle( name )
 #   define NV_LIB_GET( handle, name ) mac_getBundleSym( handle, name )
-#   define NV_LIB_CLOSE( name ) mac_unloadExeBundle( name )
+#   define NV_LIB_CLOSE( handle ) ( mac_unloadExeBundle( handle ) == 0 )
 #endif
 
@@ -83,5 +80,5 @@
     }
 
-    m_handle = (void*)NV_LIB_OPEN( name.c_str() );
+    m_handle = NV_LIB_OPEN( name.c_str() );
 
     if ( m_handle == NULL )
@@ -96,5 +93,5 @@
 void* library::get( string_view symbol )
 {
-	void* result = (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.data() );
+	void* result = NV_LIB_GET( m_handle, symbol.data() );
     if ( !result )
     {
@@ -106,5 +103,5 @@
 void* nv::library::try_get( string_view symbol )
 {
-	return (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.data() );
+	return NV_LIB_GET( m_handle, symbol.data() );
 }
 
@@ -116,14 +113,14 @@
 void library::close()
 {
-    if ( NV_LIB_CLOSE( (NV_LIB_HANDLE)m_handle ) )
+    if ( ! NV_LIB_CLOSE( m_handle ) )
     {
         NV_LOG_ERROR( "library : can't close library '", m_name, "'!" );
     }
-    m_handle = NULL;
+    m_handle = nullptr;
 }
 
 library::~library()
 {
-    if ( m_handle != NULL )
+    if ( m_handle != nullptr )
     {
         close();
@@ -135,14 +132,14 @@
 #if NV_PLATFORM == NV_WINDOWS
     // We do hate WinAPI for code like this, don't we?
-    LPTSTR buffer = NULL;
+    LPTSTR buffer = nullptr;
     FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-        NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &buffer, 0, NULL );
-    std::string msg( (char*)buffer );
+        NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPTSTR>( &buffer ), 0, NULL );
+    std::string msg( reinterpret_cast<char*>( buffer ) );
     LocalFree( buffer );
     return msg;
 #elif NV_PLATFORM == NV_LINUX || NV_PLATFORM == NV_APPLE
-    return string(dlerror());
+    return std::string( dlerror() );
 #else
-    return string("");
+    return std::string("");
 #endif
 }
Index: /trunk/src/core/logger.cc
===================================================================
--- /trunk/src/core/logger.cc	(revision 401)
+++ /trunk/src/core/logger.cc	(revision 402)
@@ -89,5 +89,5 @@
 	for ( auto& sink_info : m_log_sinks )
 	{
-		if ( sink_info.sink && (sink_info.level >= (uint32)level) )
+		if ( sink_info.sink && (sink_info.level >= static_cast<uint32>( level ) ) )
 		{
 			// log and iterate
@@ -106,5 +106,5 @@
 		{
 			sink_info.sink  = sink;
-			sink_info.level = (uint32)level;
+			sink_info.level = static_cast<uint32>( level );
 			return;
 		}
@@ -194,11 +194,12 @@
 	//if ( m_flush ) FlushFileBuffers( m_handle );
 #else
-	fwrite( stamp, ssize, 1, (FILE*)m_handle );
-	fwrite( " [", 2, 1, (FILE*)m_handle );
-	fwrite( NV_LOG_LEVEL_NAME_PAD( level ), 8, 1, (FILE*)m_handle );
-	fwrite( "] ", 2, 1, (FILE*)m_handle );
-	fwrite( message.data(), message.size(), 1, (FILE*)m_handle );
-	fwrite( "\n", 1, 1, (FILE*)m_handle );
-	if ( m_flush ) fflush( (FILE*)m_handle );
+	FILE* file = static_cast<FILE*>( m_handle );
+	fwrite( stamp, ssize, 1, file );
+	fwrite( " [", 2, 1, file );
+	fwrite( NV_LOG_LEVEL_NAME_PAD( level ), 8, 1, file );
+	fwrite( "] ", 2, 1, file );
+	fwrite( message.data(), message.size(), 1, file );
+	fwrite( "\n", 1, 1, file );
+	if ( m_flush ) fflush( file );
 #endif
 }
@@ -226,5 +227,5 @@
 	CloseHandle( m_handle );
 #else
-	fclose( (FILE*) m_handle );
+	fclose( static_cast<FILE*>( m_handle ) );
 #endif
 }
@@ -244,8 +245,8 @@
 {
 	uint32 ms = get_system_ms();
-	unsigned int secs = (unsigned int)(ms / 1000);
-	unsigned int mm   = (unsigned int)( ms * 100 / 1000 ) % 100;
-	unsigned int h    = (unsigned int)(secs / (60*60));
-	unsigned int m    = (unsigned int)(secs / 60) % 60;
+	unsigned int secs = static_cast<unsigned int>( ms / 1000 );
+	unsigned int mm   = static_cast<unsigned int>( ms * 100 / 1000 ) % 100;
+	unsigned int h    = static_cast<unsigned int>( secs / (60*60) );
+	unsigned int m    = static_cast<unsigned int>( secs / 60 ) % 60;
 	unsigned int s    = secs % 60;
 #if NV_COMPILER == NV_MSVC 
Index: /trunk/src/core/profiler.cc
===================================================================
--- /trunk/src/core/profiler.cc	(revision 401)
+++ /trunk/src/core/profiler.cc	(revision 402)
@@ -124,8 +124,9 @@
 		if ( c->m_calls > 0 )
 		{
-			f64 pparent = ( (f64)c->m_total_time_us / (f64)c->m_parent->m_total_time_us ) * 100.f;
+			f64 ftotal_time_us = static_cast<f64>( c->m_total_time_us );
+			f64 pparent = ( ftotal_time_us / static_cast<f64>( c->m_parent->m_total_time_us ) ) * 100.f;
 			uint32 calls       = c->m_calls;
-			f64 total_ms = c->m_total_time_us / 1000.f;
-			f64 avg_ms = ( (f64)c->m_total_time_us / (f64)c->m_calls ) / 1000.f;
+			f64 total_ms = ftotal_time_us / 1000.f;
+			f64 avg_ms = ( ftotal_time_us / static_cast<f64>( c->m_calls ) ) / 1000.f;
 			if ( indent > 0 ) nvmemset( buffer, '-', indent );
 			snprintf( buffer + indent, 128 - indent, "%*.*s %6.2f %6d %9.2f %6.2f", indent - 23, 23 - indent,
Index: /trunk/src/core/random.cc
===================================================================
--- /trunk/src/core/random.cc	(revision 401)
+++ /trunk/src/core/random.cc	(revision 402)
@@ -19,5 +19,5 @@
 random::seed_type random::randomize()
 {
-	std::mt19937& rng = *(( std::mt19937* )m_data);
+	std::mt19937& rng = *( reinterpret_cast< std::mt19937* >( m_data ) );
 	seed_type seed = randomized_seed();
 	rng.seed( seed );
@@ -27,5 +27,5 @@
 void random::set_seed( random::seed_type seed /*= 0 */ )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	rng.seed( seed == 0 ? randomized_seed() : seed );
 }
@@ -39,5 +39,5 @@
 random::result_type random::rand()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	return rng();
 }
@@ -45,5 +45,5 @@
 sint32 random::srand( sint32 val )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_int_distribution<sint32> dist( 0, val - 1 );
 	return dist( rng );
@@ -52,5 +52,5 @@
 uint32 random::urand( uint32 val )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_int_distribution<uint32> dist( 0, val - 1 );
 	return dist( rng );
@@ -59,5 +59,5 @@
 f32 random::frand( f32 val )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist( 0, val );
 	return dist( rng );
@@ -66,5 +66,5 @@
 sint32 random::srange( sint32 min, sint32 max )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_int_distribution<sint32> dist( min, max );
 	return dist( rng );
@@ -73,5 +73,5 @@
 uint32 random::urange( uint32 min, uint32 max )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_int_distribution<uint32> dist( min, max );
 	return dist( rng );
@@ -80,5 +80,5 @@
 f32 random::frange( f32 min, f32 max )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist( min, max );
 	return dist( rng );
@@ -87,5 +87,5 @@
 uint32 random::dice( uint32 count, uint32 sides )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_int_distribution<uint32> dist( 1, sides );
 	uint32 result = 0;
@@ -106,5 +106,5 @@
 nv::vec2 nv::random::precise_unit_vec2()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist( 0, glm::pi<float>() * 2.f );
 	float angle = dist( rng );
@@ -114,5 +114,5 @@
 nv::vec3 nv::random::precise_unit_vec3()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist11( -1.0f, 1.0f );
 	std::uniform_real_distribution<f32> dist02pi( 0.0f, 2*glm::pi<float>() );
@@ -129,5 +129,5 @@
 nv::vec2 nv::random::fast_disk_point()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist( 0.0f, 1.0f );
 	float r1 = dist( rng );
@@ -140,5 +140,5 @@
 nv::vec2 nv::random::precise_disk_point()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> unit( 0.0f, 1.0f );
 	std::uniform_real_distribution<f32> angle( 0.0f, glm::pi<float>() );
@@ -150,5 +150,5 @@
 nv::vec3 nv::random::fast_sphere_point()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist01( 0.0f, 1.0f );
 	std::uniform_real_distribution<f32> dist11( -1.0f, 1.0f );
@@ -168,5 +168,5 @@
 nv::vec3 nv::random::precise_sphere_point()
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> dist01( 0.0f, 1.0f );
 	std::uniform_real_distribution<f32> dist11( -1.0f, 1.0f );
@@ -185,5 +185,5 @@
 nv::vec2 nv::random::precise_ellipse_point( const vec2& radii )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> distx( -radii.x, radii.x );
 	std::uniform_real_distribution<f32> disty( -radii.y, radii.y );
@@ -204,5 +204,5 @@
 nv::vec3 nv::random::precise_ellipsoid_point( const vec3& radii )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	std::uniform_real_distribution<f32> distx( -radii.x, radii.x );
 	std::uniform_real_distribution<f32> disty( -radii.y, radii.y );
@@ -225,5 +225,5 @@
 nv::vec2 nv::random::fast_hollow_disk_point( float iradius, float oradius )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	float idist2 = iradius * iradius;
 	float odist2 = oradius * oradius;
@@ -239,5 +239,5 @@
 nv::vec3 nv::random::fast_hollow_sphere_point( float iradius, float oradius )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	float idist3 = iradius * iradius * iradius;
 	float odist3 = oradius * oradius * oradius;
@@ -254,5 +254,5 @@
 nv::vec2 nv::random::fast_hollow_ellipse_point( const vec2& iradii, const vec2& oradii )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	vec2 iradii2 = iradii * iradii;
 	vec2 opoint     = ellipse_edge( oradii );
@@ -275,5 +275,5 @@
 nv::vec3 nv::random::fast_hollow_ellipsoid_point( const vec3& iradii, const vec3& oradii )
 {
-	std::mt19937& rng = *( ( std::mt19937* )m_data );
+	std::mt19937& rng = *( reinterpret_cast<std::mt19937*>( m_data ) );
 	vec3 iradii2 = iradii * iradii;
 	vec3 opoint     = ellipsoid_edge( oradii );
Index: /trunk/src/core/time.cc
===================================================================
--- /trunk/src/core/time.cc	(revision 401)
+++ /trunk/src/core/time.cc	(revision 402)
@@ -85,10 +85,10 @@
 nv::uint32 nv::get_cpu_ms()
 {
-	return (uint32)( (f32)( clock() - zero_timer.clock_zero ) / ( (f32)CLOCKS_PER_SEC / 1000.0 ) ) ;
+	return static_cast<uint32>( static_cast<f32>( clock() - zero_timer.clock_zero ) / ( static_cast<f32>(CLOCKS_PER_SEC) / 1000.0f ) ) ;
 }
 
 nv::uint64 nv::get_cpu_us()
 {
-	return (uint64)( (f32)( clock() - zero_timer.clock_zero ) / ( (f32)CLOCKS_PER_SEC / 1000000.0 ) ) ;
+	return static_cast<uint64>( static_cast<f32>( clock() - zero_timer.clock_zero ) / ( static_cast<f32>(CLOCKS_PER_SEC) / 1000000.0f ) ) ;
 }
 
@@ -99,9 +99,9 @@
 	QueryPerformanceCounter(&now);
 	LONGLONG result = now.QuadPart - zero_timer.query_zero.QuadPart;
-	return (uint32) (1000.0 * result / (double) zero_timer.frequency.QuadPart);
+	return static_cast<uint32>(1000.0 * result / static_cast<f64>( zero_timer.frequency.QuadPart ) );
 #else
 	struct timeval now;
 	gettimeofday(&now, NULL);
-	return (uint32)( (now.tv_sec - zero_timer.timeval_zero.tv_sec)*1000+(now.tv_usec-zero_timer.timeval_zero.tv_usec)/1000 );
+	return static_cast<uint32>( (now.tv_sec - zero_timer.timeval_zero.tv_sec)*1000+(now.tv_usec-zero_timer.timeval_zero.tv_usec)/1000 );
 #endif
 }
@@ -113,9 +113,9 @@
 	QueryPerformanceCounter(&now);
 	LONGLONG result = now.QuadPart - zero_timer.query_zero.QuadPart;
-	return (uint64) (1000000.0 * result / (double) zero_timer.frequency.QuadPart);
+	return static_cast<uint64>(1000000.0 * result / static_cast<f64>( zero_timer.frequency.QuadPart ) );
 #else
 	struct timeval now;
 	gettimeofday(&now, NULL);
-	return (uint32)( (now.tv_sec - zero_timer.timeval_zero.tv_sec)*1000000+(now.tv_usec - zero_timer.timeval_zero.tv_usec) );
+	return static_cast<uint64>( (now.tv_sec - zero_timer.timeval_zero.tv_sec)*1000000+(now.tv_usec - zero_timer.timeval_zero.tv_usec) );
 #endif
 }
Index: /trunk/src/stl/assert.cc
===================================================================
--- /trunk/src/stl/assert.cc	(revision 401)
+++ /trunk/src/stl/assert.cc	(revision 402)
@@ -31,13 +31,13 @@
 extern "C" {
 	extern void __assert(const char *, const char *, unsigned int, const char *)
-		throw() __attribute__ ((__noreturn__));
+		__attribute__ ((__noreturn__));
 }
 #	else
 extern "C" {
 	extern void __assert_fail(const char *, const char *, unsigned int, const char *)
-		throw() __attribute__ ((__noreturn__));
+		__attribute__ ((__noreturn__));
 }
 #	endif
-void nv_internal_assert( const char * assertion, const char * file, unsigned int line, const char * function )
+__attribute__( ( __noreturn__ ) ) void nv_internal_assert( const char * assertion, const char * file, unsigned int line, const char * function )
 {
 #	if NV_COMPILER == NV_CLANG
Index: /trunk/src/stl/capi.cc
===================================================================
--- /trunk/src/stl/capi.cc	(revision 401)
+++ /trunk/src/stl/capi.cc	(revision 402)
Index: /trunk/src/stl/hash_table.cc
===================================================================
--- /trunk/src/stl/hash_table.cc	(revision 401)
+++ /trunk/src/stl/hash_table.cc	(revision 402)
@@ -47,9 +47,9 @@
 };
 
-static const nv::uint32 s_primes_size = ( sizeof( s_primes ) / sizeof( *s_primes ) );
+//static const nv::uint32 s_primes_size = ( sizeof( s_primes ) / sizeof( *s_primes ) );
 
 namespace nv
 {
-	void* g_hash_table_empty[2] = { nullptr, (void*)uintptr_t( ~0 ) };
+	void* g_hash_table_empty[2] = { nullptr, reinterpret_cast<void*>( uintptr_t( ~0 ) ) };
 }
 
Index: /trunk/src/stl/string.cc
===================================================================
--- /trunk/src/stl/string.cc	(revision 401)
+++ /trunk/src/stl/string.cc	(revision 402)
@@ -15,6 +15,5 @@
 using namespace nv;
 
-static const double s_power_10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000,
-10000000, 100000000, 1000000000 };
+//static const double s_power_10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
 
 std::string nv::slurp( const std::string& filename )
@@ -41,8 +40,8 @@
 {
 	char* s = str;
-	uint32 abs = ( n < 0 ) ? (uint32)( -n ) : (uint32)( n );
+	uint32 abs = static_cast< uint32 >( n < 0 ? -n : n );
 	do
 	{
-		*s++ = (char)( '0' + ( abs % 10 ) );
+		*s++ = static_cast<char>( '0' + ( abs % 10 ) );
 		abs /= 10;
 	} while ( abs > 0 );
@@ -50,5 +49,5 @@
 	*s = '\0';
 	string_reverse( str, s - 1 );
-	return (nv::size_t)( s - str );
+	return static_cast<nv::size_t>( s - str );
 }
 
@@ -56,8 +55,8 @@
 {
 	char* s = str;
-	uint64 abs = ( n < 0 ) ? (uint64)( -n ) : (uint64)( n );
+	uint64 abs = static_cast< uint64 >( n < 0 ? -n : n );
 	do
 	{
-		*s++ = (char)( '0' + ( abs % 10 ) );
+		*s++ = static_cast<char>( '0' + ( abs % 10 ) );
 		abs /= 10;
 	} while ( abs > 0 );
@@ -65,5 +64,5 @@
 	*s = '\0';
 	string_reverse( str, s - 1 );
-	return (nv::size_t)( s - str );
+	return static_cast<nv::size_t>( s - str );
 }
 
@@ -73,10 +72,10 @@
 	do
 	{
-		*s++ = (char)( '0' + ( n % 10 ) );
+		*s++ = static_cast<char>( '0' + ( n % 10 ) );
 		n /= 10;
 	} while ( n > 0 );
 	*s = '\0';
 	string_reverse( str, s - 1 );
-	return (nv::size_t)( s - str );
+	return static_cast<nv::size_t>( s - str );
 }
 
@@ -86,10 +85,10 @@
 	do
 	{
-		*s++ = (char)( '0' + ( n % 10 ) );
+		*s++ = static_cast<char>( '0' + ( n % 10 ) );
 		n /= 10;
 	} while ( n > 0 );
 	*s = '\0';
 	string_reverse( str, s - 1 );
-	return (size_t)( s - str );
+	return static_cast<nv::size_t>( s - str );
 }
 
@@ -101,5 +100,5 @@
 	int result = snprintf( str, 64, "%.*g", 6, n );
 #endif
-	return result > 0 ? ( nv::size_t )result : 0;
+	return static_cast<nv::size_t>( result > 0 ? result : 0 );
 }
 
@@ -111,8 +110,8 @@
 	int result = snprintf( str, 64, "%.*g", 6, n );
 #endif
-	return result > 0 ? ( nv::size_t )result : 0;
+	return static_cast<nv::size_t>( result > 0 ? result : 0 );
 }
 
-sint32 buffer_to_sint32( const char* str, char** end )
+sint32 nv::buffer_to_sint32( const char* str, char** end )
 {
 	const char* s = str;
@@ -131,9 +130,9 @@
 		++s;
 	}
-	if ( end != nullptr ) *end = (char*)s;
+	if ( end != nullptr ) *end = const_cast<char*>( s );
 	return positive ? result : -result;
 }
 
-sint64 buffer_to_sint64( const char* s, char** end )
+sint64 nv::buffer_to_sint64( const char* s, char** end )
 {
 	while ( *s == ' ' ) ++s;
@@ -151,9 +150,9 @@
 		++s;
 	}
-	if ( end != nullptr ) *end = (char*)s;
+	if ( end != nullptr ) *end = const_cast<char*>( s );
 	return positive ? result : -result;
 }
 
-uint32 buffer_to_uint32( const char* s, char** end )
+uint32 nv::buffer_to_uint32( const char* s, char** end )
 {
 	while ( *s == ' ' ) ++s;
@@ -161,12 +160,12 @@
 	while ( *s >= '0' && *s <= '9' )
 	{
-		result = ( result * 10 ) + (uint32)( *s - '0' );
+		result = ( result * 10 ) + static_cast<uint32>( *s - '0' );
 		++s;
 	}
-	if ( end != nullptr ) *end = (char*)s;
+	if ( end != nullptr ) *end = const_cast<char*>( s );
 	return result;
 }
 
-uint64 buffer_to_uint64( const char* s, char** end )
+uint64 nv::buffer_to_uint64( const char* s, char** end )
 {
 	while ( *s == ' ' ) ++s;
@@ -174,17 +173,17 @@
 	while ( *s >= '0' && *s <= '9' )
 	{
-		result = ( result * 10 ) + (uint32)( *s - '0' );
+		result = ( result * 10 ) + static_cast<uint32>( *s - '0' );
 		++s;
 	}
-	if ( end != nullptr ) *end = (char*)s;
+	if ( end != nullptr ) *end = const_cast<char*>( s );
 	return result;
 }
 
-float buffer_to_f32( const char* s, char** end )
+float nv::buffer_to_f32( const char* s, char** end )
 {
 	return strtof( s, end );
 }
 
-double buffer_to_f64( const char* s, char** end )
+double nv::buffer_to_f64( const char* s, char** end )
 {
 	return strtod( s, end );
