fixing most warning when compiling nr-softmodem

This commit is contained in:
francescomani
2023-03-09 19:01:46 +01:00
parent 7975b90d7c
commit 2385bc364a
72 changed files with 913 additions and 933 deletions
+4 -4
View File
@@ -132,7 +132,7 @@ const nr_bandentry_t nr_bandtable[] = {
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
{
const uint64_t dl_freq_khz = downlink_frequency / 1000;
const int64_t dl_freq_khz = downlink_frequency / 1000;
const int32_t delta_duplex_khz = delta_duplex / 1000;
uint64_t center_freq_diff_khz = UINT64_MAX; // 2^64
@@ -148,11 +148,11 @@ uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex)
if (current_offset_khz != delta_duplex_khz)
continue;
uint64_t center_frequency_khz = (nr_bandtable[ind].dl_max + nr_bandtable[ind].dl_min) / 2;
int64_t center_frequency_khz = (nr_bandtable[ind].dl_max + nr_bandtable[ind].dl_min) / 2;
if (abs(dl_freq_khz - center_frequency_khz) < center_freq_diff_khz){
if (labs(dl_freq_khz - center_frequency_khz) < center_freq_diff_khz){
current_band = nr_bandtable[ind].band;
center_freq_diff_khz = abs(dl_freq_khz - center_frequency_khz);
center_freq_diff_khz = labs(dl_freq_khz - center_frequency_khz);
}
}