mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
components: correct abs() use for unsigned argument
This commit is contained in:
parent
56914d3c81
commit
7a066b7b56
@ -292,7 +292,7 @@ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
@ -306,7 +306,7 @@ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
@ -307,7 +307,7 @@ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ static inline void i2s_ll_tx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
@ -309,7 +309,7 @@ static inline void i2s_ll_rx_set_mclk(i2s_dev_t *hw, uint32_t sclk, uint32_t mcl
|
||||
int denominator = 1;
|
||||
int numerator = 0;
|
||||
|
||||
uint32_t freq_diff = abs(sclk - mclk * mclk_div);
|
||||
uint32_t freq_diff = abs((int)sclk - (int)(mclk * mclk_div));
|
||||
if (!freq_diff) {
|
||||
goto finish;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user