Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Wimplicit-int-float-conversion warnings with clang 10+ #986

Merged
merged 1 commit into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion glm/gtx/scalar_multiplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace glm
template<typename T> \
return_type_scalar_multiplication<T, Vec> \
operator/(Vec lh, T const& s){ \
return lh *= 1.0f / s; \
return lh *= 1.0f / static_cast<float>(s); \
}

GLM_IMPLEMENT_SCAL_MULT(vec2)
Expand Down
32 changes: 16 additions & 16 deletions test/gtx/gtx_fast_trigonometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ namespace taylorCos
std::vector<glm::vec4> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = fastCosNew(AngleShift + glm::vec4(Begin + Steps * i));
Results[i] = fastCosNew(AngleShift + glm::vec4(Begin + Steps * float(i)));

std::clock_t const TimeStampEnd = std::clock();

Expand Down Expand Up @@ -280,12 +280,12 @@ namespace taylorCos
std::vector<glm::vec4> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = taylorCos::fastCosDeterminisctic(AngleShift + glm::vec4(Begin + Steps * i));
Results[i] = taylorCos::fastCosDeterminisctic(AngleShift + glm::vec4(Begin + Steps * float(i)));

std::clock_t const TimeStampEnd = std::clock();

Expand Down Expand Up @@ -327,12 +327,12 @@ namespace taylorCos
std::vector<glm::vec4> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = taylorCos::fastRefCos(AngleShift + glm::vec4(Begin + Steps * i));
Results[i] = taylorCos::fastRefCos(AngleShift + glm::vec4(Begin + Steps * float(i)));

std::clock_t const TimeStampEnd = std::clock();

Expand All @@ -349,12 +349,12 @@ namespace taylorCos
std::vector<glm::vec4> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = glm::fastCos(AngleShift + glm::vec4(Begin + Steps * i));
Results[i] = glm::fastCos(AngleShift + glm::vec4(Begin + Steps * float(i)));

std::clock_t const TimeStampEnd = std::clock();

Expand All @@ -371,12 +371,12 @@ namespace taylorCos
std::vector<glm::vec4> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = glm::cos(AngleShift + glm::vec4(Begin + Steps * i));
Results[i] = glm::cos(AngleShift + glm::vec4(Begin + Steps * float(i)));

std::clock_t const TimeStampEnd = std::clock();

Expand Down Expand Up @@ -466,12 +466,12 @@ namespace taylor2
std::vector<float> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = taylorCosA(AngleShift.x + Begin + Steps * i);
Results[i] = taylorCosA(AngleShift.x + Begin + Steps * float(i));

std::clock_t const TimeStampEnd = std::clock();

Expand All @@ -488,12 +488,12 @@ namespace taylor2
std::vector<float> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = taylorCosB(AngleShift.x + Begin + Steps * i);
Results[i] = taylorCosB(AngleShift.x + Begin + Steps * float(i));

std::clock_t const TimeStampEnd = std::clock();

Expand All @@ -510,12 +510,12 @@ namespace taylor2
std::vector<float> Results;
Results.resize(Samples);

float Steps = (End - Begin) / Samples;
float Steps = (End - Begin) / float(Samples);

std::clock_t const TimeStampBegin = std::clock();

for(std::size_t i = 0; i < Samples; ++i)
Results[i] = taylorCosC(AngleShift.x + Begin + Steps * i);
Results[i] = taylorCosC(AngleShift.x + Begin + Steps * float(i));

std::clock_t const TimeStampEnd = std::clock();

Expand Down