Index: trunk/src/lua/lua_glm.cc
===================================================================
--- trunk/src/lua/lua_glm.cc	(revision 397)
+++ trunk/src/lua/lua_glm.cc	(revision 406)
@@ -11,5 +11,5 @@
 #include "nv/stl/type_traits/common.hh"
 
-static size_t nlua_swizzel_lookup[256];
+static int nlua_swizzel_lookup[256];
 
 using nv::lua::detail::is_vec;
@@ -18,5 +18,5 @@
 using nv::lua::detail::push_vec;
 
-inline bool nlua_is_swizzel( const unsigned char* str, size_t max )
+inline bool nlua_is_swizzel( const unsigned char* str, int max )
 {
 	while (*str)
@@ -155,8 +155,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) + to_vec<T>( L, 2 ) );
+		push_vec<T>( L, static_cast<typename T::value_type>(lua_tonumber( L, 1 )) + to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			push_vec<T>( L, to_vec<T>( L, 1 ) + (typename T::value_type)(lua_tonumber( L, 2 )) );
+			push_vec<T>( L, to_vec<T>( L, 1 ) + static_cast<typename T::value_type>(lua_tonumber( L, 2 )) );
 		else
 			push_vec<T>( L, to_vec<T>( L, 1 ) + to_vec<T>( L, 2 ) );
@@ -168,8 +168,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) - to_vec<T>( L, 2 ) );
+		push_vec<T>( L, static_cast<typename T::value_type>(lua_tonumber( L, 1 )) - to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			push_vec<T>( L, to_vec<T>( L, 1 ) - (typename T::value_type)(lua_tonumber( L, 2 )) );
+			push_vec<T>( L, to_vec<T>( L, 1 ) - static_cast<typename T::value_type>(lua_tonumber( L, 2 )) );
 		else
 			push_vec<T>( L, to_vec<T>( L, 1 ) - to_vec<T>( L, 2 ) );
@@ -181,8 +181,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) * to_vec<T>( L, 2 ) );
+		push_vec<T>( L, static_cast<typename T::value_type>(lua_tonumber( L, 1 )) * to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			push_vec<T>( L, to_vec<T>( L, 1 ) * (typename T::value_type)(lua_tonumber( L, 2 )) );
+			push_vec<T>( L, to_vec<T>( L, 1 ) * static_cast<typename T::value_type>(lua_tonumber( L, 2 )) );
 		else
 			push_vec<T>( L, to_vec<T>( L, 1 ) * to_vec<T>( L, 2 ) );
@@ -194,8 +194,8 @@
 {
 	if ( lua_type( L, 1 ) == LUA_TNUMBER )
-		push_vec<T>( L, (typename T::value_type)(lua_tonumber( L, 1 )) / to_vec<T>( L, 2 ) );
+		push_vec<T>( L, static_cast<typename T::value_type>(lua_tonumber( L, 1 )) / to_vec<T>( L, 2 ) );
 	else
 		if ( lua_type( L, 2 ) == LUA_TNUMBER )
-			push_vec<T>( L, to_vec<T>( L, 1 ) / (typename T::value_type)(lua_tonumber( L, 2 )) );
+			push_vec<T>( L, to_vec<T>( L, 1 ) / static_cast<typename T::value_type>(lua_tonumber( L, 2 )) );
 		else
 			push_vec<T>( L, to_vec<T>( L, 1 ) / to_vec<T>( L, 2 ) );
@@ -226,7 +226,7 @@
 	T* v = to_pvec<T>( L, 1 );
 	size_t len  = 0;
-	size_t vlen = v->length();
-	const unsigned char * key = (const unsigned char *)( lua_tolstring( L, 2, &len ) );
-	size_t idx = 255;
+	int vlen = v->length();
+	const unsigned char * key = reinterpret_cast<const unsigned char *>( lua_tolstring( L, 2, &len ) );
+	int idx = 255;
 
 	if ( len == 1 )
@@ -264,7 +264,7 @@
 	T* v = to_pvec<T>( L, 1 );
 	size_t len  = 0;
-	size_t vlen = v->length();
-	const unsigned char * key = (const unsigned char *)( lua_tolstring( L, 2, &len ) );
-	size_t idx = 255;
+	int vlen = v->length();
+	const unsigned char * key = reinterpret_cast<const unsigned char *>( lua_tolstring( L, 2, &len ) );
+	int idx = 255;
 	if( len == 1 )
 	{
@@ -272,5 +272,5 @@
 		if ( idx < vlen )
 		{
-			(*v)[idx] = (typename T::value_type)luaL_checknumber( L, 3 );
+			(*v)[idx] = static_cast<typename T::value_type>( luaL_checknumber( L, 3 ) );
 			return 0;
 		}
@@ -279,7 +279,7 @@
 	{
  		switch (len) {
-		case 2 : { vec2 v2 = to_vec<vec2>(L,3); for (size_t i = 0; i<len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
-		case 3 : { vec3 v3 = to_vec<vec3>(L,3); for (size_t i = 0; i<len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
-		case 4 : { vec4 v4 = to_vec<vec4>(L,3); for (size_t i = 0; i<len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
+		case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
+		case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
+		case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( int i = 0; i<int( len ); ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
  		default: break;
 		}
