Skip to content

Commit 436579b

Browse files
committed
Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986
1 parent 0162631 commit 436579b

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

readme.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
5353
5454
## Release notes
5555
56-
### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/latest) - 2020-01-XX
56+
### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/tag/0.9.9.7) - 2020-01-05
5757
#### Improvements:
5858
- Improved Neon support with more functions optimized #950
5959
- Added CMake GLM interface #963
@@ -65,6 +65,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
6565
- Fixed for intersection ray/plane and added related tests #953
6666
- Fixed ARM 64bit detection #949
6767
- Fixed GLM_EXT_matrix_clip_space warnings #980
68+
- Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986
6869
6970
### [GLM 0.9.9.6](https://github.com/g-truc/glm/releases/tag/0.9.9.6) - 2019-09-08
7071
#### Features:

test/gtx/gtx_fast_trigonometry.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@ namespace taylorCos
239239
std::vector<glm::vec4> Results;
240240
Results.resize(Samples);
241241

242-
float Steps = (End - Begin) / float(Samples);
242+
float const Steps = (End - Begin) / static_cast<float>(Samples);
243243

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

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

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

@@ -280,12 +280,12 @@ namespace taylorCos
280280
std::vector<glm::vec4> Results;
281281
Results.resize(Samples);
282282

283-
float Steps = (End - Begin) / float(Samples);
283+
float const Steps = (End - Begin) / static_cast<float>(Samples);
284284

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

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

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

@@ -327,12 +327,12 @@ namespace taylorCos
327327
std::vector<glm::vec4> Results;
328328
Results.resize(Samples);
329329

330-
float Steps = (End - Begin) / float(Samples);
330+
float const Steps = (End - Begin) / static_cast<float>(Samples);
331331

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

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

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

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

352-
float Steps = (End - Begin) / float(Samples);
352+
float const Steps = (End - Begin) / static_cast<float>(Samples);
353353

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

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

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

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

374-
float Steps = (End - Begin) / float(Samples);
374+
float const Steps = (End - Begin) / static_cast<float>(Samples);
375375

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

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

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

@@ -466,12 +466,12 @@ namespace taylor2
466466
std::vector<float> Results;
467467
Results.resize(Samples);
468468

469-
float Steps = (End - Begin) / float(Samples);
469+
float const Steps = (End - Begin) / static_cast<float>(Samples);
470470

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

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

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

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

491-
float Steps = (End - Begin) / float(Samples);
491+
float const Steps = (End - Begin) / static_cast<float>(Samples);
492492

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

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

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

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

513-
float Steps = (End - Begin) / float(Samples);
513+
float const Steps = (End - Begin) / static_cast<float>(Samples);
514514

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

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

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

0 commit comments

Comments
 (0)