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 );
