Skip to content

Commit

Permalink
Modified SetRoundingMode to SetRoundingModeToNearest.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrykos committed Nov 8, 2024
1 parent 9ffe667 commit 7483d6b
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/common/pa_converters.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static const double const_1_div_2147483648_ = 1.0 / 2147483648.0; /* 32 bit mult

/* -------------------------------------------------------------------------- */

static int SetRoundingMode()
static int SetRoundingModeToNearest()
{
int prev = fegetround();

Expand All @@ -357,7 +357,7 @@ static void Float32_To_Int32(
{
float *src = (float*)sourceBuffer;
PaInt32 *dest = (PaInt32*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -383,7 +383,7 @@ static void Float32_To_Int32_Dither(
{
float *src = (float*)sourceBuffer;
PaInt32 *dest = (PaInt32*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

while( count-- )
{
Expand All @@ -409,7 +409,7 @@ static void Float32_To_Int32_Clip(
{
float *src = (float*)sourceBuffer;
PaInt32 *dest = (PaInt32*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -436,7 +436,7 @@ static void Float32_To_Int32_DitherClip(
{
float *src = (float*)sourceBuffer;
PaInt32 *dest = (PaInt32*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

while( count-- )
{
Expand All @@ -463,7 +463,7 @@ static void Float32_To_Int24(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();
PaInt32 temp;

(void)ditherGenerator; /* unused parameter */
Expand Down Expand Up @@ -500,7 +500,7 @@ static void Float32_To_Int24_Dither(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();
PaInt32 temp;

while( count-- )
Expand Down Expand Up @@ -539,7 +539,7 @@ static void Float32_To_Int24_Clip(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();
PaInt32 temp;

(void)ditherGenerator; /* unused parameter */
Expand Down Expand Up @@ -577,7 +577,7 @@ static void Float32_To_Int24_DitherClip(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();
PaInt32 temp;

while( count-- )
Expand Down Expand Up @@ -617,7 +617,7 @@ static void Float32_To_Int16(
{
float *src = (float*)sourceBuffer;
PaInt16 *dest = (PaInt16*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -642,7 +642,7 @@ static void Float32_To_Int16_Dither(
{
float *src = (float*)sourceBuffer;
PaInt16 *dest = (PaInt16*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

while( count-- )
{
Expand All @@ -669,7 +669,7 @@ static void Float32_To_Int16_Clip(
{
float *src = (float*)sourceBuffer;
PaInt16 *dest = (PaInt16*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -695,7 +695,7 @@ static void Float32_To_Int16_DitherClip(
{
float *src = (float*)sourceBuffer;
PaInt16 *dest = (PaInt16*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand Down Expand Up @@ -725,7 +725,7 @@ static void Float32_To_Int8(
{
float *src = (float*)sourceBuffer;
signed char *dest = (signed char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -750,7 +750,7 @@ static void Float32_To_Int8_Dither(
{
float *src = (float*)sourceBuffer;
signed char *dest = (signed char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

while( count-- )
{
Expand All @@ -775,7 +775,7 @@ static void Float32_To_Int8_Clip(
{
float *src = (float*)sourceBuffer;
signed char *dest = (signed char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -802,7 +802,7 @@ static void Float32_To_Int8_DitherClip(
{
float *src = (float*)sourceBuffer;
signed char *dest = (signed char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand Down Expand Up @@ -831,7 +831,7 @@ static void Float32_To_UInt8(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -856,7 +856,7 @@ static void Float32_To_UInt8_Dither(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

while( count-- )
{
Expand All @@ -882,7 +882,7 @@ static void Float32_To_UInt8_Clip(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand All @@ -908,7 +908,7 @@ static void Float32_To_UInt8_DitherClip(
{
float *src = (float*)sourceBuffer;
unsigned char *dest = (unsigned char*)destinationBuffer;
int prevMode = SetRoundingMode();
int prevMode = SetRoundingModeToNearest();

(void)ditherGenerator; /* unused parameter */

Expand Down

0 comments on commit 7483d6b

Please sign in to comment.