From c28b9f100cac531fccaae435bc90c6d3ca67c583 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 18 Mar 2020 15:38:29 -0400 Subject: [PATCH] remove unused and broken function --- src/utils.cpp | 23 ----------------------- src/utils.h | 19 ------------------- 2 files changed, 42 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index f6556a3ac8..5e0db6afb9 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -84,29 +84,6 @@ bool utils::strmatch(std::string text, std::string pattern) return (pos >= 0); } -/* utility function to avoid code repetition when parsing args */ -int utils::cfvarg(std::string mode, const char *arg, char *&cfv_id) -{ - int rv = utils::NONE; - cfv_id = NULL; - - if (!arg) return rv; - - if (utils::strmatch(arg,std::string("^[") + mode + "]_")) { - if (*arg == 'c') rv = utils::COMPUTE; - else if (*arg == 'f') rv = utils::FIX; - else if (*arg == 'v') rv = utils::VARIABLE; - else return rv; // should not happen - - arg += 2; - int n = strlen(arg)+1; - cfv_id = new char[n]; - strcpy(cfv_id,arg); - } - - return rv; -} - /** \brief try to detect pathname from FILE pointer. Currently only supported on Linux, otherwise will report "(unknown)". * * \param buf storage buffer for pathname. output will be truncated if not large enough diff --git a/src/utils.h b/src/utils.h index e87aa4bb91..45fb95aaac 100644 --- a/src/utils.h +++ b/src/utils.h @@ -36,25 +36,6 @@ namespace LAMMPS_NS { */ bool strmatch(std::string text, std::string pattern); - /** Categories of special arguments for cfvarg() function - * - * Enum starts from 100 to avoid conflicts with other local define flags - */ - enum {NONE=100, /// does not match any category - COMPUTE, /// processed a compute - FIX, /// processed a fix - VARIABLE /// processed a variable - }; - - /** \brief Convenience function to process 'c_', 'f_', and 'v_' arguments - * - * \param mode types to search for. 1-3 char string from 'c', 'f', or 'v' - * \param arg argument string to test against the prefixes - * \param cfv_id name or ID of the compute, fix, or variable - * \return utils::COMPUTE, utils::FIX, utils::VARIABLE or utils::NONE - */ - int cfvarg(std::string mode, const char *arg, char *&cfv_id); - /** \brief safe wrapper around fgets() which aborts on errors * or EOF and prints a suitable error message to help debugging *