diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index 2da5f68895..29a2ea9dba 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -40,8 +40,6 @@ using namespace LAMMPS_NS; enum{NONE,INT,DOUBLE,STRING,PTR}; -#define VALUELENGTH 64 // also in variable.cpp - /* ---------------------------------------------------------------------- */ @@ -369,7 +367,7 @@ void PythonImpl::invoke_function(int ifunc, char *result) const char *pystr = PY_STRING_AS_STRING(pValue); if (pfuncs[ifunc].longstr) strncpy(pfuncs[ifunc].longstr,pystr,pfuncs[ifunc].length_longstr); - else strncpy(result,pystr,VALUELENGTH-1); + else strncpy(result,pystr,Variable::VALUELENGTH-1); } } Py_CLEAR(pValue); diff --git a/src/variable.cpp b/src/variable.cpp index ba34ea2a78..a59a24381f 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -49,7 +49,6 @@ using namespace MathConst; #define MAXLEVEL 4 #define MAXLINE 256 #define CHUNK 1024 -#define VALUELENGTH 64 // also in python.cpp #define MAXFUNCARG 6 #define MYROUND(a) (( a-floor(a) ) >= .5) ? ceil(a) : floor(a) diff --git a/src/variable.h b/src/variable.h index 845145d336..dbad793b57 100644 --- a/src/variable.h +++ b/src/variable.h @@ -72,6 +72,7 @@ class Variable : protected Pointers { PYTHON, INTERNAL }; + static constexpr int VALUELENGTH = 64; private: int me;