From 0d968374b8a28c748e9fe49a0c4c4d23c0a8b94d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 13 Aug 2024 06:39:47 -0400 Subject: [PATCH] small cleanup --- src/COLVARS/fix_colvars.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/COLVARS/fix_colvars.cpp b/src/COLVARS/fix_colvars.cpp index 6e52000e12..412720aea5 100644 --- a/src/COLVARS/fix_colvars.cpp +++ b/src/COLVARS/fix_colvars.cpp @@ -42,9 +42,6 @@ #include "universe.h" #include "update.h" -#include -#include - #include "colvarmodule.h" #include "colvarproxy.h" #include "colvarproxy_lammps.h" @@ -57,12 +54,6 @@ struct LAMMPS_NS::commdata { double x, y, z, m, q; }; -inline std::ostream &operator<<(std::ostream &out, const LAMMPS_NS::commdata &cd) -{ - out << " (" << cd.tag << "/" << cd.type << ": " << cd.x << ", " << cd.y << ", " << cd.z << ") "; - return out; -} - /***************************************************************/ using namespace LAMMPS_NS; @@ -130,7 +121,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : force_buf = nullptr; idmap = nullptr; - script_args[0] = reinterpret_cast(strdup("fix_modify")); + script_args[0] = reinterpret_cast(utils::strdup("fix_modify")); parse_fix_arguments(narg, arg, true); @@ -227,12 +218,11 @@ FixColvars::~FixColvars() delete[] inp_name; delete[] out_name; delete[] tfix_name; - memory->sfree(comm_buf); - memory->sfree(script_args[0]); + delete[] script_args[0]; - if (proxy) { - delete proxy; - } + memory->sfree(comm_buf); + + if (proxy) delete proxy; if (idmap) { inthash_destroy(idmap);