Index: /trunk/nv/array2d.hh
===================================================================
--- /trunk/nv/array2d.hh	(revision 199)
+++ /trunk/nv/array2d.hh	(revision 200)
@@ -330,5 +330,5 @@
 			// Copy into THIS array from source the following.
 			// Highest row is either the size limit or the end of either array, whichever is smaller.
-			for ( i = 0; i < min( size_y , min ( m_size.y - dest_start_y, source.m_size.y - source_start_y ) ); i++ )
+			for ( uint32 i = 0; i < min( size_y , min ( m_size.y - dest_start_y, source.m_size.y - source_start_y ) ); i++ )
 			{
 				// Copy the indicated row.
@@ -338,5 +338,5 @@
 				std:copy( source.m_data + ( source_start_y + i ) * source.m_size.x + source_start_x,  // Source Start
 						  source.m_data + ( source_start_y + i ) * source.m_size.x + min( source.m_size.x, min( source_start_x + size_x, source_start_x + m_size.x - dest_start_x ) ), // Source End
-						  m_data + (dest_start_y + i) * m_size.x + dest_start_x ) // Destination Start
+						  m_data + (dest_start_y + i) * m_size.x + dest_start_x ); // Destination Start
 			}
 		}
Index: /trunk/nv/common.hh
===================================================================
--- /trunk/nv/common.hh	(revision 199)
+++ /trunk/nv/common.hh	(revision 200)
@@ -198,5 +198,5 @@
 T narrow_cast(const U& a)
 {
-	return static_cast<T>(a & T(0xFFFFFFFFFFFFFFFF) );
+	return static_cast<T>(a & T(-1) );
 }
 
Index: /trunk/nv/formats/md5_loader.hh
===================================================================
--- /trunk/nv/formats/md5_loader.hh	(revision 199)
+++ /trunk/nv/formats/md5_loader.hh	(revision 200)
@@ -31,5 +31,5 @@
 			int         parent_id;
 			int         flags;
-			int         start_index;
+			size_t      start_index;
 		};
 		typedef std::vector<md5_joint_info> md5_joint_info_list;
@@ -162,5 +162,5 @@
 		struct md5_triangle
 		{
-			int indices[3];
+			size_t indices[3];
 		};
 		typedef std::vector<md5_triangle> md5_triangle_list;
@@ -168,5 +168,5 @@
 		struct md5_weight
 		{
-			int       joint_id;
+			size_t    joint_id;
 			float     bias;
 			glm::vec3 pos;
Index: /trunk/nv/string.hh
===================================================================
--- /trunk/nv/string.hh	(revision 199)
+++ /trunk/nv/string.hh	(revision 200)
@@ -135,7 +135,12 @@
 	};
 	template< size_t S >
+	struct string_length< char[S] >
+	{
+		static size_t get( const char[S] ) { return S-1; }
+	};
+	template< size_t S >
 	struct string_length< const char[S] >
 	{
-		static size_t get( const char* ) { return S-1; }
+		static size_t get( const char[S] ) { return S-1; }
 	};
 	template<>
Index: /trunk/src/formats/md2_loader.cc
===================================================================
--- /trunk/src/formats/md2_loader.cc	(revision 199)
+++ /trunk/src/formats/md2_loader.cc	(revision 200)
@@ -8,5 +8,4 @@
 
 #include <glm/gtc/constants.hpp>
-#include <glm/gtx/string_cast.hpp>
 #include "nv/logging.hh"
 #include <cstring>
Index: /trunk/src/formats/md3_loader.cc
===================================================================
--- /trunk/src/formats/md3_loader.cc	(revision 199)
+++ /trunk/src/formats/md3_loader.cc	(revision 200)
@@ -8,5 +8,4 @@
 
 #include <glm/gtc/constants.hpp>
-#include <glm/gtx/string_cast.hpp>
 #include "nv/logging.hh"
 #include <cstring>
@@ -457,7 +456,7 @@
 	{
 		const md3_surface_t& surface = md3->surfaces[i];
-		const sint32         vcount  = surface.header.num_verts;
+		const uint32         vcount  = static_cast< uint32 >( surface.header.num_verts );
 		t.reserve( t.size() + vcount );
-		for (sint32 j = 0; j < vcount; ++j )
+		for (uint32 j = 0; j < vcount; ++j )
 		{
 			t.push_back( md3_texcoord( surface.st[j] ) );
Index: /trunk/src/formats/md5_loader.cc
===================================================================
--- /trunk/src/formats/md5_loader.cc	(revision 199)
+++ /trunk/src/formats/md5_loader.cc	(revision 200)
@@ -8,5 +8,4 @@
 
 #include <glm/gtc/constants.hpp>
-#include <glm/gtx/string_cast.hpp>
 #include "nv/logging.hh"
 #include "nv/io/std_stream.hh"
@@ -194,5 +193,5 @@
 		vert.tangent  = glm::vec3(0);
 
-		for ( int j = 0; j < vert.weight_count; ++j )
+		for ( size_t j = 0; j < vert.weight_count; ++j )
 		{
 			md5_weight& weight = mesh.weights[vert.start_weight + j];
@@ -246,5 +245,5 @@
 	}
 
-	for ( unsigned int i = 0; i < mesh.verts.size(); ++i )
+	for ( size_t i = 0; i < mesh.verts.size(); ++i )
 	{
 		md5_vertex& vert = mesh.verts[i];
@@ -258,5 +257,5 @@
 		vert.tangent = glm::vec3(0);
 
-		for ( int j = 0; j < vert.weight_count; ++j )
+		for ( size_t j = 0; j < vert.weight_count; ++j )
 		{
 			const md5_weight& weight = mesh.weights[vert.start_weight + j];
@@ -455,6 +454,6 @@
 
 	float frame_num = m_anim_time * (float)m_frame_rate;
-	int frame0 = (int)floorf( frame_num );
-	int frame1 = (int)ceilf( frame_num );
+	size_t frame0 = (size_t)floorf( frame_num );
+	size_t frame1 = (size_t)ceilf( frame_num );
 	frame0 = frame0 % m_num_frames;
 	frame1 = frame1 % m_num_frames;
@@ -489,5 +488,5 @@
 		if ( animated_joint.parent >= 0 ) // Has a parent joint
 		{
-			md5_skeleton_joint& pjoint = skeleton.joints[animated_joint.parent];
+			md5_skeleton_joint& pjoint = skeleton.joints[static_cast< size_t >( animated_joint.parent ) ];
 			glm::vec3 rot_pos = pjoint.orient * animated_joint.pos;
 
@@ -553,5 +552,5 @@
 		tangent = glm::vec3(0);
 
-		for ( int j = 0; j < vert.weight_count; ++j )
+		for ( size_t j = 0; j < vert.weight_count; ++j )
 		{
 			const md5_weight& weight = mesh.weights[vert.start_weight + j];
