fix some warnings
Removed homebrew round() - now we just use the math library.
This commit is contained in:
@@ -870,7 +870,7 @@ uint randomMT()
|
||||
else next = 0;
|
||||
}
|
||||
uint y = (state[cur] & 0x80000000U) | (state[next] & 0x7FFFFFFFU);
|
||||
state[cur] = y = state[cur < N-M ? cur + M : cur + M-N] ^ (y >> 1) ^ (-(y & 1U) & K);
|
||||
state[cur] = y = state[cur < N-M ? cur + M : cur + M-N] ^ (y >> 1) ^ (-int(y & 1U) & K);
|
||||
y ^= (y >> 11);
|
||||
y ^= (y << 7) & 0x9D2C5680U;
|
||||
y ^= (y << 15) & 0xEFC60000U;
|
||||
|
||||
@@ -506,7 +506,7 @@ void jpegenc::write_comment(BYTE *comment)
|
||||
{
|
||||
WORD i, length;
|
||||
writeword(0xFFFE);
|
||||
length = strlen((const char *)comment);
|
||||
length = (WORD) strlen((const char *)comment);
|
||||
writeword(length + 2);
|
||||
for (i=0; i<length; i++)
|
||||
writebyte(comment[i]);
|
||||
|
||||
@@ -57,8 +57,6 @@ static inline T min(T a, T b)
|
||||
|
||||
template <typename T> inline T pow2(T x) { return x*x; }
|
||||
|
||||
static inline float round(float x) { return floor(x + 0.5f); }
|
||||
|
||||
#define clamp(x,minval,maxval) (max(minval, min(x, maxval)))
|
||||
#define rnd(x) ((int)(randomMT()&0xFFFFFF)%(x))
|
||||
#define rndscale(x) (float((randomMT()&0xFFFFFF)*double(x)/double(0xFFFFFF)))
|
||||
|
||||
@@ -595,7 +595,7 @@ void raydamage(vec &from, vec &to, playerent *d)
|
||||
int dam = d->weaponsel->info.damage;
|
||||
int hitzone = -1;
|
||||
playerent *o = NULL;
|
||||
float dist, hitdist;
|
||||
float dist, hitdist = 0.0f;
|
||||
bool hitted=false;
|
||||
int rayscount = 0, hitscount = 0;
|
||||
if(d->weaponsel->type==GUN_SHOTGUN)
|
||||
|
||||
@@ -195,7 +195,7 @@ void rldecodecubes(ucharbuf &f, sqr *s, int len, int version, bool silent) // ru
|
||||
{
|
||||
case -1:
|
||||
{
|
||||
if(!silent) conoutf("while reading map at %ld: unexpected end of file", cubicsize - (e - s));
|
||||
if(!silent) conoutf("while reading map at %d: unexpected end of file", int(cubicsize - (e - s)));
|
||||
f.forceoverread();
|
||||
silent = true;
|
||||
sqrdefault(s);
|
||||
@@ -231,7 +231,7 @@ void rldecodecubes(ucharbuf &f, sqr *s, int len, int version, bool silent) // ru
|
||||
{
|
||||
if(type<0 || type>=MAXTYPE)
|
||||
{
|
||||
if(!silent) conoutf("while reading map at %ld: type %d out of range", cubicsize - (e - s), type);
|
||||
if(!silent) conoutf("while reading map at %d: type %d out of range", int(cubicsize - (e - s)), type);
|
||||
f.overread();
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void computeraytable(float vx, float vy, float fov)
|
||||
{
|
||||
float dist = (float)(fabs(sx-vx)+fabs(sy-vy));
|
||||
if(firstquarter || dist > rdist[k]) rdist[k] = dist;
|
||||
if(firstquarter) ndist[k] = max(abs(sx-vx), abs(sy-vy));
|
||||
if(firstquarter) ndist[k] = max(abs(int(sx-vx)), abs(int(sy-vy)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user