Fix misc-misplaced-const and unused-parameter warnings
authorAndrey Alekseenko <al42and@gmail.com>
Wed, 6 Oct 2021 10:20:23 +0000 (12:20 +0200)
committerAndrey Alekseenko <al42and@gmail.com>
Wed, 6 Oct 2021 16:55:35 +0000 (16:55 +0000)
The problems were introduced in bbcd5f1 (MR !536).

As MPI_Comm is typedef'd as a pointer to a structure, declaring it const
would be of little use: the pointer itself would be const, not the data
it is pointing to.

src/gromacs/applied_forces/awh/biassharing.cpp

index 056451b405cc4a15002ae8cc229d515265d17d3b..176d0c350d2cb0b1f94fb3691c9a7c707cadea1e 100644 (file)
@@ -249,7 +249,7 @@ std::enable_if_t<std::is_same_v<T, double>, MPI_Datatype> mpiType()
  */
 template<typename T>
 void sumOverSimulations(ArrayRef<T>      data,
-                        const MPI_Comm   multiSimComm,
+                        MPI_Comm         multiSimComm,
                         const bool       broadcastWithinSimulation,
                         const t_commrec& commRecord)
 {
@@ -265,6 +265,7 @@ void sumOverSimulations(ArrayRef<T>      data,
 #else
     GMX_UNUSED_VALUE(data);
     GMX_UNUSED_VALUE(commRecord);
+    GMX_UNUSED_VALUE(broadcastWithinSimulation);
     GMX_UNUSED_VALUE(multiSimComm);
 #endif // GMX_MPI
 }