silence signed vs. unsigned integer warnings

This commit is contained in:
Axel Kohlmeyer 2020-08-18 14:33:02 -04:00
parent a537ffabf9
commit 78d5714247
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
4 changed files with 9 additions and 9 deletions

View File

@ -555,7 +555,7 @@ static int sizeofint(const int size)
unsigned int num = 1;
int num_of_bits = 0;
while (size >= num && num_of_bits < 32) {
while (size >= (int) num && num_of_bits < 32) {
num_of_bits++;
num <<= 1;
}
@ -596,7 +596,7 @@ static int sizeofints( const int num_of_ints, unsigned int sizes[])
}
num = 1;
num_of_bytes--;
while (bytes[num_of_bytes] >= num) {
while ((int)bytes[num_of_bytes] >= num) {
num_of_bits++;
num *= 2;
}
@ -650,7 +650,7 @@ static void sendints(int buf[], const int num_of_ints, const int num_of_bits,
}
num_of_bytes = bytecnt;
}
if (num_of_bits >= num_of_bytes * 8) {
if (num_of_bits >= (int)num_of_bytes * 8) {
for (i = 0; i < num_of_bytes; i++) {
sendbits(buf, 8, bytes[i]);
}

View File

@ -318,7 +318,7 @@ void FixRX::post_constructor()
error->all(FLERR,"Exceeded the maximum number of species permitted in fix rx.");
tmpspecies[nUniqueSpecies] = new char[strlen(word)+1];
strcpy(tmpspecies[nUniqueSpecies],word);
tmpmaxstrlen = MAX(tmpmaxstrlen,strlen(word));
tmpmaxstrlen = MAX(tmpmaxstrlen,(int)strlen(word));
nUniqueSpecies++;
}
word = strtok(NULL, " \t\n\r\f");
@ -543,7 +543,7 @@ void FixRX::initSparse()
if (SparseKinetics_enableIntegralReactions){
sparseKinetics_inu[i][idx] = (int)sparseKinetics_nu[i][idx];
if (isIntegral_i){
if (sparseKinetics_inu[i][idx] >= nu_bin.size())
if (sparseKinetics_inu[i][idx] >= (int)nu_bin.size())
nu_bin.resize( sparseKinetics_inu[i][idx] );
nu_bin[ sparseKinetics_inu[i][idx] ] ++;

View File

@ -37,7 +37,7 @@ void Tridiagonal_Solve( const double *a, const double *b,
c[0] /= b[0]; /* Division by zero risk. */
d[0] /= b[0]; /* Division by zero would imply a singular matrix. */
for(i = 1; i < n; i++){
for(i = 1; i < (int)n; i++){
id = (b[i] - c[i-1] * a[i]); /* Division by zero risk. */
c[i] /= id; /* Last value calculated is redundant. */
d[i] = (d[i] - d[i-1] * a[i])/id;
@ -64,7 +64,7 @@ void Natural_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const d
/* build the linear system */
a[0] = a[1] = a[n-1] = 0;
for( i = 2; i < n-1; ++i )
for( i = 2; i < (int)n-1; ++i )
a[i] = h[i-1];
b[0] = b[n-1] = 0;

View File

@ -543,10 +543,10 @@ void ComputeVoronoi::processCell(voronoicell_neighbor &c, int i)
c.vertices(vcell);
c.face_vertices(vlist); // for each face: vertex count followed list of vertex indices (n_1,v1_1,v2_1,v3_1,..,vn_1,n_2,v2_1,...)
double dx, dy, dz, r2, t2 = ethresh*ethresh;
for( j=0; j<vlist.size(); j+=vlist[j]+1 ) {
for( j=0; j < (int)vlist.size(); j+=vlist[j]+1 ) {
int a, b, nedge = 0;
// vlist[j] contains number of vertex indices for the current face
for( k=0; k<vlist[j]; ++k ) {
for( k=0; k < vlist[j]; ++k ) {
a = vlist[j+1+k]; // first vertex in edge
b = vlist[j+1+(k+1)%vlist[j]]; // second vertex in edge (possible wrap around to first vertex in list)
dx = vcell[a*3] - vcell[b*3];