From 34790decf978ef72b32acedd87a88580b11a42d7 Mon Sep 17 00:00:00 2001 From: Ilker Topcuoglu Date: Tue, 17 Dec 2024 12:47:31 -0700 Subject: [PATCH] static_cast:q --- src/CartBlock.C | 6 ++++-- src/CartGrid.C | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/CartBlock.C b/src/CartBlock.C index b4c58d0..0ee21c0 100644 --- a/src/CartBlock.C +++ b/src/CartBlock.C @@ -112,7 +112,8 @@ void CartBlock::getInterpolatedData( for (i = 0; i < listptr->nweights; i++) { int const cell_index = (cart_utils::get_cell_index( - dims[0], dims[1], nf, listptr->inode[3 * i], + dims[0], dims[1], nf, + listptr->inode[static_cast(3 * i)], listptr->inode[(3 * i) + 1], listptr->inode[(3 * i) + 2])); for (n = 0; n < nvar_cell; n++) { weight = listptr->weights[i]; @@ -169,7 +170,8 @@ void CartBlock::preprocess(CartGrid* cg) for (int n = 0; n < 3; n++) { dx[n] = cg->dx[(3 * global_id) + n]; } - dims[0] = cg->ihi[3 * global_id] - cg->ilo[3 * global_id] + 1; + dims[0] = cg->ihi[static_cast(3 * global_id)] - + cg->ilo[static_cast(3 * global_id)] + 1; dims[1] = cg->ihi[(3 * global_id) + 1] - cg->ilo[(3 * global_id) + 1] + 1; dims[2] = cg->ihi[(3 * global_id) + 2] - cg->ilo[(3 * global_id) + 2] + 1; nf = cg->nf; diff --git a/src/CartGrid.C b/src/CartGrid.C index 0027452..cce968a 100644 --- a/src/CartGrid.C +++ b/src/CartGrid.C @@ -221,17 +221,19 @@ void CartGrid::search(double* x, int* donorid, int npts) } } } - if (myid == 2 && abs(x[3 * i] - 0.739573) < 1e-5 && + if (myid == 2 && + abs(x[static_cast(3 * i)] - 0.739573) < 1e-5 && abs(x[(3 * i) + 1] + 0.259310) < 1e-5 && abs(x[(3 * i) + 2] + 0.639614) < 1e-5) { printf( - "%d %d %f %f %f %d\n", myid, i, x[3 * i], x[(3 * i) + 1], + "%d %d %f %f %f %d\n", myid, i, + x[static_cast(3 * i)], x[(3 * i) + 1], x[(3 * i) + 2], donorid[i]); } if (donorid[i] == -1) { printf( - "%d %f %f %f\n", myid, x[3 * i], x[(3 * i) + 1], - x[(3 * i) + 2]); + "%d %f %f %f\n", myid, x[static_cast(3 * i)], + x[(3 * i) + 1], x[(3 * i) + 2]); } } // printf("CartGrid::search Processor %d located %d of %d