reduce compiler warnings by avoiding to redeclare variables so they shadow others
This commit is contained in:
@ -687,6 +687,7 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
// or if idsflag = NFREQ and lock is in place and are on later timestep
|
||||
// else proceed to recalculate per-atom chunk assignments
|
||||
|
||||
const int nlocal = atom->nlocal;
|
||||
int restore = 0;
|
||||
if (idsflag == ONCE && invoked_ichunk >= 0) restore = 1;
|
||||
if (idsflag == NFREQ && lockfix && update->ntimestep > lockstart) restore = 1;
|
||||
@ -694,7 +695,6 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
if (restore) {
|
||||
invoked_ichunk = update->ntimestep;
|
||||
double *vstore = fixstore->vstore;
|
||||
int nlocal = atom->nlocal;
|
||||
for (i = 0; i < nlocal; i++) ichunk[i] = static_cast<int> (vstore[i]);
|
||||
return;
|
||||
}
|
||||
@ -711,8 +711,6 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
// compress chunk IDs via hash of the original uncompressed IDs
|
||||
// also apply discard rule except for binning styles which already did
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
if (compress) {
|
||||
if (binflag) {
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
@ -761,8 +759,7 @@ void ComputeChunkAtom::compute_ichunk()
|
||||
|
||||
if (idsflag == ONCE || (idsflag == NFREQ && lockfix)) {
|
||||
double *vstore = fixstore->vstore;
|
||||
int nlocal = atom->nlocal;
|
||||
for (int i = 0; i < nlocal; i++) vstore[i] = ichunk[i];
|
||||
for (i = 0; i < nlocal; i++) vstore[i] = ichunk[i];
|
||||
}
|
||||
|
||||
// one-time check if which = MOLECULE and
|
||||
@ -897,7 +894,7 @@ void ComputeChunkAtom::assign_chunk_ids()
|
||||
|
||||
double **x = atom->x;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
const int nlocal = atom->nlocal;
|
||||
|
||||
if (regionflag) {
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
|
||||
Reference in New Issue
Block a user