aboutsummaryrefslogtreecommitdiff
path: root/Source/Laser/LaserParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2020-01-10 08:12:00 -0800
committerGravatar GitHub <noreply@github.com> 2020-01-10 08:12:00 -0800
commita4284d97b17ff50a3837d99d039aa23511045eae (patch)
treebb5f382faedbce258ba0047e01d23e91b1ff19ed /Source/Laser/LaserParticleContainer.cpp
parent8df823565b860150ee619f7b431aa513b03a7297 (diff)
parent81bb731e828d8b8be0ac1da64bb43a4ebfd1d19e (diff)
downloadWarpX-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.cpp4
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);