From 580bffefeae8957e114d7803505a15be780d6381 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 22 Jul 2013 22:27:57 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10273 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/KSPACE/msm.cpp | 7 ++++--- src/displace_atoms.cpp | 2 +- src/input.cpp | 4 ++-- src/variable.cpp | 6 +++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index dff62c8080..5f6f68d12a 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -2265,7 +2265,7 @@ void MSM::restriction(int n) { //fprintf(screen,"Restricting from level %i to %i\n\n",n,n+1); - int p = order-1; + const int p = order-1; double ***qgrid1 = qgrid[n]; double ***qgrid2 = qgrid[n+1]; @@ -2287,7 +2287,8 @@ void MSM::restriction(int n) // zero out charge on coarser grid - memset(&(qgrid2[nzlo_out[n+1]][nylo_out[n+1]][nxlo_out[n+1]]),0,ngrid[n+1]*sizeof(double)); + memset(&(qgrid2[nzlo_out[n+1]][nylo_out[n+1]][nxlo_out[n+1]]),0, + ngrid[n+1]*sizeof(double)); for (kp = nzlo_in[n+1]; kp <= nzhi_in[n+1]; kp++) for (jp = nylo_in[n+1]; jp <= nyhi_in[n+1]; jp++) @@ -2338,7 +2339,7 @@ void MSM::prolongation(int n) { //fprintf(screen,"Prolongating from level %i to %i\n\n",n+1,n); - int p = order-1; + const int p = order-1; double ***egrid1 = egrid[n]; double ***egrid2 = egrid[n+1]; diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 3076bb2ded..3549c1676f 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -215,7 +215,7 @@ void DisplaceAtoms::command(int narg, char **arg) axis[1] = force->numeric(FLERR,arg[6]); axis[2] = force->numeric(FLERR,arg[7]); double theta = force->numeric(FLERR,arg[8]); - if (dim == 2 and (axis[0] != 0.0 || axis[1] != 0.0)) + if (dim == 2 && (axis[0] != 0.0 || axis[1] != 0.0)) error->all(FLERR,"Invalid displace_atoms rotate axis for 2d"); double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]); diff --git a/src/input.cpp b/src/input.cpp index 0a5be3a9a6..578fe17888 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -200,7 +200,7 @@ void Input::file() // execute the command if (execute_command()) { - char str[maxline+32]; + char *str = new char[maxline+32]; sprintf(str,"Unknown command: %s",line); error->all(FLERR,str); } @@ -266,7 +266,7 @@ char *Input::one(const char *single) // execute the command and return its name if (execute_command()) { - char str[maxline+32]; + char *str = new char[maxline+32]; sprintf(str,"Unknown command: %s",line); error->all(FLERR,str); } diff --git a/src/variable.cpp b/src/variable.cpp index cfd16b6471..406da2474a 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -3618,7 +3618,7 @@ unsigned int Variable::data_mask(char *str) // compute // ---------------- - if ((strncmp(word,"c_",2) == 0) && (i>0) && (not isalnum(str[i-1]))){ + if ((strncmp(word,"c_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) { if (domain->box_exist == 0) error->all(FLERR, "Variable evaluation before simulation box is defined"); @@ -3636,7 +3636,7 @@ unsigned int Variable::data_mask(char *str) delete [] id; } - if ((strncmp(word,"f_",2) == 0) && (i>0) && (not isalnum(str[i-1]))) { + if ((strncmp(word,"f_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) { if (domain->box_exist == 0) error->all(FLERR, "Variable evaluation before simulation box is defined"); @@ -3652,7 +3652,7 @@ unsigned int Variable::data_mask(char *str) delete [] id; } - if ((strncmp(word,"v_",2) == 0) && (i>0) && (not isalnum(str[i-1]))) { + if ((strncmp(word,"v_",2) == 0) && (i>0) && (!isalnum(str[i-1]))) { int ivar = find(word); datamask &= data_mask(ivar); }