make VALUELENGTH constant consistent.

This commit is contained in:
Axel Kohlmeyer
2021-09-04 12:41:52 -04:00
parent 801cd647c3
commit 91b0ae798a
3 changed files with 2 additions and 4 deletions

View File

@ -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);

View File

@ -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)

View File

@ -72,6 +72,7 @@ class Variable : protected Pointers {
PYTHON,
INTERNAL
};
static constexpr int VALUELENGTH = 64;
private:
int me;