diff --git a/Base/include/MatrixSquare.h b/Base/include/MatrixSquare.h index df887b0..99edeca 100644 --- a/Base/include/MatrixSquare.h +++ b/Base/include/MatrixSquare.h @@ -73,7 +73,7 @@ namespace FasTC { // principal eigenvector. However, that may be due to // poor initialization of the random vector, so rerandomize // and try again. - const float newBlen = newB.Length(); + const T newBlen = newB.Length(); if(newBlen < 1e-10) { if(badEigenValue) { eigVec = b; diff --git a/Base/include/VectorBase.h b/Base/include/VectorBase.h index df64c1d..5b04112 100644 --- a/Base/include/VectorBase.h +++ b/Base/include/VectorBase.h @@ -183,9 +183,10 @@ namespace FasTC { return a; } + // !WTF! MSVC bug with enums in template parameters =( template< - EVectorType kVectorTypeOne, - EVectorType kVectorTypeTwo, + /* EVectorType */unsigned kVectorTypeOne, + /* EVectorType */unsigned kVectorTypeTwo, typename TypeOne, typename TypeTwo> class MultSwitch { diff --git a/Base/test/TestMatrix.cpp b/Base/test/TestMatrix.cpp index c5bd66c..6ccf03c 100644 --- a/Base/test/TestMatrix.cpp +++ b/Base/test/TestMatrix.cpp @@ -53,7 +53,7 @@ #include "gtest/gtest.h" #include "MatrixBase.h" -static const float kEpsilon = 1e-6; +static const float kEpsilon = 1e-6f; TEST(MatrixBase, Constructors) { FasTC::MatrixBase m3f; @@ -123,7 +123,7 @@ TEST(MatrixBase, PointerConversion) { } TEST(MatrixBase, CastVector) { - srand(time(NULL)); + srand(static_cast(time(NULL))); FasTC::MatrixBase v3f; for(int i = 0; i < 6; i++) { diff --git a/Base/test/TestVector.cpp b/Base/test/TestVector.cpp index bafec99..976dae5 100644 --- a/Base/test/TestVector.cpp +++ b/Base/test/TestVector.cpp @@ -53,7 +53,7 @@ #include "gtest/gtest.h" #include "VectorBase.h" -static const float kEpsilon = 1e-6; +static const float kEpsilon = 1e-6f; TEST(VectorBase, Constructors) { FasTC::VectorBase v3f; @@ -173,7 +173,7 @@ TEST(VectorBase, Normalization) { EXPECT_EQ(v2u[0], 1); EXPECT_EQ(v2u[1], 1); - const float sqrt2 = sqrt(2)/2.0f; + const double sqrt2 = sqrt(2)/2.0f; for(int i = 2; i < 10; i++) { v2f[0] = static_cast(i); v2f[1] = static_cast(i); diff --git a/CLTool/src/compare.cpp b/CLTool/src/compare.cpp index c9982c4..93e1a8d 100644 --- a/CLTool/src/compare.cpp +++ b/CLTool/src/compare.cpp @@ -59,12 +59,7 @@ #include "TexComp.h" #include "ThreadSafeStreambuf.h" -#ifdef _MSC_VER -int _tmain(int argc, _TCHAR* argv[]) { -#else int main(int argc, char **argv) { -#endif - if(argc != 3) { fprintf(stderr, "Usage: compare \n"); return 1; diff --git a/IO/src/GLDefines.h b/IO/src/GLDefines.h index 5c086d2..6c9a3fe 100644 --- a/IO/src/GLDefines.h +++ b/IO/src/GLDefines.h @@ -57,6 +57,11 @@ # ifdef __APPLE__ # include # else +# ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# include "Windows.h" +# undef LoadImage +# endif # include # endif #endif