Fix clang warning
authorRoland Schulz <roland.schulz@intel.com>
Fri, 25 Jan 2019 22:58:09 +0000 (14:58 -0800)
committerMark Abraham <mark.j.abraham@gmail.com>
Sat, 26 Jan 2019 14:57:28 +0000 (15:57 +0100)
No need to capture proxy by reference.

Change-Id: I2a75a3395a7c7d8164bb308e5f2cdde03f4aeb55

src/gromacs/fileio/groio.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/listed-forces/orires.cpp
src/gromacs/mdlib/qmmm.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/tgroup.cpp
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/tests/mtop.cpp

index 858bb3dacee1dee6ea729c4d63de0b38795b179b..8ce41dfc2465c174f05c7f1831fc2433b220025c 100644 (file)
@@ -516,7 +516,7 @@ void write_hconf_mtop(FILE *out, const char *title, gmx_mtop_t *mtop,
 
     const char         *format = get_hconf_format(v != nullptr);
 
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         int         i             = atomP.globalAtomNumber();
         int         residueNumber = atomP.residueNumber();
index c621f00736c6fb2d03aa404afc6c4b114cf46c64..48ed788268d30ecf4221efe43e3017767fbdf5c3 100644 (file)
@@ -810,7 +810,7 @@ static int prepare_x_q(real *q[], rvec *x[], const gmx_mtop_t *mtop, const rvec
         snew(*x, mtop->natoms);
         nq = 0;
 
-        for (const AtomProxy &atomP : AtomRange(*mtop))
+        for (const AtomProxy atomP : AtomRange(*mtop))
         {
             const t_atom &local = atomP.atom();
             int           i     = atomP.globalAtomNumber();
index 5e1ee0da7ec6578593314b90c2eed4e40b83713e..dee74291c0827e0214df50dbc41b4341ff3eb1a1 100644 (file)
@@ -61,7 +61,7 @@ static void low_mspeed(real tempi,
     boltz = BOLTZ*tempi;
     ekin  = 0.0;
     nrdf  = 0;
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           i     = atomP.globalAtomNumber();
index 1c19a678378a9e940675332069245dd38376b1b7..d526d23a6e32900ea18342b97d907484b814dbd6 100644 (file)
@@ -364,7 +364,7 @@ static void check_bonds_timestep(const gmx_mtop_t *mtop, double dt, warninp *wi)
 
 static void check_vel(gmx_mtop_t *mtop, rvec v[])
 {
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           i     = atomP.globalAtomNumber();
@@ -384,7 +384,7 @@ static void check_shells_inputrec(gmx_mtop_t *mtop,
     int                        nshells = 0;
     char                       warn_buf[STRLEN];
 
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         if (local.ptype == eptShell ||
@@ -668,7 +668,7 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
         real                   *mass;
 
         snew(mass, state->natoms);
-        for (const AtomProxy &atomP : AtomRange(*sys))
+        for (const AtomProxy atomP : AtomRange(*sys))
         {
             const t_atom &local = atomP.atom();
             int           i     = atomP.globalAtomNumber();
@@ -1236,7 +1236,7 @@ static real calc_temp(const gmx_mtop_t *mtop,
                       rvec             *v)
 {
     double                     sum_mv2 = 0;
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           i     = atomP.globalAtomNumber();
index 3d92b2fe21fec9da248cd02e7dda6570f46e52d3..9e6a9d1ee27ed9344189168d7a7eb57b24deff8a 100644 (file)
@@ -2802,7 +2802,7 @@ static void calc_nrdf(const gmx_mtop_t *mtop, t_inputrec *ir, char **gnames)
     }
 
     snew(nrdf2, natoms);
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           i     = atomP.globalAtomNumber();
@@ -4140,7 +4140,7 @@ void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
     {
         clear_rvec(acc);
         snew(mgrp, sys->groups.grps[egcACC].nr);
-        for (const AtomProxy &atomP : AtomRange(*sys))
+        for (const AtomProxy atomP : AtomRange(*sys))
         {
             const t_atom &local = atomP.atom();
             int           i     = atomP.globalAtomNumber();
index 3701cfc481cd4610bddfd9d24325d431591bc271..65fb5989db5755f8730fa25b25e1fad448d0d42b 100644 (file)
@@ -221,7 +221,7 @@ void init_orires(FILE                 *fplog,
     rvec                        com   = { 0, 0, 0 };
     double                      mtot  = 0.0;
     int                         j     = 0;
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           i     = atomP.globalAtomNumber();
index 88843e72c9a99be4dc5171890ab7fd8949dbb77c..21221afd2d846e8ec82f6beee9a34fb675720cbb 100644 (file)
@@ -358,7 +358,7 @@ std::vector<int> qmmmAtomIndices(const t_inputrec &ir, const gmx_mtop_t &mtop)
     std::vector<int>    qmmmAtoms;
     for (int i = 0; i < numQmmmGroups; i++)
     {
-        for (const AtomProxy &atomP : AtomRange(mtop))
+        for (const AtomProxy atomP : AtomRange(mtop))
         {
             int index = atomP.globalAtomNumber();
             if (getGroupType(groups, egcQMMM, index) == i)
index 02e4c87c95f48aab58474cd22b40b8c473a7fcbb..805361058dec1742b71049e5d71cd4cf71c23b34 100644 (file)
@@ -353,7 +353,7 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
     snew(shell_index, mtop->natoms);
 
     nshell = 0;
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           i     = atomP.globalAtomNumber();
index f2df57562accd5d07ceb1b0e3ac4de88fc88e01d..1ec70fb65d2c9bae1246457ea2aab8996e7a9116 100644 (file)
@@ -61,7 +61,7 @@ static void init_grpstat(const gmx_mtop_t *mtop, int ngacc, t_grp_acc gstat[])
     if (ngacc > 0)
     {
         const gmx_groups_t    &groups = mtop->groups;
-        for (const AtomProxy &atomP : AtomRange(*mtop))
+        for (const AtomProxy atomP : AtomRange(*mtop))
         {
             const t_atom &local = atomP.atom();
             int           i     = atomP.globalAtomNumber();
index 39b69dce4448f066465a290ccbb760b4e80f3dad..8ca8b32e57a42a045d4e13e507858879d0508816 100644 (file)
@@ -967,7 +967,7 @@ static void copyIdefFromMtop(const gmx_mtop_t &mtop,
     {
         std::vector<real>          qA(mtop.natoms);
         std::vector<real>          qB(mtop.natoms);
-        for (const AtomProxy &atomP : AtomRange(mtop))
+        for (const AtomProxy atomP : AtomRange(mtop))
         {
             const t_atom &local = atomP.atom();
             int           index = atomP.globalAtomNumber();
@@ -1231,7 +1231,7 @@ std::vector<int> get_atom_index(const gmx_mtop_t *mtop)
 {
 
     std::vector<int>             atom_index;
-    for (const AtomProxy &atomP : AtomRange(*mtop))
+    for (const AtomProxy atomP : AtomRange(*mtop))
     {
         const t_atom &local = atomP.atom();
         int           index = atomP.globalAtomNumber();
index f68ab4c312445541f79964034de31121e3b4ca41..72c6dcd7db0010f4d6e131358083a700d38605e3 100644 (file)
@@ -75,7 +75,7 @@ TEST(MtopTest, RangeBasedLoop)
     gmx_mtop_t mtop;
     createBasicTop(&mtop);
     int        count = 0;
-    for (const AtomProxy &atomP : AtomRange(mtop))
+    for (const AtomProxy atomP : AtomRange(mtop))
     {
         EXPECT_EQ(atomP.globalAtomNumber(), count);
         ++count;