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

@ -417,22 +417,22 @@ void FixIndent::options(int narg, char **arg)
if (strcmp(arg[iarg],"sphere") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
if (utils::strmatch(arg[iarg+1],"^v_")) {
int n = strlen(&arg[iarg+1][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+1][2]);
} else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp);
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
if (utils::strmatch(arg[iarg+2],"^v_")) {
int n = strlen(&arg[iarg+2][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+2][2]);
} else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
if (utils::strmatch(arg[iarg+3],"^v_")) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp);
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
if (utils::strmatch(arg[iarg+4],"^v_")) {
int n = strlen(&arg[iarg+4][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[iarg+4][2]);
@ -446,43 +446,43 @@ void FixIndent::options(int narg, char **arg)
if (strcmp(arg[iarg+1],"x") == 0) {
cdim = 0;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
if (utils::strmatch(arg[iarg+2],"^v_")) {
int n = strlen(&arg[iarg+2][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+2][2]);
} else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
if (utils::strmatch(arg[iarg+3],"^v_")) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp);
} else if (strcmp(arg[iarg+1],"y") == 0) {
cdim = 1;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
if (utils::strmatch(arg[iarg+2],"^v_")) {
int n = strlen(&arg[iarg+2][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+2][2]);
} else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
if (utils::strmatch(arg[iarg+3],"^v_")) {
int n = strlen(&arg[iarg+3][2]) + 1;
zstr = new char[n];
strcpy(zstr,&arg[iarg+3][2]);
} else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp);
} else if (strcmp(arg[iarg+1],"z") == 0) {
cdim = 2;
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
if (utils::strmatch(arg[iarg+2],"^v_")) {
int n = strlen(&arg[iarg+2][2]) + 1;
xstr = new char[n];
strcpy(xstr,&arg[iarg+2][2]);
} else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
if (utils::strmatch(arg[iarg+3],"^v_")) {
int n = strlen(&arg[iarg+3][2]) + 1;
ystr = new char[n];
strcpy(ystr,&arg[iarg+3][2]);
} else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp);
} else error->all(FLERR,"Illegal fix indent command");
if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
if (utils::strmatch(arg[iarg+4],"^v_")) {
int n = strlen(&arg[iarg+4][2]) + 1;
rstr = new char[n];
strcpy(rstr,&arg[iarg+4][2]);
@ -498,7 +498,7 @@ void FixIndent::options(int narg, char **arg)
else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2;
else error->all(FLERR,"Illegal fix indent command");
if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
if (utils::strmatch(arg[iarg+2],"^v_")) {
int n = strlen(&arg[iarg+2][2]) + 1;
pstr = new char[n];
strcpy(pstr,&arg[iarg+2][2]);