fix array indexing bugs flagged by compiler warnings

This commit is contained in:
Axel Kohlmeyer
2022-08-19 06:13:22 -04:00
parent 6bc48f0882
commit 8292a23f94

View File

@ -715,7 +715,7 @@ void FixAveGrid::end_of_step()
else else
norm = 1.0/count; norm = 1.0/count;
vec2d[iy][ix] *= norm; vec2d[iy][ix] *= norm;
count2d[iy][iz] *= invrepeat; count2d[iy][ix] *= invrepeat;
} }
} }
} else { } else {
@ -734,7 +734,7 @@ void FixAveGrid::end_of_step()
norm = 1.0/count; norm = 1.0/count;
array2d[iy][ix][m] *= norm; array2d[iy][ix][m] *= norm;
} }
count2d[iy][iz] *= invrepeat; count2d[iy][ix] *= invrepeat;
} }
} }
} }
@ -754,7 +754,7 @@ void FixAveGrid::end_of_step()
else else
norm = 1.0/count; norm = 1.0/count;
vec3d[iz][iy][ix] *= norm; vec3d[iz][iy][ix] *= norm;
count3d[iz][iy][iz] *= invrepeat; count3d[iz][iy][ix] *= invrepeat;
} }
} }
} else { } else {
@ -774,7 +774,7 @@ void FixAveGrid::end_of_step()
norm = 1.0/count; norm = 1.0/count;
array3d[iz][iy][ix][m] *= norm; array3d[iz][iy][ix][m] *= norm;
} }
count3d[iz][iy][iz] *= invrepeat; count3d[iz][iy][ix] *= invrepeat;
} }
} }
} }