diff --git a/readme.md b/readme.md index 66ee1d3a..a14d12b9 100644 --- a/readme.md +++ b/readme.md @@ -55,6 +55,9 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate) #### Features: - Added bitfieldDeinterleave to GTC_bitfield +#### Fixes: +- Fixed build problems due to printf and std::clock_t #778 + ### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22 #### Features: - Added RGBM encoding in GTC_packing #420 diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 7ea33933..df8e7ed4 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -325,7 +325,7 @@ namespace min_ std::clock_t Timestamp1 = std::clock(); - std::printf("min_tern Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("min_tern Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); } glm::int32 SumB = 0; @@ -338,7 +338,7 @@ namespace min_ std::clock_t Timestamp1 = std::clock(); - std::printf("min_int Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("min_int Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); } Error += SumA == SumB ? 0 : 1; @@ -1095,12 +1095,12 @@ namespace sign std::clock_t Timestamp6 = std::clock(); - std::printf("sign_cmp(rand) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - std::printf("sign_if(rand) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); - std::printf("sign_alu1(rand) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); - std::printf("sign_alu2(rand) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); - std::printf("sign_sub(rand) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); - std::printf("glm::sign(rand) Time %d clocks\n", static_cast(Timestamp6 - Timestamp5)); + std::printf("sign_cmp(rand) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("sign_if(rand) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); + std::printf("sign_alu1(rand) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); + std::printf("sign_alu2(rand) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); + std::printf("sign_sub(rand) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); + std::printf("glm::sign(rand) Time %d clocks\n", static_cast(Timestamp6 - Timestamp5)); return Error; } @@ -1143,11 +1143,11 @@ namespace sign std::clock_t Timestamp5 = std::clock(); - std::printf("sign_cmp(linear) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - std::printf("sign_if(linear) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); - std::printf("sign_alu1(linear) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); - std::printf("sign_alu2(linear) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); - std::printf("sign_sub(linear) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); + std::printf("sign_cmp(linear) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("sign_if(linear) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); + std::printf("sign_alu1(linear) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); + std::printf("sign_alu2(linear) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); + std::printf("sign_sub(linear) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); return Error; } @@ -1186,13 +1186,13 @@ namespace sign std::clock_t Timestamp5 = std::clock(); - std::printf("Sum %d\n", static_cast(Sum)); + std::printf("Sum %d\n", static_cast(Sum)); - std::printf("sign_cmp(linear_cal) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - std::printf("sign_if(linear_cal) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); - std::printf("sign_alu1(linear_cal) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); - std::printf("sign_alu2(linear_cal) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); - std::printf("sign_sub(linear_cal) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); + std::printf("sign_cmp(linear_cal) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("sign_if(linear_cal) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); + std::printf("sign_alu1(linear_cal) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); + std::printf("sign_alu2(linear_cal) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); + std::printf("sign_sub(linear_cal) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); return Error; } diff --git a/test/core/core_func_integer.cpp b/test/core/core_func_integer.cpp index 688e8ba0..aee7d8e6 100644 --- a/test/core/core_func_integer.cpp +++ b/test/core/core_func_integer.cpp @@ -471,10 +471,10 @@ namespace bitfieldReverse std::clock_t Timestamps4 = std::clock(); - std::printf("glm::bitfieldReverse: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("bitfieldReverseLoop: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - std::printf("bitfieldReverseUint32: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); - std::printf("bitfieldReverseOps: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + std::printf("glm::bitfieldReverse: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("bitfieldReverseLoop: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("bitfieldReverseUint32: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("bitfieldReverseOps: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); return Error; } @@ -508,10 +508,10 @@ namespace bitfieldReverse std::clock_t Timestamps4 = std::clock(); - std::printf("glm::bitfieldReverse - 64: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("bitfieldReverseLoop - 64: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - std::printf("bitfieldReverseUint - 64: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); - std::printf("bitfieldReverseOps - 64: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + std::printf("glm::bitfieldReverse - 64: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("bitfieldReverseLoop - 64: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("bitfieldReverseUint - 64: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("bitfieldReverseOps - 64: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); return Error; } @@ -740,18 +740,18 @@ namespace findMSB std::clock_t Timestamps7 = std::clock(); # endif - std::printf("glm::findMSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("findMSB - nlz1: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - std::printf("findMSB - nlz2: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); - std::printf("findMSB - 0.9.5: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + std::printf("glm::findMSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("findMSB - nlz1: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("findMSB - nlz2: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("findMSB - 0.9.5: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); # if GLM_HAS_BITSCAN_WINDOWS - std::printf("findMSB - intrinsics: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); + std::printf("findMSB - intrinsics: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); # endif//GLM_HAS_BITSCAN_WINDOWS - std::printf("findMSB - pop: %d clocks\n", static_cast(Timestamps6 - Timestamps5)); + std::printf("findMSB - pop: %d clocks\n", static_cast(Timestamps6 - Timestamps5)); # if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC - std::printf("findMSB - avx tzcnt: %d clocks\n", static_cast(Timestamps7 - Timestamps6)); + std::printf("findMSB - avx tzcnt: %d clocks\n", static_cast(Timestamps7 - Timestamps6)); # endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS return Error; @@ -1086,15 +1086,15 @@ namespace findLSB std::clock_t Timestamps5 = std::clock(); - std::printf("glm::findLSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("findLSB - 0.9.5: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("glm::findLSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("findLSB - 0.9.5: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); # if GLM_HAS_BITSCAN_WINDOWS - std::printf("findLSB - intrinsics: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("findLSB - intrinsics: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); # endif - std::printf("findLSB - ntz2: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); - std::printf("findLSB - branchfree: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); + std::printf("findLSB - ntz2: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + std::printf("findLSB - branchfree: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); return Error; } @@ -1485,11 +1485,11 @@ namespace bitCount std::clock_t TimestampsF = std::clock(); - std::printf("bitCount - TimeIf %d\n", static_cast(TimestampsB - TimestampsA)); - std::printf("bitCount - TimeVec %d\n", static_cast(TimestampsC - TimestampsB)); - std::printf("bitCount - TimeDefault %d\n", static_cast(TimestampsD - TimestampsC)); - std::printf("bitCount - TimeVec4 %d\n", static_cast(TimestampsE - TimestampsD)); - std::printf("bitCount - bitfield %d\n", static_cast(TimestampsF - TimestampsE)); + std::printf("bitCount - TimeIf %d\n", static_cast(TimestampsB - TimestampsA)); + std::printf("bitCount - TimeVec %d\n", static_cast(TimestampsC - TimestampsB)); + std::printf("bitCount - TimeDefault %d\n", static_cast(TimestampsD - TimestampsC)); + std::printf("bitCount - TimeVec4 %d\n", static_cast(TimestampsE - TimestampsD)); + std::printf("bitCount - bitfield %d\n", static_cast(TimestampsF - TimestampsE)); return Error; } diff --git a/test/core/core_func_integer_bit_count.cpp b/test/core/core_func_integer_bit_count.cpp index 3e2c8096..1fca07b2 100644 --- a/test/core/core_func_integer_bit_count.cpp +++ b/test/core/core_func_integer_bit_count.cpp @@ -199,7 +199,7 @@ int main() if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));} TimestampEnd = std::clock(); - printf("pop0: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop0: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -207,7 +207,7 @@ int main() if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));} TimestampEnd = std::clock(); - printf("pop1: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -215,7 +215,7 @@ int main() if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));} TimestampEnd = std::clock(); - printf("pop2: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -223,7 +223,7 @@ int main() if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));} TimestampEnd = std::clock(); - printf("pop3: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -231,7 +231,7 @@ int main() if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));} TimestampEnd = std::clock(); - printf("pop4: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -239,7 +239,7 @@ int main() if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));} TimestampEnd = std::clock(); - printf("pop5: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -247,7 +247,7 @@ int main() if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));} TimestampEnd = std::clock(); - printf("pop5a: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop5a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -255,7 +255,7 @@ int main() if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));} TimestampEnd = std::clock(); - printf("pop6: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -264,7 +264,7 @@ int main() if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));} TimestampEnd = std::clock(); - printf("pop7: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -273,7 +273,7 @@ int main() if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));} TimestampEnd = std::clock(); - printf("pop8: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); TimestampBeg = std::clock(); for (std::size_t k = 0; k < Count; ++k) @@ -282,7 +282,7 @@ int main() if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));} TimestampEnd = std::clock(); - printf("pop9: %ld clocks\n", TimestampEnd - TimestampBeg); + printf("pop9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); if (errors == 0) printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 24552f98..9d272b00 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -433,7 +433,7 @@ static int test_vec4_perf_AoS(std::size_t Size) std::clock_t EndTime = std::clock(); - std::printf("AoS: %ld\n", EndTime - StartTime); + std::printf("AoS: %d\n", static_cast(EndTime - StartTime)); return Error; } @@ -472,7 +472,7 @@ static int test_vec4_perf_SoA(std::size_t Size) std::clock_t EndTime = std::clock(); - std::printf("SoA: %ld\n", EndTime - StartTime); + std::printf("SoA: %d\n", static_cast(EndTime - StartTime)); return Error; } diff --git a/test/gtc/gtc_bitfield.cpp b/test/gtc/gtc_bitfield.cpp index 19a09acf..f8bb6117 100644 --- a/test/gtc/gtc_bitfield.cpp +++ b/test/gtc/gtc_bitfield.cpp @@ -541,7 +541,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(Time)); } { @@ -552,7 +552,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("fastBitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("fastBitfieldInterleave Time %d clocks\n", static_cast(Time)); } /* { @@ -563,7 +563,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("loopBitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("loopBitfieldInterleave Time %d clocks\n", static_cast(Time)); } */ { @@ -574,7 +574,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("interleaveBitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("interleaveBitfieldInterleave Time %d clocks\n", static_cast(Time)); } # if GLM_ARCH & GLM_ARCH_SSE2_BIT @@ -586,7 +586,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("sseBitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("sseBitfieldInterleave Time %d clocks\n", static_cast(Time)); } { @@ -597,7 +597,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("sseUnalignedBitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("sseUnalignedBitfieldInterleave Time %d clocks\n", static_cast(Time)); } # endif//GLM_ARCH & GLM_ARCH_SSE2_BIT @@ -609,7 +609,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("glm::detail::bitfieldInterleave Time %d clocks\n", static_cast(Time)); + std::printf("glm::detail::bitfieldInterleave Time %d clocks\n", static_cast(Time)); } # if(GLM_ARCH & GLM_ARCH_SSE2_BIT && !(GLM_COMPILER & GLM_COMPILER_GCC)) @@ -629,7 +629,7 @@ namespace bitfieldInterleave std::clock_t Time = std::clock() - LastTime; - std::printf("_mm_bit_interleave_si128 Time %d clocks\n", static_cast(Time)); + std::printf("_mm_bit_interleave_si128 Time %d clocks\n", static_cast(Time)); } # endif//GLM_ARCH & GLM_ARCH_SSE2_BIT @@ -763,7 +763,7 @@ namespace bitfieldInterleave5 const std::clock_t EndTime = std::clock(); - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); return Error; } @@ -781,7 +781,7 @@ namespace bitfieldInterleave5 const std::clock_t EndTime = std::clock(); - std::printf("bitfieldInterleave_u8vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); + std::printf("bitfieldInterleave_u8vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); return Error; } @@ -799,7 +799,7 @@ namespace bitfieldInterleave5 const std::clock_t EndTime = std::clock(); - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); return Error; } @@ -817,7 +817,7 @@ namespace bitfieldInterleave5 const std::clock_t EndTime = std::clock(); - std::printf("bitfieldInterleave_u8vec4 Time %d clocks\n", static_cast(EndTime - BeginTime)); + std::printf("bitfieldInterleave_u8vec4 Time %d clocks\n", static_cast(EndTime - BeginTime)); return Error; } @@ -835,7 +835,7 @@ namespace bitfieldInterleave5 const std::clock_t EndTime = std::clock(); - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); return Error; } @@ -853,7 +853,7 @@ namespace bitfieldInterleave5 const std::clock_t EndTime = std::clock(); - std::printf("bitfieldInterleave_u16vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); + std::printf("bitfieldInterleave_u16vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); return Error; } diff --git a/test/gtc/gtc_integer.cpp b/test/gtc/gtc_integer.cpp index 1e56bfa9..2d9d4d91 100644 --- a/test/gtc/gtc_integer.cpp +++ b/test/gtc/gtc_integer.cpp @@ -68,7 +68,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2: %ld clocks\n", End - Begin); + printf("glm::log2: %d clocks\n", static_cast(End - Begin)); } { @@ -82,7 +82,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2: %ld clocks\n", End - Begin); + printf("glm::log2: %d clocks\n", static_cast(End - Begin)); } # if GLM_HAS_BITSCAN_WINDOWS @@ -104,7 +104,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2 inlined: %ld clocks\n", End - Begin); + printf("glm::log2 inlined: %d clocks\n", static_cast(End - Begin)); } @@ -124,7 +124,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2 inlined no cast: %ld clocks\n", End - Begin); + printf("glm::log2 inlined no cast: %d clocks\n", static_cast(End - Begin)); } @@ -144,7 +144,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2 reinterpret: %ld clocks\n", End - Begin); + printf("glm::log2 reinterpret: %d clocks\n", static_cast(End - Begin)); } # endif//GLM_HAS_BITSCAN_WINDOWS @@ -159,7 +159,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2: %ld clocks\n", End - Begin); + printf("glm::log2: %d clocks\n", static_cast(End - Begin)); } { @@ -173,7 +173,7 @@ namespace log2_ std::clock_t End = clock(); - printf("glm::log2: %ld clocks\n", End - Begin); + printf("glm::log2: %d clocks\n", static_cast(End - Begin)); } return Error; diff --git a/test/gtc/gtc_round.cpp b/test/gtc/gtc_round.cpp index b8f44caa..60d9a857 100644 --- a/test/gtc/gtc_round.cpp +++ b/test/gtc/gtc_round.cpp @@ -247,8 +247,8 @@ namespace ceilPowerOfTwo_advanced std::clock_t Timestramp2 = std::clock(); - std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast(Timestramp1 - Timestramp0)); - std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast(Timestramp2 - Timestramp1)); + std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast(Timestramp1 - Timestramp0)); + std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast(Timestramp2 - Timestramp1)); return Error; } diff --git a/test/gtx/gtx_fast_trigonometry.cpp b/test/gtx/gtx_fast_trigonometry.cpp index 881294d3..f670c0a0 100644 --- a/test/gtx/gtx_fast_trigonometry.cpp +++ b/test/gtx/gtx_fast_trigonometry.cpp @@ -31,8 +31,8 @@ namespace fastCos const std::clock_t timestamp3 = std::clock(); const std::clock_t time_fast = timestamp2 - timestamp1; const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastCos Time %d clocks\n", static_cast(time_fast)); - std::printf("cos Time %d clocks\n", static_cast(time_default)); + std::printf("fastCos Time %d clocks\n", static_cast(time_fast)); + std::printf("cos Time %d clocks\n", static_cast(time_default)); return time_fast <= time_default ? 0 : 1; } @@ -65,8 +65,8 @@ namespace fastSin const std::clock_t timestamp3 = std::clock(); const std::clock_t time_fast = timestamp2 - timestamp1; const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastSin Time %d clocks\n", static_cast(time_fast)); - std::printf("sin Time %d clocks\n", static_cast(time_default)); + std::printf("fastSin Time %d clocks\n", static_cast(time_fast)); + std::printf("sin Time %d clocks\n", static_cast(time_default)); return time_fast <= time_default ? 0 : 1; } @@ -91,8 +91,8 @@ namespace fastTan const std::clock_t timestamp3 = std::clock(); const std::clock_t time_fast = timestamp2 - timestamp1; const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastTan Time %d clocks\n", static_cast(time_fast)); - std::printf("tan Time %d clocks\n", static_cast(time_default)); + std::printf("fastTan Time %d clocks\n", static_cast(time_fast)); + std::printf("tan Time %d clocks\n", static_cast(time_default)); return time_fast <= time_default ? 0 : 1; } @@ -118,8 +118,8 @@ namespace fastAcos const std::clock_t time_fast = timestamp2 - timestamp1; const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastAcos Time %d clocks\n", static_cast(time_fast)); - std::printf("acos Time %d clocks\n", static_cast(time_default)); + std::printf("fastAcos Time %d clocks\n", static_cast(time_fast)); + std::printf("acos Time %d clocks\n", static_cast(time_default)); return time_fast <= time_default ? 0 : 1; } @@ -141,8 +141,8 @@ namespace fastAsin const std::clock_t timestamp3 = std::clock(); const std::clock_t time_fast = timestamp2 - timestamp1; const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastAsin Time %d clocks\n", static_cast(time_fast)); - std::printf("asin Time %d clocks\n", static_cast(time_default)); + std::printf("fastAsin Time %d clocks\n", static_cast(time_fast)); + std::printf("asin Time %d clocks\n", static_cast(time_default)); return time_fast <= time_default ? 0 : 1; } @@ -164,8 +164,8 @@ namespace fastAtan const std::clock_t timestamp3 = std::clock(); const std::clock_t time_fast = timestamp2 - timestamp1; const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastAtan Time %d clocks\n", static_cast(time_fast)); - std::printf("atan Time %d clocks\n", static_cast(time_default)); + std::printf("fastAtan Time %d clocks\n", static_cast(time_fast)); + std::printf("atan Time %d clocks\n", static_cast(time_default)); return time_fast <= time_default ? 0 : 1; } @@ -247,7 +247,7 @@ namespace taylorCos std::clock_t const TimeStampEnd = std::clock(); - std::printf("fastCosNew %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("fastCosNew %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -288,7 +288,7 @@ namespace taylorCos std::clock_t const TimeStampEnd = std::clock(); - std::printf("fastCosDeterminisctic %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("fastCosDeterminisctic %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -335,7 +335,7 @@ namespace taylorCos std::clock_t const TimeStampEnd = std::clock(); - std::printf("fastCosRef %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("fastCosRef %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -357,7 +357,7 @@ namespace taylorCos std::clock_t const TimeStampEnd = std::clock(); - std::printf("fastCosOld %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("fastCosOld %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -379,7 +379,7 @@ namespace taylorCos std::clock_t const TimeStampEnd = std::clock(); - std::printf("cos %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("cos %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -474,7 +474,7 @@ namespace taylor2 std::clock_t const TimeStampEnd = std::clock(); - std::printf("taylorCosA %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("taylorCosA %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -496,7 +496,7 @@ namespace taylor2 std::clock_t const TimeStampEnd = std::clock(); - std::printf("taylorCosB %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("taylorCosB %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i) @@ -518,7 +518,7 @@ namespace taylor2 std::clock_t const TimeStampEnd = std::clock(); - std::printf("taylorCosC %ld clocks\n", TimeStampEnd - TimeStampBegin); + std::printf("taylorCosC %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); int Error = 0; for(std::size_t i = 0; i < Samples; ++i)