Skip to content

Commit dcbcfb3

Browse files
authored
mac: region: RegionCommon: fix implicit double promotion (#1600)
The calculation is done with float variables. However, the floor function is meant for double variables. floorf should be used instead. The implicit double promotion leads to a warning/error if compiled with LLVM. Signed-off-by: Martin Jäger <[email protected]>
1 parent 99c2e53 commit dcbcfb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mac/region/RegionCommon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ int8_t RegionCommonComputeTxPower( int8_t txPowerIndex, float maxEirp, float ant
463463
{
464464
int8_t phyTxPower = 0;
465465

466-
phyTxPower = ( int8_t )floor( ( maxEirp - ( txPowerIndex * 2U ) ) - antennaGain );
466+
phyTxPower = ( int8_t )floorf( ( maxEirp - ( txPowerIndex * 2U ) ) - antennaGain );
467467

468468
return phyTxPower;
469469
}

0 commit comments

Comments
 (0)