Replace a string with a const char * in the rlc to_string.

This commit is contained in:
faluco 2021-04-21 12:06:32 +02:00 committed by faluco
parent 289559af82
commit 0afd59a5a0
5 changed files with 6 additions and 8 deletions

View File

@ -22,7 +22,7 @@
namespace srsran {
enum class rlc_mode_t { tm, um, am, nulltype };
inline std::string to_string(const rlc_mode_t& mode, bool long_txt = true)
inline const char* to_string(const rlc_mode_t& mode, bool long_txt = true)
{
constexpr static const char* long_options[] = {"Transparent Mode", "Unacknowledged Mode", "Acknowledged Mode"};
constexpr static const char* short_options[] = {"TM", "UM", "AM"};

View File

@ -462,8 +462,7 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg)
goto delete_and_exit;
}
logger.info(
"Added %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode).c_str());
logger.info("Added %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode));
rlc_entity = NULL;
}
@ -475,8 +474,7 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg)
}
}
logger.info(
"Configured %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode).c_str());
logger.info("Configured %s radio bearer with LCID %d in %s", to_string(cnfg.rat), lcid, to_string(cnfg.rlc_mode));
delete_and_exit:
if (rlc_entity) {

View File

@ -152,7 +152,7 @@ int rlc_tm::read_pdu(uint8_t* payload, uint32_t nof_bytes)
pdu_size,
"%s Tx %s PDU, queue size=%d, bytes=%d",
rrc->get_rb_name(lcid),
srsran::to_string(rlc_mode_t::tm).c_str(),
srsran::to_string(rlc_mode_t::tm),
ul_queue.size(),
ul_queue.size_bytes());

View File

@ -52,7 +52,7 @@ bool rlc_um_lte::configure(const rlc_config_t& cnfg_)
logger.info("%s configured in %s: t_reordering=%d ms, rx_sn_field_length=%u bits, tx_sn_field_length=%u bits",
rb_name.c_str(),
srsran::to_string(cnfg_.rlc_mode).c_str(),
srsran::to_string(cnfg_.rlc_mode),
cfg.um.t_reordering,
srsran::to_number(cfg.um.rx_sn_field_length),
srsran::to_number(cfg.um.tx_sn_field_length));

View File

@ -51,7 +51,7 @@ bool rlc_um_nr::configure(const rlc_config_t& cnfg_)
logger.info("%s configured in %s: sn_field_length=%u bits",
rb_name.c_str(),
srsran::to_string(cnfg_.rlc_mode).c_str(),
srsran::to_string(cnfg_.rlc_mode),
srsran::to_number(cfg.um_nr.sn_field_length));
rx_enabled = true;