replace 'strstr(xxx,"x_") == xxx' with utils::strmatch("^x_")

This commit is contained in:
Axel Kohlmeyer
2021-02-04 15:20:43 -05:00
parent 3e07711739
commit 4e791ac4f7
35 changed files with 163 additions and 163 deletions

View File

@ -450,7 +450,7 @@ int PythonImpl::create_entry(char *name)
char type = format[i];
if (type == 'i') {
pfuncs[ifunc].itype[i] = INT;
if (strstr(istr[i],"v_") == istr[i]) {
if (utils::strmatch(istr[i],"^v_")) {
pfuncs[ifunc].ivarflag[i] = 1;
int n = strlen(&istr[i][2]) + 1;
pfuncs[ifunc].svalue[i] = new char[n];
@ -461,7 +461,7 @@ int PythonImpl::create_entry(char *name)
}
} else if (type == 'f') {
pfuncs[ifunc].itype[i] = DOUBLE;
if (strstr(istr[i],"v_") == istr[i]) {
if (utils::strmatch(istr[i],"^v_")) {
pfuncs[ifunc].ivarflag[i] = 1;
int n = strlen(&istr[i][2]) + 1;
pfuncs[ifunc].svalue[i] = new char[n];
@ -472,7 +472,7 @@ int PythonImpl::create_entry(char *name)
}
} else if (type == 's') {
pfuncs[ifunc].itype[i] = STRING;
if (strstr(istr[i],"v_") == istr[i]) {
if (utils::strmatch(istr[i],"^v_")) {
pfuncs[ifunc].ivarflag[i] = 1;
int n = strlen(&istr[i][2]) + 1;
pfuncs[ifunc].svalue[i] = new char[n];