Fix compiler and linter warnings
authorAndrey Alekseenko <al42and@gmail.com>
Mon, 22 Mar 2021 09:09:33 +0000 (09:09 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 22 Mar 2021 09:09:33 +0000 (09:09 +0000)
- Unused variables in pme_pp.cpp
- Insufficient NOLINTing in update.cpp

src/gromacs/ewald/pme_pp.cpp
src/gromacs/mdlib/update.cpp

index 32a1ec774403652809fa0f45705e8f2d798e5734..3a929daf1f5437e337fa8f0122ed1990316c6923 100644 (file)
@@ -285,6 +285,12 @@ static void gmx_pme_send_coeffs_coords(t_forcerec*         fr,
     }
 #else
     GMX_UNUSED_VALUE(fr);
+    GMX_UNUSED_VALUE(chargeA);
+    GMX_UNUSED_VALUE(chargeB);
+    GMX_UNUSED_VALUE(c6A);
+    GMX_UNUSED_VALUE(c6B);
+    GMX_UNUSED_VALUE(sigmaA);
+    GMX_UNUSED_VALUE(sigmaB);
     GMX_UNUSED_VALUE(reinitGpuPmePpComms);
     GMX_UNUSED_VALUE(sendCoordinatesFromGpu);
     GMX_UNUSED_VALUE(coordinatesReadyOnDeviceEvent);
index 4def5f35344359bad997ce5528da61f08bcf7f3c..7b7c6717ea4f724030e0f3f92b1a96bc8b5a5ee5 100644 (file)
@@ -347,11 +347,12 @@ updateMDLeapfrogSimple(int         start,
             {
                 vNew -= dtPressureCouple * pRVScaleMatrixDiagonal[d] * v[a][d];
             }
+            // TODO: Remove NOLINTs once clang-tidy is updated to v11, it should be able to handle constexpr.
             if constexpr (storeUpdatedVelocities == StoreUpdatedVelocities::yes) // NOLINT // NOLINTNEXTLINE
             {
                 v[a][d] = vNew;
             }
-            xprime[a][d] = x[a][d] + vNew * dt;
+            xprime[a][d] = x[a][d] + vNew * dt; // NOLINT(readability-misleading-indentation)
         }
     }
 }
@@ -459,12 +460,13 @@ updateMDLeapfrogSimpleSimd(int         start,
         v1 = fma(f1 * invMass1, timestep, lambdaSystem * v1);
         v2 = fma(f2 * invMass2, timestep, lambdaSystem * v2);
 
+        // TODO: Remove NOLINTs once clang-tidy is updated to v11, it should be able to handle constexpr.
         if constexpr (storeUpdatedVelocities == StoreUpdatedVelocities::yes) // NOLINT // NOLINTNEXTLINE
         {
             simdStoreRvecs(v, a, v0, v1, v2);
         }
 
-        SimdReal x0, x1, x2;
+        SimdReal x0, x1, x2; // NOLINT(readability-misleading-indentation)
         simdLoadRvecs(x, a, &x0, &x1, &x2);
 
         SimdReal xprime0 = fma(v0, timestep, x0);