Commit 009ecafb authored by Timothy B. Terriberry's avatar Timothy B. Terriberry
Browse files

Fix a couple of MSVC warnings.

parent e0d55f6c
......@@ -38,11 +38,14 @@ typedef opus_int16 op_sample;
typedef float op_sample;
# endif
/*Disable excessive warnings about the order of operations.*/
# if OP_GNUC_PREREQ(4,2)
/*Disable excessive warnings about the order of operations.*/
# pragma GCC diagnostic ignored "-Wparentheses"
# elif defined(_MSC_VER)
/*Disable excessive warnings about the order of operations.*/
# pragma warning(disable:4554)
/*Disable warnings about "deprecated" POSIX functions.*/
# pragma warning(disable:4996)
# endif
# if OP_GNUC_PREREQ(3,0)
......
......@@ -1627,7 +1627,7 @@ static opus_int32 op_calc_bitrate(opus_int64 _bytes,ogg_int64_t _samples){
ogg_int64_t den;
if(OP_UNLIKELY(_bytes/(0x7FFFFFFFF/(48000*8))>=_samples))return 0x7FFFFFFF;
den=_samples/(48000*8);
return (_bytes+(den>>1))/den;
return (opus_int32)((_bytes+(den>>1))/den);
}
if(OP_UNLIKELY(_samples<=0))return 0x7FFFFFFF;
/*This can't actually overflow in normal operation: even with a pre-skip of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment