diff --git a/srsenb/src/metrics_stdout.cc b/srsenb/src/metrics_stdout.cc index e2c8bb0c0..70dbeca81 100644 --- a/srsenb/src/metrics_stdout.cc +++ b/srsenb/src/metrics_stdout.cc @@ -144,7 +144,7 @@ std::string metrics_stdout::float_to_string(float f, int digits) { std::ostringstream os; int precision; - if(isnan(f) or abs(f) < 0.0001) { + if (isnan(f) or fabs(f) < 0.0001) { f = 0.0; precision = digits-1; } diff --git a/srsenb/src/phy/phch_worker.cc b/srsenb/src/phy/phch_worker.cc index 4815f841a..9f24168a3 100644 --- a/srsenb/src/phy/phch_worker.cc +++ b/srsenb/src/phy/phch_worker.cc @@ -1105,7 +1105,7 @@ int phch_worker::read_ce_abs(float *ce_abs) { int g = (sz - 12*phy->cell.nof_prb)/2; for (i = 0; i < 12*phy->cell.nof_prb; i++) { ce_abs[g+i] = 20 * log10(cabs(enb_ul.ce[i])); - if (isinf(ce_abs[g+i])) { + if (std::isinf(ce_abs[g + i])) { ce_abs[g+i] = -80; } } @@ -1119,7 +1119,7 @@ int phch_worker::read_ce_arg(float *ce_arg) { int g = (sz - 12*phy->cell.nof_prb)/2; for (i = 0; i < 12*phy->cell.nof_prb; i++) { ce_arg[g+i] = cargf(enb_ul.ce[i]) * 180.0f / (float) M_PI; - if (isinf(ce_arg[g+i])) { + if (std::isinf(ce_arg[g + i])) { ce_arg[g+i] = -80; } } diff --git a/srsue/hdr/upper/rrc.h b/srsue/hdr/upper/rrc.h index 9323b9daa..2da662339 100644 --- a/srsue/hdr/upper/rrc.h +++ b/srsue/hdr/upper/rrc.h @@ -69,7 +69,7 @@ class cell_t } // NaN means an RSRP value has not yet been obtained. Keep then in the list and clean them if never updated bool greater(cell_t *x) { - return rsrp > x->rsrp || isnan(rsrp); + return rsrp > x->rsrp || std::isnan(rsrp); } bool plmn_equals(asn1::rrc::plmn_id_s plmn_id) { @@ -142,7 +142,7 @@ class cell_t } void set_rsrp(float rsrp) { - if (!isnan(rsrp)) { + if (!std::isnan(rsrp)) { this->rsrp = rsrp; } in_sync = true; diff --git a/srsue/src/metrics_stdout.cc b/srsue/src/metrics_stdout.cc index 6f0cf04a0..aa38390fb 100644 --- a/srsue/src/metrics_stdout.cc +++ b/srsue/src/metrics_stdout.cc @@ -123,8 +123,7 @@ std::string metrics_stdout::float_to_eng_string(float f, int digits) std::string factor; - if ( abs( degree ) < 9 ) - { + if (abs(degree) < 9) { if(degree < 0) factor = prefixes[0][ abs( degree ) ]; else diff --git a/srsue/src/phy/phch_worker.cc b/srsue/src/phy/phch_worker.cc index 31d7a3f02..fb7869bd3 100644 --- a/srsue/src/phy/phch_worker.cc +++ b/srsue/src/phy/phch_worker.cc @@ -1591,7 +1591,7 @@ int phch_worker::read_ce_abs(float *ce_abs, uint32_t tx_antenna, uint32_t rx_ant int g = (sz - 12*cell.nof_prb)/2; for (i = 0; i < 12*cell.nof_prb; i++) { ce_abs[g+i] = 20 * log10f(cabsf(ue_dl.ce_m[tx_antenna][rx_antenna][i])); - if (isinf(ce_abs[g+i])) { + if (std::isinf(ce_abs[g + i])) { ce_abs[g+i] = -80; } }