diff --git a/src/ADT.C b/src/ADT.C index 5ca1e85..79a6b39 100644 --- a/src/ADT.C +++ b/src/ADT.C @@ -111,7 +111,7 @@ void ADT::buildADT(int d, int nelements, double* elementBbox) // fp=fopen("adtReals.dat","w"); // fp1=fopen("adtInts.dat","w"); for (i = 0; i < nelem; i++) { - i4 = 4 * adtIntegers[4 * i]; + i4 = 4 * adtIntegers[static_cast(4 * i)]; adtIntegers[i4 + 3] = i; } // for(i=0;inweights; i++) { - int const cell_index = cart_utils::get_cell_index( - dims[0], dims[1], nf, listptr->inode[3 * i], - listptr->inode[3 * i + 1], listptr->inode[3 * i + 2]); + int const cell_index = + static_cast(cart_utils::get_cell_index( + 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]; qq[n] += qcell[cell_index + ncell_nf * n] * weight; @@ -168,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; @@ -224,7 +227,7 @@ void CartBlock::insertInInterpList( listptr->receptorInfo[1] = remoteid; listptr->receptorInfo[2] = remoteblockid; for (n = 0; n < 3; n++) { - ix[n] = (xtmp[n] - xlo[n]) / dx[n]; + ix[n] = static_cast((xtmp[n] - xlo[n]) / dx[n]); rst[n] = (xtmp[n] - xlo[n] - ix[n] * dx[n]) / dx[n]; if (ix[n] == dims[n]) { if (fabs(rst[n]) < TOL) { @@ -256,10 +259,10 @@ void CartBlock::insertInInterpList( } if (donor_frac == nullptr) { listptr->nweights = 8; - listptr->weights = - (double*)malloc(sizeof(double) * (listptr->nweights * 2)); - listptr->inode = - (int*)malloc(sizeof(int) * (listptr->nweights * 2 * 3)); + listptr->weights = (double*)malloc( + sizeof(double) * (static_cast(listptr->nweights * 2))); + listptr->inode = (int*)malloc( + sizeof(int) * (static_cast(listptr->nweights * 2 * 3))); cart_interp::linear_interpolation( nf, ix, dims, rst, &(listptr->nweights), listptr->inode,