fix compilation for gcc 4.x

master
Andre Puschmann 6 years ago
parent 7fd8ca82c6
commit 3702a6660e

@ -144,7 +144,7 @@ std::string metrics_stdout::float_to_string(float f, int digits)
{ {
std::ostringstream os; std::ostringstream os;
int precision; int precision;
if(isnan(f) or abs(f) < 0.0001) { if (isnan(f) or fabs(f) < 0.0001) {
f = 0.0; f = 0.0;
precision = digits-1; precision = digits-1;
} }

@ -1105,7 +1105,7 @@ int phch_worker::read_ce_abs(float *ce_abs) {
int g = (sz - 12*phy->cell.nof_prb)/2; int g = (sz - 12*phy->cell.nof_prb)/2;
for (i = 0; i < 12*phy->cell.nof_prb; i++) { for (i = 0; i < 12*phy->cell.nof_prb; i++) {
ce_abs[g+i] = 20 * log10(cabs(enb_ul.ce[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; 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; int g = (sz - 12*phy->cell.nof_prb)/2;
for (i = 0; i < 12*phy->cell.nof_prb; i++) { for (i = 0; i < 12*phy->cell.nof_prb; i++) {
ce_arg[g+i] = cargf(enb_ul.ce[i]) * 180.0f / (float) M_PI; 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; ce_arg[g+i] = -80;
} }
} }

@ -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 // 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) { 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) bool plmn_equals(asn1::rrc::plmn_id_s plmn_id)
{ {
@ -142,7 +142,7 @@ class cell_t
} }
void set_rsrp(float rsrp) { void set_rsrp(float rsrp) {
if (!isnan(rsrp)) { if (!std::isnan(rsrp)) {
this->rsrp = rsrp; this->rsrp = rsrp;
} }
in_sync = true; in_sync = true;

@ -123,8 +123,7 @@ std::string metrics_stdout::float_to_eng_string(float f, int digits)
std::string factor; std::string factor;
if ( abs( degree ) < 9 ) if (abs(degree) < 9) {
{
if(degree < 0) if(degree < 0)
factor = prefixes[0][ abs( degree ) ]; factor = prefixes[0][ abs( degree ) ];
else else

@ -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; int g = (sz - 12*cell.nof_prb)/2;
for (i = 0; i < 12*cell.nof_prb; i++) { 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])); 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; ce_abs[g+i] = -80;
} }
} }

Loading…
Cancel
Save