Skip to content
Snippets Groups Projects
Commit 36319c91 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

get rid of int/uint comparison warnings

parent 7d28482a
Branches
Tags
2 merge requests!21Bugfix/nansampling,!3Bugfix/event manager show html
......@@ -302,7 +302,7 @@ int field<rnumber, be, fc>::io(
/* check file space */
int ndims_fspace = H5Sget_simple_extent_dims(fspace, dims, NULL);
assert(ndims_fspace == ndim(fc));
assert(((unsigned int)(ndims_fspace)) == ndim(fc));
if (this->real_space_representation)
{
for (unsigned int i=0; i<ndim(fc); i++)
......@@ -488,7 +488,7 @@ int field<rnumber, be, fc>::io_database(
/* check file space */
int ndims_fspace = H5Sget_simple_extent_dims(fspace, dims, NULL);
assert(ndims_fspace == ndim(fc) + 1);
assert(ndims_fspace == int(ndim(fc) + 1));
offset[0] = toffset;
if (this->real_space_representation)
{
......@@ -790,7 +790,7 @@ void field<rnumber, be, fc>::symmetrize()
{
for (cc = 0; cc < ncomp(fc); cc++)
data[cc][1] = 0.0;
for (ii = 1; ii < this->clayout->sizes[1]/2; ii++)
for (ii = 1; ii < ptrdiff_t(this->clayout->sizes[1]/2); ii++)
for (cc = 0; cc < ncomp(fc); cc++) {
( *(data + cc + ncomp(fc)*(this->clayout->sizes[1] - ii)*this->clayout->sizes[2]))[0] =
(*(data + cc + ncomp(fc)*( ii)*this->clayout->sizes[2]))[0];
......@@ -803,11 +803,11 @@ void field<rnumber, be, fc>::symmetrize()
ptrdiff_t yy;
/*ptrdiff_t tindex;*/
int ranksrc, rankdst;
for (yy = 1; yy < this->clayout->sizes[0]/2; yy++) {
for (yy = 1; yy < ptrdiff_t(this->clayout->sizes[0]/2); yy++) {
ranksrc = this->clayout->rank[0][yy];
rankdst = this->clayout->rank[0][this->clayout->sizes[0] - yy];
if (this->clayout->myrank == ranksrc)
for (ii = 0; ii < this->clayout->sizes[1]; ii++)
for (ii = 0; ii < ptrdiff_t(this->clayout->sizes[1]); ii++)
for (cc = 0; cc < ncomp(fc); cc++)
for (int imag_comp=0; imag_comp<2; imag_comp++)
(*(buffer + ncomp(fc)*ii+cc))[imag_comp] =
......@@ -825,7 +825,7 @@ void field<rnumber, be, fc>::symmetrize()
}
if (this->clayout->myrank == rankdst)
{
for (ii = 1; ii < this->clayout->sizes[1]; ii++)
for (ii = 1; ii < ptrdiff_t(this->clayout->sizes[1]); ii++)
for (cc = 0; cc < ncomp(fc); cc++)
{
(*(data + ncomp(fc)*((this->clayout->sizes[0] - yy - this->clayout->starts[0])*this->clayout->sizes[1] + ii)*this->clayout->sizes[2] + cc))[0] =
......
......@@ -116,10 +116,10 @@ class field
return (typename fftw_interface<rnumber>::complex*__restrict__)this->data;
}
inline rnumber &rval(ptrdiff_t rindex, int component = 0)
inline rnumber &rval(ptrdiff_t rindex, unsigned int component = 0)
{
assert(fc == ONE || fc == THREE);
assert(component >= 0 && component <ncomp(fc));
assert(component >= 0 && component < ncomp(fc));
return *(this->data + rindex*ncomp(fc) + component);
}
......
......@@ -188,7 +188,7 @@ void kspace<be, dt>::dealias(typename fftw_interface<rnumber>::complex *__restri
ptrdiff_t zindex,
double k2){
double tval = this->dealias_filter[int(round(k2 / this->dk2))];
for (int tcounter=0; tcounter<2*ncomp(fc); tcounter++)
for (unsigned int tcounter=0; tcounter<2*ncomp(fc); tcounter++)
((rnumber*)a)[2*ncomp(fc)*cindex + tcounter] *= tval;
});
break;
......
......@@ -657,8 +657,8 @@ void rFFTW_distributed_particles<particle_type, rnumber, interp_neighbours>::wri
for (int s = -1; s <= 0; s++)
for (auto &pp: this->domain_particles[s])
{
if (pp >= cindex*this->chunk_size &&
pp < (cindex+1)*this->chunk_size)
if (pp >= int(cindex*this->chunk_size) &&
pp < int((cindex+1)*this->chunk_size))
{
std::copy(y[pp].data,
y[pp].data + 3,
......@@ -711,8 +711,8 @@ void rFFTW_distributed_particles<particle_type, rnumber, interp_neighbours>::wri
for (int s = -1; s <= 0; s++)
for (auto &pp: this->domain_particles[s])
{
if (pp >= cindex*this->chunk_size &&
pp < (cindex+1)*this->chunk_size)
if (pp >= int(cindex*this->chunk_size) &&
pp < int((cindex+1)*this->chunk_size))
{
std::copy(this->state[pp].data,
this->state[pp].data + state_dimension(particle_type),
......@@ -754,8 +754,8 @@ void rFFTW_distributed_particles<particle_type, rnumber, interp_neighbours>::wri
for (int s = -1; s <= 0; s++)
for (auto &pp: this->domain_particles[s])
{
if (pp >= cindex*this->chunk_size &&
pp < (cindex+1)*this->chunk_size)
if (pp >= int(cindex*this->chunk_size) &&
pp < int((cindex+1)*this->chunk_size))
{
std::copy(this->rhs[i][pp].data,
this->rhs[i][pp].data + state_dimension(particle_type),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment