forked from lijiext/lammps
silence compiler warnings about signed vs. unsigned ints
This commit is contained in:
parent
e185537255
commit
a53ee5664e
|
@ -256,7 +256,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con
|
|||
std::string key = words[1];
|
||||
std::string filename = words[2];
|
||||
std::vector<std::string> species(words.begin()+3,words.end());
|
||||
if (species.size() != atom->ntypes)
|
||||
if ((int)species.size() != atom->ntypes)
|
||||
error->one(FLERR,"Incorrect args for KIM_SET_TYPE_PARAMETERS command");
|
||||
|
||||
FILE *fp;
|
||||
|
|
|
@ -651,12 +651,12 @@ static void sendints(int buf[], const int num_of_ints, const int num_of_bits,
|
|||
num_of_bytes = bytecnt;
|
||||
}
|
||||
if (num_of_bits >= (int)num_of_bytes * 8) {
|
||||
for (i = 0; i < num_of_bytes; i++) {
|
||||
for (i = 0; i < (int)num_of_bytes; i++) {
|
||||
sendbits(buf, 8, bytes[i]);
|
||||
}
|
||||
sendbits(buf, num_of_bits - num_of_bytes * 8, 0);
|
||||
} else {
|
||||
for (i = 0; i < num_of_bytes-1; i++) {
|
||||
for (i = 0; i < (int)num_of_bytes-1; i++) {
|
||||
sendbits(buf, 8, bytes[i]);
|
||||
}
|
||||
sendbits(buf, num_of_bits- (num_of_bytes -1) * 8, bytes[i]);
|
||||
|
@ -691,7 +691,7 @@ static int receivebits(int buf[], int num_of_bits)
|
|||
num_of_bits -=8;
|
||||
}
|
||||
if (num_of_bits > 0) {
|
||||
if (lastbits < num_of_bits) {
|
||||
if ((int)lastbits < num_of_bits) {
|
||||
lastbits += 8;
|
||||
lastbyte = (lastbyte << 8) | cbuf[cnt++];
|
||||
}
|
||||
|
@ -931,11 +931,11 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
|
|||
lip = ip;
|
||||
luip = (unsigned int *) ip;
|
||||
smallidx = FIRSTIDX;
|
||||
while (smallidx < LASTIDX && magicints[smallidx] < mindiff) {
|
||||
while (smallidx < (int)LASTIDX && magicints[smallidx] < mindiff) {
|
||||
smallidx++;
|
||||
}
|
||||
xdr_int(xdrs, &smallidx);
|
||||
maxidx = MYMIN(LASTIDX, smallidx + 8) ;
|
||||
maxidx = MYMIN((int)LASTIDX, smallidx + 8) ;
|
||||
minidx = maxidx - 8; /* often this equal smallidx */
|
||||
smaller = magicints[MYMAX(FIRSTIDX, smallidx-1)] / 2;
|
||||
small = magicints[smallidx] / 2;
|
||||
|
@ -1111,7 +1111,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
|
|||
}
|
||||
|
||||
xdr_int(xdrs, &smallidx);
|
||||
maxidx = MYMIN(LASTIDX, smallidx + 8) ;
|
||||
maxidx = MYMIN((int)LASTIDX, smallidx + 8) ;
|
||||
minidx = maxidx - 8; /* often this equal smallidx */
|
||||
smaller = magicints[MYMAX(FIRSTIDX, smallidx-1)] / 2;
|
||||
small = magicints[smallidx] / 2;
|
||||
|
|
|
@ -561,7 +561,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] ] ++;
|
||||
|
|
|
@ -68,22 +68,22 @@ void Natural_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const d
|
|||
a[i] = h[i-1];
|
||||
|
||||
b[0] = b[n-1] = 0;
|
||||
for( i = 1; i < n-1; ++i )
|
||||
for( i = 1; i < (int)n-1; ++i )
|
||||
b[i] = 2 * (h[i-1] + h[i]);
|
||||
|
||||
c[0] = c[n-2] = c[n-1] = 0;
|
||||
for( i = 1; i < n-2; ++i )
|
||||
for( i = 1; i < (int)n-2; ++i )
|
||||
c[i] = h[i];
|
||||
|
||||
d[0] = d[n-1] = 0;
|
||||
for( i = 1; i < n-1; ++i )
|
||||
for( i = 1; i < (int)n-1; ++i )
|
||||
d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]);
|
||||
|
||||
v[0] = 0;
|
||||
v[n-1] = 0;
|
||||
Tridiagonal_Solve( &(a[1]), &(b[1]), &(c[1]), &(d[1]), &(v[1]), n-2 );
|
||||
|
||||
for( i = 1; i < n; ++i ){
|
||||
for( i = 1; i < (int)n; ++i ){
|
||||
coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]);
|
||||
coef[i-1].c = v[i]/2;
|
||||
coef[i-1].b = (f[i]-f[i-1])/h[i-1] + h[i-1]*(2*v[i] + v[i-1])/6;
|
||||
|
@ -114,25 +114,25 @@ void Complete_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const
|
|||
|
||||
/* build the linear system */
|
||||
a[0] = 0;
|
||||
for( i = 1; i < n; ++i )
|
||||
for( i = 1; i < (int)n; ++i )
|
||||
a[i] = h[i-1];
|
||||
|
||||
b[0] = 2*h[0];
|
||||
for( i = 1; i < n; ++i )
|
||||
for( i = 1; i < (int)n; ++i )
|
||||
b[i] = 2 * (h[i-1] + h[i]);
|
||||
|
||||
c[n-1] = 0;
|
||||
for( i = 0; i < n-1; ++i )
|
||||
for( i = 0; i < (int)n-1; ++i )
|
||||
c[i] = h[i];
|
||||
|
||||
d[0] = 6 * (f[1]-f[0])/h[0] - 6 * v0;
|
||||
d[n-1] = 6 * vlast - 6 * (f[n-1]-f[n-2]/h[n-2]);
|
||||
for( i = 1; i < n-1; ++i )
|
||||
for( i = 1; i < (int)n-1; ++i )
|
||||
d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]);
|
||||
|
||||
Tridiagonal_Solve( &(a[0]), &(b[0]), &(c[0]), &(d[0]), &(v[0]), n );
|
||||
|
||||
for( i = 1; i < n; ++i ){
|
||||
for( i = 1; i < (int)n; ++i ){
|
||||
coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]);
|
||||
coef[i-1].c = v[i]/2;
|
||||
coef[i-1].b = (f[i]-f[i-1])/h[i-1] + h[i-1]*(2*v[i] + v[i-1])/6;
|
||||
|
|
Loading…
Reference in New Issue