Use typecast to silence CodeQL warnings

This commit is contained in:
Giacomo Fiorin
2021-02-06 17:30:01 -05:00
committed by Axel Kohlmeyer
parent 1609c498bc
commit 5573d01079
2 changed files with 13 additions and 13 deletions

View File

@ -59,7 +59,7 @@ protected:
{
size_t addr = 0;
for (size_t i = 0; i < nd; i++) {
addr += ix[i]*nxc[i];
addr += ix[i]*static_cast<size_t>(nxc[i]);
if (cvm::debug()) {
if (ix[i] >= nx[i]) {
cvm::error("Error: exceeding bounds in colvar_grid.\n", BUG_ERROR);