Raise C++ version to 14 and fix ill-formed code that is considered by this new standard.

master
faluco 3 years ago committed by Francisco Paisana
parent 59b3635acf
commit 1ec8e8a94e

@ -370,7 +370,7 @@ macro(ADD_C_COMPILER_FLAG_IF_AVAILABLE flag have)
endmacro(ADD_C_COMPILER_FLAG_IF_AVAILABLE) endmacro(ADD_C_COMPILER_FLAG_IF_AVAILABLE)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-comment -Wno-reorder -Wno-unused-variable -Wtype-limits -std=c++11 -fno-strict-aliasing") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-comment -Wno-reorder -Wno-unused-variable -Wtype-limits -std=c++14 -fno-strict-aliasing")
ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-Wno-unused-but-set-variable" HAVE_WNO_UNUSED_BUT_SET_VARIABLE) ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-Wno-unused-but-set-variable" HAVE_WNO_UNUSED_BUT_SET_VARIABLE)

@ -286,7 +286,8 @@ public:
using iterator = T*; using iterator = T*;
using const_iterator = const T*; using const_iterator = const T*;
explicit bounded_array(uint32_t size_ = 0) : data_(), current_size(size_) {} bounded_array() : data_(), current_size(0) {}
explicit bounded_array(uint32_t size_) : data_(), current_size(size_) {}
static uint32_t capacity() { return MAX_N; } static uint32_t capacity() { return MAX_N; }
uint32_t size() const { return current_size; } uint32_t size() const { return current_size; }
T& operator[](uint32_t idx) { return data_[idx]; } T& operator[](uint32_t idx) { return data_[idx]; }
@ -858,7 +859,8 @@ public:
static const uint32_t lb = LB, ub = UB; static const uint32_t lb = LB, ub = UB;
static const bool has_ext = ext, is_aligned = aligned; static const bool has_ext = ext, is_aligned = aligned;
explicit bitstring(uint32_t siz_ = lb) { resize(siz_); } bitstring() { resize(lb); }
explicit bitstring(uint32_t siz_) { resize(siz_); }
explicit bitstring(const std::string& s) explicit bitstring(const std::string& s)
{ {
resize(s.size()); resize(s.size());

@ -634,7 +634,7 @@ void cc_worker::ue::metrics_read(phy_metrics_t* metrics_)
if (metrics_) { if (metrics_) {
*metrics_ = metrics; *metrics_ = metrics;
} }
bzero(&metrics, sizeof(phy_metrics_t)); metrics = {};
} }
void cc_worker::ue::metrics_dl(uint32_t mcs) void cc_worker::ue::metrics_dl(uint32_t mcs)

@ -316,8 +316,7 @@ bool rrc::ue::rrc_mobility::start_ho_preparation(uint32_t target_eci,
capitem.ue_category = 4; capitem.ue_category = 4;
capitem.pdcp_params.max_num_rohc_context_sessions_present = true; capitem.pdcp_params.max_num_rohc_context_sessions_present = true;
capitem.pdcp_params.max_num_rohc_context_sessions = asn1::rrc::pdcp_params_s::max_num_rohc_context_sessions_e_::cs2; capitem.pdcp_params.max_num_rohc_context_sessions = asn1::rrc::pdcp_params_s::max_num_rohc_context_sessions_e_::cs2;
bzero(&capitem.pdcp_params.supported_rohc_profiles, capitem.pdcp_params.supported_rohc_profiles = {};
sizeof(asn1::rrc::rohc_profile_support_list_r15_s)); // TODO: why is it r15?
capitem.phy_layer_params.ue_specific_ref_sigs_supported = false; capitem.phy_layer_params.ue_specific_ref_sigs_supported = false;
capitem.phy_layer_params.ue_tx_ant_sel_supported = false; capitem.phy_layer_params.ue_tx_ant_sel_supported = false;
capitem.rf_params.supported_band_list_eutra.resize(1); capitem.rf_params.supported_band_list_eutra.resize(1);

@ -331,7 +331,7 @@ void ue::start_plot()
bool ue::get_metrics(ue_metrics_t* m) bool ue::get_metrics(ue_metrics_t* m)
{ {
bzero(m, sizeof(ue_metrics_t)); *m = {};
phy->get_metrics(srsran::srsran_rat_t::lte, &m->phy); phy->get_metrics(srsran::srsran_rat_t::lte, &m->phy);
phy->get_metrics(srsran::srsran_rat_t::nr, &m->phy_nr); phy->get_metrics(srsran::srsran_rat_t::nr, &m->phy_nr);
radio->get_metrics(&m->rf); radio->get_metrics(&m->rf);

Loading…
Cancel
Save