Fixed conversion warnings in bitbuf

This commit is contained in:
Jordan Cristiano 2015-05-15 17:43:20 -04:00
parent f5878e872b
commit 3c2dc07c82
1 changed files with 4 additions and 4 deletions

View File

@ -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 )