File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Change Log -- Ray Tracing in One Weekend
1212
1313### _ The Next Week_
1414 - Delete: remove unused u,v,w variables in initial ` perlin::noise() ` function (#684 )
15-
15+ - Fix: Listing 33, 34, 38: Change implicit casts to explicit ones ( # 692 )
1616
1717----------------------------------------------------------------------------------------------------
1818# v3.2.0 (2020-07-18)
Original file line number Diff line number Diff line change 15911591 auto v = p.y() - floor(p.y());
15921592 auto w = p.z() - floor(p.z());
15931593
1594- int i = floor(p.x());
1595- int j = floor(p.y());
1596- int k = floor(p.z());
1594+ auto i = static_cast < int > ( floor(p.x() ));
1595+ auto j = static_cast < int > ( floor(p.y() ));
1596+ auto k = static_cast < int > ( floor(p.z() ));
15971597 double c[2][2][2];
15981598
15991599 for (int di=0; di < 2; di++)
16451645 w = w*w*(3-2*w);
16461646 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
16471647
1648- int i = floor(p.x());
1649- int j = floor(p.y());
1650- int k = floor(p.z());
1648+ auto i = static_cast < int > ( floor(p.x() ));
1649+ auto j = static_cast < int > ( floor(p.y() ));
1650+ auto k = static_cast < int > ( floor(p.z() ));
16511651 ...
16521652 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16531653 [Listing [perlin-smoothed]: < kbd> [perlin.h]</ kbd> Perlin smoothed]
17801780 auto v = p.y() - floor(p.y());
17811781 auto w = p.z() - floor(p.z());
17821782 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
1783- int i = floor(p.x());
1784- int j = floor(p.y());
1785- int k = floor(p.z());
1783+ auto i = static_cast < int > ( floor(p.x() ));
1784+ auto j = static_cast < int > ( floor(p.y() ));
1785+ auto k = static_cast < int > ( floor(p.z() ));
17861786 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
17871787 vec3 c[2][2][2];
17881788 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
You can’t perform that action at this time.
0 commit comments