Fix compilation issue: pass variable of expected type to resize
authorAlan Gray <alangray3@gmail.com>
Tue, 4 Aug 2020 12:30:35 +0000 (12:30 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 4 Aug 2020 12:30:35 +0000 (12:30 +0000)
Compilation was failing under certian situations since a7e51062b4
because of the line
flags->resize(sizeNeededForBufferFlags(numAtoms),0);
since the second arg is expected to be of type gmx_bitmask_t to
match the type in the flags vector. This patch fixes by explicitly
passing a zeroed variable of the correct type.

src/gromacs/nbnxm/pairlist.cpp

index ad09daed08485454e8bc888c9dc98cd60b7ab1ad..95f8243c88732a82131641144d4bd3d192a740a6 100644 (file)
@@ -249,7 +249,7 @@ static constexpr int sizeNeededForBufferFlags(const int numAtoms)
 static void resizeAndZeroBufferFlags(std::vector<gmx_bitmask_t>* flags, const int numAtoms)
 {
     flags->clear();
-    flags->resize(sizeNeededForBufferFlags(numAtoms), 0);
+    flags->resize(sizeNeededForBufferFlags(numAtoms), gmx_bitmask_t{ 0 });
 }