From 81933b797221e465df0c9d9c30df28a72ccb76ce Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 8 Apr 2022 21:19:32 -0400 Subject: [PATCH] silence compiler warnings --- src/MDI/fix_mdi_engine.cpp | 10 +++++----- src/MDI/mdi_engine.cpp | 13 ++++++------- src/MDI/mdi_plugin.cpp | 5 ++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine.cpp index aac4f727fb..e68b9b54b4 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -28,7 +28,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +FixMDIEngine::FixMDIEngine(LAMMPS *_lmp, int narg, char **arg) : Fix(_lmp, narg, arg) { if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); } @@ -48,7 +48,7 @@ int FixMDIEngine::setmask() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::setup(int vflag) +void FixMDIEngine::setup(int /*vflag*/) { // engine is now at FORCES node @@ -66,7 +66,7 @@ void FixMDIEngine::post_integrate() /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_pre_force(int vflag) +void FixMDIEngine::min_pre_force(int /*vflag*/) { // engine is now at COORDS node for minimizer @@ -75,7 +75,7 @@ void FixMDIEngine::min_pre_force(int vflag) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::post_force(int vflag) +void FixMDIEngine::post_force(int /*vflag*/) { // engine is now at FORCES node for MD @@ -84,7 +84,7 @@ void FixMDIEngine::post_force(int vflag) /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_post_force(int vflag) +void FixMDIEngine::min_post_force(int /*vflag*/) { // engine is now at FORCES node for minimizer diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 91933d079e..6a1f8e5c30 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -63,7 +63,7 @@ enum { TYPE, CHARGE, MASS, COORD, VELOCITY, FORCE, ADDFORCE }; when EXIT command is received, mdi engine command exits ---------------------------------------------------------------------- */ -MDIEngine::MDIEngine(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) +MDIEngine::MDIEngine(LAMMPS *_lmp, int narg, char ** /*arg*/) : Pointers(_lmp) { if (narg) error->all(FLERR, "Illegal mdi engine command"); @@ -278,12 +278,12 @@ int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) int command_exists; if (root) { ierr = MDI_Check_command_exists(node_engine, command, MDI_COMM_NULL, &command_exists); - if (ierr) error->one(FLERR, "MDI: Unable to check whether current command is supported"); + if (ierr) error->one(FLERR, "MDI: Cannot confirm that command '{}' is supported", command); } MPI_Bcast(&command_exists, 1, MPI_INT, 0, world); if (!command_exists) - error->all(FLERR, "MDI: Received command {} unsupported by engine node {}", command, + error->all(FLERR, "MDI: Received command '{}' unsupported by engine node {}", command, node_engine); // --------------------------------------- @@ -960,10 +960,9 @@ void MDIEngine::create_system() // optionally set charges if specified by ">CHARGES" if (flag_velocities) - int natoms = - lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, sys_velocities, NULL, 1); + lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, sys_velocities, NULL, 1); else - int natoms = lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, NULL, NULL, 1); + lammps_create_atoms(lmp, sys_natoms, NULL, sys_types, sys_coords, NULL, NULL, 1); if (flag_charges) lammps_scatter_atoms(lmp, (char *) "q", 1, 1, sys_charges); @@ -1628,7 +1627,7 @@ void MDIEngine::infile() char *infile = new char[nbytes + 1]; int ierr = MDI_Recv(infile, nbytes + 1, MDI_CHAR, mdicomm); - if (ierr) error->all(FLERR, "MDI: INFILE data"); + if (ierr) error->all(FLERR, "MDI: INFILE data for {}", infile); MPI_Bcast(infile, nbytes + 1, MPI_CHAR, 0, world); infile[nbytes] = '\0'; diff --git a/src/MDI/mdi_plugin.cpp b/src/MDI/mdi_plugin.cpp index 65bc1d8942..d1fcd2d941 100644 --- a/src/MDI/mdi_plugin.cpp +++ b/src/MDI/mdi_plugin.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; this class is destroyed ---------------------------------------------------------------------- */ -MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) +MDIPlugin::MDIPlugin(LAMMPS *_lmp, int narg, char **arg) : Pointers(_lmp) { if (narg < 1) error->all(FLERR, "Illegal mdi plugin command"); @@ -112,9 +112,8 @@ MDIPlugin::MDIPlugin(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) with the plugin ---------------------------------------------------------------------- */ -int MDIPlugin::plugin_wrapper(void *pmpicomm, MDI_Comm mdicomm, void *vptr) +int MDIPlugin::plugin_wrapper(void * /*pmpicomm*/, MDI_Comm mdicomm, void *vptr) { - MPI_Comm mpicomm = *(MPI_Comm *) pmpicomm; MDIPlugin *ptr = (MDIPlugin *) vptr; LAMMPS *lammps = ptr->lmp; char *lammps_command = ptr->lammps_command;