diff options
author | 2020-01-10 08:12:00 -0800 | |
---|---|---|
committer | 2020-01-10 08:12:00 -0800 | |
commit | a4284d97b17ff50a3837d99d039aa23511045eae (patch) | |
tree | bb5f382faedbce258ba0047e01d23e91b1ff19ed /Source/Laser/LaserParticleContainer.cpp | |
parent | 8df823565b860150ee619f7b431aa513b03a7297 (diff) | |
parent | 81bb731e828d8b8be0ac1da64bb43a4ebfd1d19e (diff) | |
download | WarpX-a4284d97b17ff50a3837d99d039aa23511045eae.tar.gz WarpX-a4284d97b17ff50a3837d99d039aa23511045eae.tar.zst WarpX-a4284d97b17ff50a3837d99d039aa23511045eae.zip |
Merge pull request #607 from lucafedeli88/fix_minor_things
[mini-PR] Added static_cast<int> where a floating point number was implicitly casted to int
Diffstat (limited to 'Source/Laser/LaserParticleContainer.cpp')
-rw-r--r-- | Source/Laser/LaserParticleContainer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp index ed4313b1e..ed9f5eda0 100644 --- a/Source/Laser/LaserParticleContainer.cpp +++ b/Source/Laser/LaserParticleContainer.cpp @@ -249,8 +249,8 @@ LaserParticleContainer::InitData (int lev) { auto compute_min_max = [&](Real x, Real y, Real z){ const Vector<Real>& pos_plane = InverseTransform({x, y, z}); - int i = pos_plane[0]/S_X; - int j = pos_plane[1]/S_Y; + auto i = static_cast<int>(pos_plane[0]/S_X); + auto j = static_cast<int>(pos_plane[1]/S_Y); plane_lo[0] = std::min(plane_lo[0], i); plane_lo[1] = std::min(plane_lo[1], j); plane_hi[0] = std::max(plane_hi[0], i); |