Index: trunk/src/formats/assimp_loader.cc
===================================================================
--- trunk/src/formats/assimp_loader.cc	(revision 401)
+++ trunk/src/formats/assimp_loader.cc	(revision 406)
@@ -84,5 +84,5 @@
 {
 	load_assimp_library();
-	if ( m_scene != nullptr ) aiReleaseImport( (const aiScene*)m_scene );
+	if ( m_scene != nullptr ) aiReleaseImport( reinterpret_cast<const aiScene*>( m_scene ) );
 	m_scene = nullptr;
 	m_mesh_count = 0;
@@ -113,5 +113,5 @@
 void nv::assimp_loader::load_mesh_data( mesh_data* data, size_t index )
 {
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	const aiMesh*  mesh  = scene->mMeshes[ index ];
 	data->set_name( mesh->mName.data );
@@ -139,12 +139,12 @@
 		nv::vec4 vt ( t_i[0], t_i[1], t_i[2], det );
 		if ( skinned )
-			((assimp_skinned_vtx*)channel->data)[i] = assimp_skinned_vtx( v, s, n, vt );
+			reinterpret_cast< assimp_skinned_vtx* >(channel->data)[i] = assimp_skinned_vtx( v, s, n, vt );
 		else
-			((assimp_plain_vtx*)channel->data)[i] = assimp_plain_vtx( v, s, n, vt );
+			reinterpret_cast< assimp_plain_vtx* >(channel->data)[i] = assimp_plain_vtx( v, s, n, vt );
 	}
 
 	if ( skinned )
 	{
-		assimp_skinned_vtx* vtx = (assimp_skinned_vtx*)channel->data;
+		assimp_skinned_vtx* vtx = reinterpret_cast< assimp_skinned_vtx* >( channel->data );
 		for (unsigned int m=0; m<mesh->mNumBones; m++)
 		{
@@ -154,9 +154,9 @@
 				assimp_skinned_vtx& v = vtx[ bone->mWeights[w].mVertexId ];
 				bool found = false;
-				for (nv::uint32 i = 0 ; i < 4; ++i)
+				for ( int i = 0 ; i < 4; ++i )
 				{
 					if ( v.boneweight[i] <= 0.0f ) 
 					{
-						v.boneindex[i]  = (int)m;
+						v.boneindex[i]  = int( m );
 						v.boneweight[i] = bone->mWeights[w].mWeight;
 						found = true;
@@ -171,5 +171,5 @@
 	mesh_raw_channel* ichannel = mesh_raw_channel::create_index( USHORT, mesh->mNumFaces * 3 );
 	data->add_channel( ichannel );
-	uint16* indices = (uint16*)ichannel->data;
+	uint16* indices = reinterpret_cast<uint16*>( ichannel->data );
 	for (unsigned int i=0; i<mesh->mNumFaces; i++)
 	{
@@ -177,5 +177,5 @@
 		for (unsigned int j=0; j<face->mNumIndices; j++)
 		{
-			indices[ i*3 + j ] = (uint16)face->mIndices[j];
+			indices[ i*3 + j ] = uint16( face->mIndices[j] );
 		}
 	}
@@ -184,5 +184,5 @@
 nv::assimp_loader::~assimp_loader()
 {
-	if ( m_scene != nullptr ) aiReleaseImport( (const aiScene*)m_scene );
+	if ( m_scene != nullptr ) aiReleaseImport( reinterpret_cast<const aiScene*>( m_scene ) );
 }
 
@@ -190,5 +190,5 @@
 {
 	if ( m_scene == nullptr ) return false;
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	const aiMesh*  mesh  = scene->mMeshes[ index ];
 
@@ -208,5 +208,5 @@
 void nv::assimp_loader::scene_report() const
 {
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	if ( scene == nullptr ) return;
 
@@ -237,5 +237,5 @@
 			aiMesh* mesh = scene->mMeshes[mc];
 
-			NV_LOG_NOTICE( "Mesh #", mc, "   - ", string_view( (char*)mesh->mName.data ) );
+			NV_LOG_NOTICE( "Mesh #", mc, "   - ", string_view( static_cast<char*>( mesh->mName.data ) ) );
 			NV_LOG_NOTICE( "  bones   - ", mesh->mNumBones );
 			NV_LOG_NOTICE( "  uvs     - ", mesh->mNumUVComponents[0] );
@@ -283,5 +283,5 @@
 mesh_nodes_data* nv::assimp_loader::release_merged_bones( mesh_data* meshes )
 {
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	vector< mesh_node_data > final_bones;
 	unordered_map< std::string, uint16 > names;
@@ -303,5 +303,5 @@
 				{
 					NV_ASSERT( final_bones.size() < MAX_BONES, "Too many bones to merge!" );
-					uint16 index = (uint16)final_bones.size();
+					uint16 index = uint16( final_bones.size() );
 					final_bones.push_back( bone );
 					names[ bone.name ] = index;
@@ -316,14 +316,14 @@
 			{
 				mesh_raw_channel* channel = meshes[m].get_raw_channels()[0];
-				assimp_skinned_vtx* va = (assimp_skinned_vtx*)channel->data;
+				assimp_skinned_vtx* va = reinterpret_cast< assimp_skinned_vtx* >( channel->data );
 				for ( unsigned v = 0; v < channel->count; ++v )
 				{
 					assimp_skinned_vtx& vertex = va[v];
 
-					for (uint32 i = 0 ; i < 4; ++i)
+					for ( int i = 0 ; i < 4; ++i)
 					{
 						if ( vertex.boneweight[i] > 0.0f ) 
 						{
-							vertex.boneindex[i] = (int)translate[vertex.boneindex[i]];
+							vertex.boneindex[i] = int( translate[vertex.boneindex[i]] );
 						}
 					}
@@ -340,5 +340,5 @@
 {
 	if ( m_scene == nullptr ) return nullptr;
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	if ( scene->mRootNode == nullptr || scene->mAnimations == nullptr || scene->mAnimations[index] == nullptr) return nullptr;
 
@@ -349,6 +349,6 @@
 	mesh_node_data* data    = new mesh_node_data[count];
 
-	uint16 frame_rate     = (uint16)anim->mTicksPerSecond;
-	float  duration       = (float)anim->mDuration;
+	uint16 frame_rate     = static_cast<uint16>( anim->mTicksPerSecond );
+	float  duration       = static_cast<float>( anim->mDuration );
 	bool   flat           = false;
 
@@ -360,5 +360,5 @@
 nv::uint32 nv::assimp_loader::count_nodes( const void* node ) const
 {
-	const aiNode* ainode = (const aiNode*)node;
+	const aiNode* ainode = reinterpret_cast< const aiNode* >( node );
 	nv::uint32 count = 1;
 	for ( unsigned i = 0; i < ainode->mNumChildren; ++i )
@@ -371,6 +371,6 @@
 nv::sint16 nv::assimp_loader::load_node( uint32 anim_id, mesh_node_data* nodes, const void* vnode, sint16 this_id, sint16 parent_id )
 {
-	const aiScene* scene = (const aiScene*)m_scene;
-	const aiNode*  node  = (const aiNode*)vnode;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
+	const aiNode*  node  = reinterpret_cast<const aiNode*>( vnode );
 	std::string name( node->mName.data );
 	const aiAnimation* anim  = scene->mAnimations[anim_id];
@@ -411,5 +411,5 @@
 void nv::assimp_loader::create_keys( mesh_node_data* data, const void* vnode )
 {
-	const aiNodeAnim* node = (const aiNodeAnim*)vnode;
+	const aiNodeAnim* node = reinterpret_cast< const aiNodeAnim* >( vnode );
 	if ( node->mNumPositionKeys == 0 && node->mNumRotationKeys == 0 && node->mNumScalingKeys == 0 )
 	{
@@ -424,16 +424,16 @@
 	data->data->add_channel( raw_rchannel );
 	//data->data->add_channel( raw_schannel );
-	assimp_key_p* pchannel = ((assimp_key_p*)(raw_pchannel->data));
-	assimp_key_r* rchannel = ((assimp_key_r*)(raw_rchannel->data));
+	assimp_key_p* pchannel = reinterpret_cast< assimp_key_p* >( raw_pchannel->data );
+	assimp_key_r* rchannel = reinterpret_cast< assimp_key_r* >( raw_rchannel->data );
 	//assimp_key_s* schannel = ((assimp_key_s*)(raw_schannel->data));
 
 	for ( unsigned np = 0; np < node->mNumPositionKeys; ++np )
 	{
-		pchannel[np].time     = (float)node->mPositionKeys[np].mTime;
+		pchannel[np].time     = static_cast<float>( node->mPositionKeys[np].mTime );
 		pchannel[np].position = assimp_vec3_cast(node->mPositionKeys[np].mValue);
 	}
 	for ( unsigned np = 0; np < node->mNumRotationKeys; ++np )
 	{
-		rchannel[np].time     = (float)node->mRotationKeys[np].mTime;
+		rchannel[np].time     = static_cast<float>( node->mRotationKeys[np].mTime );
 		rchannel[np].rotation = assimp_quat_cast(node->mRotationKeys[np].mValue );
 	}
@@ -463,5 +463,5 @@
 {
 	if ( m_scene == nullptr || m_mesh_count == 0 ) return nullptr;
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	bool has_bones = false;
 	mesh_data* meshes = new mesh_data[ m_mesh_count ];
@@ -481,5 +481,5 @@
 {
 	if ( m_scene == nullptr ) return 0;
-	const aiScene* scene = (const aiScene*)m_scene;
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
 	return scene->mNumAnimations;	
 }
Index: trunk/src/formats/md2_loader.cc
===================================================================
--- trunk/src/formats/md2_loader.cc	(revision 401)
+++ trunk/src/formats/md2_loader.cc	(revision 406)
@@ -192,9 +192,4 @@
 	//	return vec3( v[0], v[1], v[2] );
 	return vec3( v[0], v[2], v[1] );
-}
-
-static inline vec3 md2_normal( uint8 normal )
-{
-	return md2_vec3( md2_normal_table[normal] );
 }
 
@@ -220,8 +215,9 @@
 md2_loader::~md2_loader()
 {
-	if (m_md2 != nullptr)
-	{
-		free_md2( (md2_t*)(m_md2) );
-		delete (md2_t*)m_md2;
+	md2_t* md2 = reinterpret_cast< md2_t* >( m_md2 );
+	if ( md2 != nullptr)
+	{
+		free_md2( md2 );
+		delete md2;
 	}
 }
@@ -229,6 +225,7 @@
 bool md2_loader::load( stream& source )
 {
-	m_md2 = (void*)(new md2_t);
-	if ( !read_md2( (md2_t*)m_md2, source ) )
+	md2_t* md2 = new md2_t; 
+	m_md2 = md2;
+	if ( !read_md2( md2, source ) )
 	{
 		return false;
@@ -240,10 +237,10 @@
 nv::size_t md2_loader::get_max_frames() const
 {
-	return static_cast< size_t >( ((md2_t*)m_md2)->header.num_frames );
+	return static_cast<size_t>( reinterpret_cast<md2_t*>( m_md2 )->header.num_frames );
 }
 
 void nv::md2_loader::reindex()
 {
-	md2_t* md2 = (md2_t*)m_md2;
+	md2_t* md2 = reinterpret_cast< md2_t* >( m_md2 );
 	uint32 num_indexes = static_cast< uint32 >( md2->header.num_tris * 3 );
 
@@ -321,5 +318,5 @@
 void nv::md2_loader::release_mesh_frame( mesh_data* data, sint32 frame )
 {
-	md2_t* md2 = (md2_t*)m_md2;
+	md2_t* md2 = reinterpret_cast< md2_t* >( m_md2 );
 	size_t num_frames = static_cast< size_t >( md2->header.num_frames );
 	size_t num_verts  =	m_new_vindexes.size();
@@ -328,5 +325,5 @@
 
 	mesh_raw_channel* mc_pn = mesh_raw_channel::create< vtx_md2_pn >( num_verts * frame_count );
-	vtx_md2_pn* vtx_pn = (vtx_md2_pn*)mc_pn->data;
+	vtx_md2_pn* vtx_pn = reinterpret_cast< vtx_md2_pn* >( mc_pn->data );
 
 	uint32 index = 0;
@@ -351,7 +348,7 @@
 
 	mesh_raw_channel* mc_t = mesh_raw_channel::create< vtx_md2_t >( num_verts );
-	vtx_md2_t* vtx_t = (vtx_md2_t*)mc_t->data;
-
-	vec2 scale( 1.0f / (float) md2->header.skinwidth, 1.0f / (float) md2->header.skinheight );
+	vtx_md2_t* vtx_t = reinterpret_cast< vtx_md2_t* >( mc_t->data );
+
+	vec2 scale( 1.0f / static_cast<float>( md2->header.skinwidth ), 1.0f / static_cast<float>( md2->header.skinheight ) );
 	for (size_t i = 0; i < num_verts; ++i )
 	{
@@ -363,5 +360,5 @@
 	if ( m_new_indexes.size() > 0 )
 	{
-		uint16* icp = (uint16*)ic->data;
+		uint16* icp = reinterpret_cast< uint16* >( ic->data );
 		raw_copy_n( m_new_indexes.data(), m_new_indexes.size(), icp );
 	}
Index: trunk/src/formats/md2_normals.inc
===================================================================
--- trunk/src/formats/md2_normals.inc	(revision 401)
+++ trunk/src/formats/md2_normals.inc	(revision 406)
Index: trunk/src/formats/md3_loader.cc
===================================================================
--- trunk/src/formats/md3_loader.cc	(revision 401)
+++ trunk/src/formats/md3_loader.cc	(revision 406)
@@ -267,8 +267,9 @@
 nv::md3_loader::~md3_loader()
 {
-	if (m_md3 != nullptr)
-	{
-		free_md3( (md3_t*)(m_md3) );
-		delete (md3_t*)m_md3;
+	md3_t* md3 = reinterpret_cast< md3_t* >( m_md3 );
+	if ( md3 != nullptr )
+	{
+		free_md3( md3 );
+		delete md3;
 	}
 }
@@ -276,6 +277,7 @@
 bool nv::md3_loader::load( stream& source )
 {
-	m_md3 = (void*)(new md3_t);
-	if ( !read_md3( (md3_t*)m_md3, source ) )
+	md3_t* md3 = new md3_t;
+	m_md3 = md3;
+	if ( !read_md3( md3, source ) )
 	{
 		return false;
@@ -286,6 +288,6 @@
 nv::key_raw_channel* nv::md3_loader::load_tags( const string_view& tag )
 {
-	md3_t* md3 = (md3_t*)m_md3;
-	key_raw_channel* result = key_raw_channel::create<md3_key>( (uint32)md3->header.num_frames );
+	md3_t* md3 = reinterpret_cast< md3_t* >( m_md3 );
+	key_raw_channel* result = key_raw_channel::create<md3_key>( uint32( md3->header.num_frames ) );
 	// TODO: is this brain damaged in efficiency (loop nest order) or what?
 	for ( sint32 f = 0; f < md3->header.num_frames; ++f )
@@ -294,5 +296,5 @@
 		{
 			const md3_tag_t& rtag = md3->tags[i + md3->header.num_tags * f];
-			string_view rname((char*)(rtag.name));
+			string_view rname( reinterpret_cast< const char* >(rtag.name) );
 			if (rname == tag)
 			{
@@ -301,5 +303,5 @@
 				vec3 axisy  ( md3_vec3( rtag.axis[2] ) );
 				vec3 origin ( md3_vec3( rtag.origin )  );
-				((md3_key*)(result->data))[f].tform = transform( origin, quat( mat3( axisx, axisy, axisz ) ) );
+				reinterpret_cast< md3_key*>(result->data)[f].tform = transform( origin, quat( mat3( axisx, axisy, axisz ) ) );
 			}
 		}
@@ -323,5 +325,5 @@
 {
 	mesh_data* data = new mesh_data;
-	release_mesh_frame( data, -1, (sint32)index );
+	release_mesh_frame( data, -1, static_cast< sint32 >( index ) );
 	return data;
 }
@@ -329,31 +331,31 @@
 void nv::md3_loader::release_mesh_frame( mesh_data* data, sint32 frame, sint32 surface )
 {
-	md3_t* md3 = (md3_t*)m_md3;
-	uint32 num_surfaces  = (uint32)md3->header.num_surfaces;
-	uint32 num_verts     = 0;
-	uint32 current_frame = ( frame == -1 ? 0 : (uint32)frame );
-	uint32 frame_count   = ( frame == -1 ? (uint32)md3->header.num_frames : 1 );
-	uint32 current_surf  = ( surface == -1 ? 0 : (uint32)surface );
-	uint32 surf_count    = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 );
-	uint32 index_count   = 0;
+	md3_t* md3 = reinterpret_cast< md3_t* >( m_md3 );
+	sint32 num_surfaces  = md3->header.num_surfaces;
+	sint32 num_verts     = 0;
+	sint32 current_frame = ( frame == -1 ? 0 : frame );
+	sint32 frame_count   = ( frame == -1 ? md3->header.num_frames : 1 );
+	sint32 current_surf  = ( surface == -1 ? 0 : surface );
+	sint32 surf_count    = ( surface == -1 ? md3->header.num_surfaces : 1 );
+	sint32 index_count   = 0;
 
 	if ( surface >= 0 )
 	{
-		index_count = (uint32)md3->surfaces[(uint32)surface].header.num_triangles * 3;
-		num_verts   = (uint32)md3->surfaces[(uint32)surface].header.num_verts;
+		index_count = md3->surfaces[surface].header.num_triangles * 3;
+		num_verts   = md3->surfaces[surface].header.num_verts;
 	}
 	else
-		for ( uint32 i = 0; i < num_surfaces; ++i )
-		{
-			index_count += (uint32)md3->surfaces[i].header.num_triangles * 3;
-			num_verts   += (uint32)md3->surfaces[i].header.num_verts;
-		}
-
-	mesh_raw_channel* mc_pn = mesh_raw_channel::create< vtx_md3_pn >( num_verts * frame_count );
-	mesh_raw_channel* mc_t  = mesh_raw_channel::create< vtx_md3_t >( num_verts );
-	mesh_raw_channel* ic = mesh_raw_channel::create_index< uint16 >( index_count );
-	vtx_md3_pn* vtx_pn = (vtx_md3_pn*)mc_pn->data;
-	vtx_md3_t*  vtx_t  = (vtx_md3_t*) mc_t->data;
-	uint16*     icp    = (uint16*)ic->data;
+		for ( sint32 i = 0; i < num_surfaces; ++i )
+		{
+			index_count += md3->surfaces[i].header.num_triangles * 3;
+			num_verts   += md3->surfaces[i].header.num_verts;
+		}
+
+	mesh_raw_channel* mc_pn = mesh_raw_channel::create< vtx_md3_pn >( uint32( num_verts * frame_count ) );
+	mesh_raw_channel* mc_t  = mesh_raw_channel::create< vtx_md3_t >( uint32( num_verts ) );
+	mesh_raw_channel* ic = mesh_raw_channel::create_index< uint16 >( uint32( index_count ) );
+	vtx_md3_pn* vtx_pn = reinterpret_cast< vtx_md3_pn* >( mc_pn->data );
+	vtx_md3_t*  vtx_t  = reinterpret_cast< vtx_md3_t* >( mc_t->data );
+	uint16*     icp    = reinterpret_cast< uint16* >( ic->data );
 
 	uint32 index  = 0;
@@ -387,14 +389,14 @@
 	while ( frame_count > 0 )
 	{
-		current_surf  = ( surface == -1 ? 0 : (uint32)surface );
-		surf_count    = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 );
+		current_surf  = ( surface == -1 ? 0 : surface );
+		surf_count    = ( surface == -1 ? md3->header.num_surfaces : 1 );
 
 		while ( surf_count > 0 )
 		{
 			md3_surface_t& sface  = md3->surfaces[current_surf];
-			uint32         vcount = (uint32)sface.header.num_verts;
-			uint32         offset = vcount * current_frame;
-			uint32         limit  = vcount + offset;
-			for (uint32 j = offset; j < limit; ++j )
+			sint32 vcount = sface.header.num_verts;
+			sint32 offset = vcount * current_frame;
+			sint32 limit  = vcount + offset;
+			for ( sint32 j = offset; j < limit; ++j )
 			{
 				md3_vertex_t& v = sface.vertices[j];
@@ -410,5 +412,5 @@
 	}
 
-	data->set_name( (char*)md3->header.name );
+	data->set_name( reinterpret_cast< char* >( md3->header.name ) );
 	data->add_channel( mc_pn );
 	data->add_channel( mc_t );
@@ -418,6 +420,6 @@
 mesh_nodes_data* nv::md3_loader::release_mesh_nodes_data( nv::size_t )
 {
-	md3_t* md3 = (md3_t*)m_md3;
-	uint32 node_count = (uint32)md3->header.num_tags;
+	md3_t* md3 = reinterpret_cast< md3_t* >( m_md3 );
+	uint32 node_count = uint32( md3->header.num_tags );
 	if ( node_count == 0 ) return nullptr;
 	mesh_node_data* nodes = new mesh_node_data[ node_count ];
@@ -425,5 +427,5 @@
 	{
 		const md3_tag_t& rtag = md3->tags[i];
-		string_view name( (char*)(rtag.name) );
+		string_view name( reinterpret_cast< const char* >(rtag.name) );
 
 		nodes[i].transform = mat4();
@@ -441,6 +443,6 @@
 mesh_data_pack* nv::md3_loader::release_mesh_data_pack()
 {
-	md3_t* md3 = (md3_t*)m_md3;
-	uint32 count = 1;
+	md3_t* md3 = reinterpret_cast<md3_t*>( m_md3 );
+	int count = 1;
 	mesh_data* data = nullptr;
 	if ( m_merge_all )
@@ -448,21 +450,21 @@
 		data = new mesh_data[1];
 		release_mesh_frame( &data[0], -1, -1 );
-		data[0].set_name( (char*)md3->header.name );
+		data[0].set_name( reinterpret_cast< char* >( md3->header.name ) );
 	}
 	else
 	{
-		count = (uint32)md3->header.num_surfaces;
+		count = md3->header.num_surfaces;
 		data = new mesh_data[ count ];
-		for ( uint32 i = 0; i < count; ++i )
-		{
-			release_mesh_frame( &data[i], -1, (sint32)i );
-			data[i].set_name( (char*)md3->surfaces[i].header.name );
-		}
-	}
-	return new mesh_data_pack( count, data, release_mesh_nodes_data() );
+		for ( int i = 0; i < count; ++i )
+		{
+			release_mesh_frame( &data[i], -1, i );
+			data[i].set_name( reinterpret_cast< char* >( md3->surfaces[i].header.name ) );
+		}
+	}
+	return new mesh_data_pack( uint32( count ), data, release_mesh_nodes_data() );
 }
 
 nv::size_t md3_loader::get_max_frames() const
 {
-	return static_cast< size_t >( ((md3_t*)m_md3)->header.num_frames );
-}
+	return static_cast<size_t>( reinterpret_cast<md3_t*>( m_md3 )->header.num_frames );
+}
Index: trunk/src/formats/md5_loader.cc
===================================================================
--- trunk/src/formats/md5_loader.cc	(revision 401)
+++ trunk/src/formats/md5_loader.cc	(revision 406)
@@ -162,5 +162,5 @@
 						mesh_raw_channel* ch_t   = mesh_raw_channel::create<md5_vtx_t>( num_verts );
 						mesh_raw_channel* ch_pntiw = mesh_raw_channel::create<md5_vtx_pntiw>( num_verts );
-						tdata = (md5_vtx_t*)ch_t->data;
+						tdata = reinterpret_cast< md5_vtx_t* >( ch_t->data );
 						mesh->add_channel( ch_pnt );
 						mesh->add_channel( ch_t );
@@ -191,5 +191,5 @@
 
 					mesh_raw_channel* ch_i = mesh_raw_channel::create_index<uint32>( num_tris * 3 );
-					uint32* vtx_i                = (uint32*)ch_i->data;
+					uint32* vtx_i                = reinterpret_cast< uint32* >( ch_i->data );
 					uint32 idx = 0;
 					mesh->add_channel( ch_i );
@@ -199,14 +199,14 @@
 					for ( uint32 i = 0; i < num_tris; ++i )
 					{
-						size_t ti0;
-						size_t ti1;
-						size_t ti2;
+						unsigned ti0;
+						unsigned ti1;
+						unsigned ti2;
 
 						std::getline( sstream, line );
 						sscanf( line.c_str(), "%*s %*u %u %u %u )", &(ti0), &(ti1), &(ti2));
 
-						vtx_i[idx++] = (uint32)ti0;
-						vtx_i[idx++] = (uint32)ti1;
-						vtx_i[idx++] = (uint32)ti2;
+						vtx_i[idx++] = ti0;
+						vtx_i[idx++] = ti1;
+						vtx_i[idx++] = ti2;
 					}              
 				}
@@ -244,5 +244,5 @@
 			assert( nodes == nullptr );
 			nodes = new mesh_node_data[ num_joints ];
-			m_nodes = new mesh_nodes_data( "md5_animation", num_joints, nodes, (nv::uint16)frame_rate, (float)num_frames, true );
+			m_nodes = new mesh_nodes_data( "md5_animation", num_joints, nodes, static_cast< nv::uint16 >( frame_rate ), static_cast< float >( num_frames ), true );
 			joint_infos.resize( num_joints );
 
@@ -318,5 +318,5 @@
 			{
 				sstream >> buf;
-				frame.push_back((float)atof(buf));
+				frame.push_back( static_cast< float >( atof(buf) ) );
 			}
 
@@ -336,6 +336,6 @@
 {
 	assert( m_type == MESH );
-	md5_vtx_pnt* vtcs = (md5_vtx_pnt*)mdata->get_channel< md5_vtx_pnt >()->data; 
-	md5_vtx_pntiw* vtx_data = (md5_vtx_pntiw*)mdata->get_channel< md5_vtx_pntiw >()->data; 
+	md5_vtx_pnt* vtcs       = reinterpret_cast< md5_vtx_pnt* >( mdata->get_channel< md5_vtx_pnt >()->data ); 
+	md5_vtx_pntiw* vtx_data = reinterpret_cast< md5_vtx_pntiw* >( mdata->get_channel< md5_vtx_pntiw >()->data );
 
 	for ( uint32 i = 0; i < vtx_count; ++i )
@@ -368,10 +368,10 @@
 		}
 
-		for ( size_t j = 0; j < 4; ++j )
-		{
-			if ( j < weight_count )
-			{
-				vdata.boneindex[j]  = (int)weights[start_weight + j].joint_id;
-				vdata.boneweight[j] = weights[start_weight + j].bias;
+		for ( int j = 0; j < 4; ++j )
+		{
+			if ( j < int(weight_count) )
+			{
+				vdata.boneindex[j]  = int( weights[int(start_weight) + j].joint_id );
+				vdata.boneweight[j] = weights[int(start_weight) + j].bias;
 			}
 			else
@@ -396,5 +396,5 @@
 	}
 
-	const uint32*    idata = (uint32*)mdata->get_index_channel()->data;
+	const uint32*    idata = reinterpret_cast< uint32* >( mdata->get_index_channel()->data );
 	const md5_vtx_t* tdata = mdata->get_channel_data<md5_vtx_t>();
 
@@ -448,5 +448,5 @@
  		vdata.tangent  = vec3(0);
  
- 		for ( size_t j = 0; j < 4; ++j )
+ 		for ( int j = 0; j < 4; ++j )
  		{
 			const mesh_node_data&  joint = nodes[vdata.boneindex[j]];
@@ -484,5 +484,5 @@
 		{
 			const mesh_node_data& pjoint = nodes[parent_id];
-			const transform* ptv = (const transform*)pjoint.data->get_channel(0)->data;
+			const transform* ptv = reinterpret_cast< const transform* >( pjoint.data->get_channel(0)->data );
 			transform ptr;
 			if ( pjoint.data->get_channel(0)->count > index ) ptr = ptv[ index ];
@@ -495,5 +495,5 @@
 		}
 
-		((transform*)joint.data->get_channel(0)->data)[index] = transform( pos, orient );
+		reinterpret_cast< transform* >( joint.data->get_channel(0)->data )[index] = transform( pos, orient );
 	}
 }
Index: trunk/src/formats/nmd_loader.cc
===================================================================
--- trunk/src/formats/nmd_loader.cc	(revision 401)
+++ trunk/src/formats/nmd_loader.cc	(revision 406)
@@ -174,5 +174,5 @@
 	eheader.type     = nmd_type::MESH;
 	eheader.name     = 0;
-	eheader.children = (uint16)data.size();
+	eheader.children = static_cast< uint16 >( data.size() );
 	eheader.size     = size;
 	stream_out.write( &eheader, sizeof( eheader ), 1 );
@@ -213,5 +213,5 @@
 	header.name     = 0;
 	header.type     = nmd_type::ANIMATION;
-	header.children = (uint16)nodes->get_count();
+	header.children = static_cast< uint16 >( nodes->get_count() );
 	header.size     = total;
 	stream_out.write( &header, sizeof( header ), 1 );
@@ -237,5 +237,5 @@
 		eheader.type     = nmd_type::NODE;
 		eheader.name     = strings->insert( node->name );
-		eheader.children = (uint16)chan_count;
+		eheader.children = static_cast< uint16 >( chan_count );
 		eheader.size     = sizeof( nmd_node_header ) + chan_size;
 		stream_out.write( &eheader, sizeof( eheader ), 1 );
Index: trunk/src/formats/obj_loader.cc
===================================================================
--- trunk/src/formats/obj_loader.cc	(revision 401)
+++ trunk/src/formats/obj_loader.cc	(revision 406)
@@ -207,5 +207,5 @@
 	virtual void reset() { m_data.clear(); }
 	virtual nv::size_t raw_size() const { return m_data.size() * sizeof( VTX ); }
-	virtual const uint8* raw_pointer() const { return (const uint8*)m_data.data(); }
+	virtual const uint8* raw_pointer() const { return reinterpret_cast< const uint8* >( m_data.data() ); }
 };
 
