Fixed conversion warnings in bitbuf
This commit is contained in:
parent
f5878e872b
commit
3c2dc07c82
8
external/sourcesdk/bitbuf.cpp
vendored
8
external/sourcesdk/bitbuf.cpp
vendored
|
@ -951,7 +951,7 @@ float bf_read::ReadBitAngle( int numbits )
|
|||
shift = (float)( BitForBitnum(numbits) );
|
||||
|
||||
i = ReadUBitLong( numbits );
|
||||
fReturn = (float)i * (360.0 / shift);
|
||||
fReturn = static_cast<float>(i * (360.0 / shift));
|
||||
|
||||
return fReturn;
|
||||
}
|
||||
|
@ -1110,7 +1110,7 @@ float bf_read::ReadBitCoord (void)
|
|||
}
|
||||
|
||||
// Calculate the correct floating point value
|
||||
value = intval + ((float)fractval * COORD_RESOLUTION);
|
||||
value = intval + static_cast<float>((float)fractval * COORD_RESOLUTION);
|
||||
|
||||
// Fixup the sign if negative.
|
||||
if ( signbit )
|
||||
|
@ -1141,7 +1141,7 @@ float bf_read::ReadBitCoordMP( bool bIntegral, bool bLowPrecision )
|
|||
unsigned int bits = ReadUBitLong( (flags & INBOUNDS) ? COORD_INTEGER_BITS_MP+1 : COORD_INTEGER_BITS+1 );
|
||||
// Remap from [0,N] to [1,N+1]
|
||||
int intval = (bits >> 1) + 1;
|
||||
return (bits & 1) ? -intval : intval;
|
||||
return static_cast<float>((bits & 1) ? -intval : intval);
|
||||
}
|
||||
return 0.f;
|
||||
}
|
||||
|
@ -1294,7 +1294,7 @@ float bf_read::ReadBitNormal (void)
|
|||
unsigned int fractval = ReadUBitLong( NORMAL_FRACTIONAL_BITS );
|
||||
|
||||
// Calculate the correct floating point value
|
||||
float value = (float)fractval * NORMAL_RESOLUTION;
|
||||
float value = static_cast<float>((float)fractval * NORMAL_RESOLUTION);
|
||||
|
||||
// Fixup the sign if negative.
|
||||
if ( signbit )
|
||||
|
|
Loading…
Reference in New Issue
Block a user