Skip to content

Commit

Permalink
mac: region: RegionCommon: fix implicit double promotion (#1600)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
martinjaeger authored Feb 6, 2024
1 parent 99c2e53 commit dcbcfb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mac/region/RegionCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ int8_t RegionCommonComputeTxPower( int8_t txPowerIndex, float maxEirp, float ant
{
int8_t phyTxPower = 0;

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

return phyTxPower;
}
Expand Down

0 comments on commit dcbcfb3

Please sign in to comment.