Update clang-tidy to clang version 8
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_potential.cpp
index 4c39aa2e41d05036344d19aca395480d4b00ba4a..fef1987053cd503f2f0bdbe99a9c987696d5a271 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -167,7 +167,7 @@ static void calc_potential(const char *fn, int **index, int gnx[],
     /*********** Start processing trajectory ***********/
     do
     {
-        *slWidth = box[axis][axis]/(*nslices);
+        *slWidth = box[axis][axis]/static_cast<real>((*nslices));
         teller++;
         gmx_rmpbc(gpbc, natoms, box, x0);
 
@@ -268,7 +268,7 @@ static void calc_potential(const char *fn, int **index, int gnx[],
             {
                 /* get charge per volume */
                 (*slCharge)[n][i] = (*slCharge)[n][i] * (*nslices) /
-                    (nr_frames * box[axis][axis] * box[ax1][ax1] * box[ax2][ax2]);
+                    (static_cast<real>(nr_frames) * box[axis][axis] * box[ax1][ax1] * box[ax2][ax2]);
             }
         }
         /* Now we have charge densities */