all: bunch of pass by const& changes suggested by LGTM

master
Andre Puschmann 4 years ago
parent 7ced0e73eb
commit 598594c51a

@ -28,8 +28,8 @@ public:
virtual void add_bearer(uint32_t lcid, srsran::pdcp_config_t cnfg) = 0;
virtual void del_bearer(uint32_t lcid) = 0;
virtual void change_lcid(uint32_t old_lcid, uint32_t new_lcid) = 0;
virtual void config_security(uint32_t lcid, srsran::as_security_config_t sec_cfg) = 0;
virtual void config_security_all(srsran::as_security_config_t sec_cfg) = 0;
virtual void config_security(uint32_t lcid, const srsran::as_security_config_t& sec_cfg) = 0;
virtual void config_security_all(const srsran::as_security_config_t& sec_cfg) = 0;
virtual void enable_integrity(uint32_t lcid, srsran::srsran_direction_t direction) = 0;
virtual void enable_encryption(uint32_t lcid,
srsran::srsran_direction_t direction = srsran::srsran_direction_t::DIRECTION_TXRX) = 0;

@ -141,7 +141,7 @@ public:
class phy_interface_rrc_lte
{
public:
virtual bool set_config(srsran::phy_cfg_t config, uint32_t cc_idx = 0) = 0;
virtual bool set_config(const srsran::phy_cfg_t& config, uint32_t cc_idx = 0) = 0;
virtual bool set_scell(srsran_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn) = 0;
virtual void set_config_tdd(srsran_tdd_config_t& tdd_config) = 0;
virtual void set_config_mbsfn_sib2(srsran::mbsfn_sf_cfg_t* cfg_list, uint32_t nof_cfgs) = 0;

@ -60,7 +60,7 @@ public:
class phy_dummy_interface : public phy_interface_rrc_lte
{
bool set_config(srsran::phy_cfg_t config, uint32_t cc_idx) override { return true; }
bool set_config(const srsran::phy_cfg_t& config, uint32_t cc_idx) override { return true; }
bool set_scell(srsran_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn) override { return true; }
void set_config_tdd(srsran_tdd_config_t& tdd_config) override {}
void set_config_mbsfn_sib2(srsran::mbsfn_sf_cfg_t* cfg_list, uint32_t nof_cfgs) override {}

@ -46,8 +46,8 @@ public:
void add_bearer_mrb(uint32_t lcid, pdcp_config_t cnfg);
void del_bearer(uint32_t lcid) override;
void change_lcid(uint32_t old_lcid, uint32_t new_lcid) override;
void config_security(uint32_t lcid, as_security_config_t sec_cfg) override;
void config_security_all(as_security_config_t sec_cfg) override;
void config_security(uint32_t lcid, const as_security_config_t& sec_cfg) override;
void config_security_all(const as_security_config_t& sec_cfg) override;
void enable_integrity(uint32_t lcid, srsran_direction_t direction) override;
void enable_encryption(uint32_t lcid, srsran_direction_t direction) override;
void enable_security_timed(uint32_t lcid, srsran_direction_t direction, uint32_t sn);

@ -178,7 +178,7 @@ const char* gtpc_msg_type_to_str(uint8_t type)
return "GTPC_MSG_TYPE_INVALID";
}
int gtpc_pack_create_session_request(struct gtpc_create_session_request* cs_req, srsran::byte_buffer_t)
int gtpc_pack_create_session_request(struct gtpc_create_session_request* cs_req, srsran::byte_buffer_t&)
{
// TODO
return 0;

@ -194,14 +194,14 @@ void pdcp::change_lcid(uint32_t old_lcid, uint32_t new_lcid)
}
}
void pdcp::config_security(uint32_t lcid, as_security_config_t sec_cfg)
void pdcp::config_security(uint32_t lcid, const as_security_config_t& sec_cfg)
{
if (valid_lcid(lcid)) {
pdcp_array.at(lcid)->config_security(sec_cfg);
}
}
void pdcp::config_security_all(as_security_config_t sec_cfg)
void pdcp::config_security_all(const as_security_config_t& sec_cfg)
{
for (auto& it : pdcp_array) {
it.second->config_security(sec_cfg);

@ -61,7 +61,7 @@ public:
s1ap(srsran::task_sched_handle task_sched_,
srslog::basic_logger& logger,
srsran::socket_manager_itf* rx_socket_handler);
int init(s1ap_args_t args_, rrc_interface_s1ap* rrc_);
int init(const s1ap_args_t& args_, rrc_interface_s1ap* rrc_);
void stop();
void get_metrics(s1ap_metrics_t& m);

@ -289,7 +289,7 @@ s1ap::s1ap(srsran::task_sched_handle task_sched_,
mme_task_queue = task_sched.make_task_queue();
}
int s1ap::init(s1ap_args_t args_, rrc_interface_s1ap* rrc_)
int s1ap::init(const s1ap_args_t& args_, rrc_interface_s1ap* rrc_)
{
rrc = rrc_;
args = args_;

@ -50,7 +50,7 @@ public:
static void cleanup();
int enb_listen();
int init(s1ap_args_t s1ap_args);
int init(const s1ap_args_t& s1ap_args);
void stop();
int get_s1_mme();

@ -35,7 +35,7 @@ public:
// Packing/unpacking helper functions
bool unpack_s1_setup_request(const asn1::s1ap::s1_setup_request_s& msg, enb_ctx_t* enb_ctx);
bool send_s1_setup_failure(asn1::s1ap::cause_misc_opts::options cause, struct sctp_sndrcvinfo* enb_sri);
bool send_s1_setup_response(s1ap_args_t s1ap_args, struct sctp_sndrcvinfo* enb_sri);
bool send_s1_setup_response(const s1ap_args_t& s1ap_args, struct sctp_sndrcvinfo* enb_sri);
private:
s1ap_mngmt_proc();

@ -49,7 +49,7 @@ void s1ap::cleanup(void)
pthread_mutex_unlock(&s1ap_instance_mutex);
}
int s1ap::init(s1ap_args_t s1ap_args)
int s1ap::init(const s1ap_args_t& s1ap_args)
{
m_s1ap_args = s1ap_args;
srsran::s1ap_mccmnc_to_plmn(s1ap_args.mcc, s1ap_args.mnc, &m_plmn);

@ -182,7 +182,7 @@ bool s1ap_mngmt_proc::send_s1_setup_failure(asn1::s1ap::cause_misc_opts::options
return true;
}
bool s1ap_mngmt_proc::send_s1_setup_response(s1ap_args_t s1ap_args, struct sctp_sndrcvinfo* enb_sri)
bool s1ap_mngmt_proc::send_s1_setup_response(const s1ap_args_t& s1ap_args, struct sctp_sndrcvinfo* enb_sri)
{
m_logger.debug("Sending S1 Setup Response");

@ -107,7 +107,7 @@ public:
// Sets the new PHY configuration for the given CC. The configuration is applied in the background. The notify()
// function will be called when the reconfiguration is completed. Unless the PRACH configuration has changed, the
// reconfiguration will not take more than 3 ms
bool set_config(srsran::phy_cfg_t config, uint32_t cc_idx) final;
bool set_config(const srsran::phy_cfg_t& config, uint32_t cc_idx) final;
// Adds or modifies the cell configuration for a given CC. If the EARFCN has changed w.r.t. the previous value, or if
// the cell is new, this function might take a few hundred ms to complete, depending on the radio

@ -165,12 +165,12 @@ public:
*/
uint32_t get_ul_earfcn(uint32_t dl_earfcn);
void update_measurements(uint32_t cc_idx,
srsran_chest_dl_res_t chest_res,
srsran_dl_sf_cfg_t sf_cfg_dl,
float tx_crs_power,
std::vector<phy_meas_t>& serving_cells,
cf_t* rssi_power_buffer = nullptr);
void update_measurements(uint32_t cc_idx,
const srsran_chest_dl_res_t& chest_res,
srsran_dl_sf_cfg_t sf_cfg_dl,
float tx_crs_power,
std::vector<phy_meas_t>& serving_cells,
cf_t* rssi_power_buffer = nullptr);
void update_cfo_measurement(uint32_t cc_idx, float cfo_hz);

@ -429,7 +429,7 @@ void phy::enable_pregen_signals(bool enable)
}
}
bool phy::set_config(srsran::phy_cfg_t config_, uint32_t cc_idx)
bool phy::set_config(const srsran::phy_cfg_t& config_, uint32_t cc_idx)
{
if (!is_initiated()) {
fprintf(stderr, "Error calling set_config(): PHY not initialized\n");

@ -615,12 +615,12 @@ void phy_common::update_cfo_measurement(uint32_t cc_idx, float cfo_hz)
avg_cfo_hz[cc_idx] = SRSRAN_VEC_EMA(cfo_hz, avg_cfo_hz[cc_idx], args->snr_ema_coeff);
}
void phy_common::update_measurements(uint32_t cc_idx,
srsran_chest_dl_res_t chest_res,
srsran_dl_sf_cfg_t sf_cfg_dl,
float tx_crs_power,
std::vector<phy_meas_t>& serving_cells,
cf_t* rssi_power_buffer)
void phy_common::update_measurements(uint32_t cc_idx,
const srsran_chest_dl_res_t& chest_res,
srsran_dl_sf_cfg_t sf_cfg_dl,
float tx_crs_power,
std::vector<phy_meas_t>& serving_cells,
cf_t* rssi_power_buffer)
{
bool insync = true;
{

@ -58,7 +58,7 @@ public:
void enable_pregen_signals(bool enable) override;
void deactivate_scells() override;
void set_activation_deactivation_scell(uint32_t cmd, uint32_t tti) override;
bool set_config(srsran::phy_cfg_t config, uint32_t cc_idx = 0) override;
bool set_config(const srsran::phy_cfg_t& config, uint32_t cc_idx = 0) override;
bool set_scell(srsran_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn) override;
void set_config_tdd(srsran_tdd_config_t& tdd_config) override;
void set_config_mbsfn_sib2(srsran::mbsfn_sf_cfg_t* cfg_list, uint32_t nof_cfgs) override{};

@ -76,7 +76,7 @@ void lte_ttcn3_phy::set_activation_deactivation_scell(uint32_t cmd, uint32_t tti
logger.debug("%s not implemented.", __FUNCTION__);
}
bool lte_ttcn3_phy::set_config(srsran::phy_cfg_t config, uint32_t cc_idx_)
bool lte_ttcn3_phy::set_config(const srsran::phy_cfg_t& config, uint32_t cc_idx_)
{
logger.debug("%s not implemented.", __FUNCTION__);
task_sched.defer_task([this]() { stack->set_config_complete(true); });

@ -34,7 +34,7 @@ public:
}
// Not implemented methods
bool set_config(srsran::phy_cfg_t config, uint32_t cc_idx) override { return true; }
bool set_config(const srsran::phy_cfg_t& config, uint32_t cc_idx) override { return true; }
bool set_scell(srsran_cell_t cell_info, uint32_t cc_idx, uint32_t earfcn) override { return true; }
void set_config_tdd(srsran_tdd_config_t& tdd_config) override {}
void set_config_mbsfn_sib2(srsran::mbsfn_sf_cfg_t* cfg_list, uint32_t nof_cfgs) override {}

Loading…
Cancel
Save