Commit fbf39eec authored by Laurent THOMAS's avatar Laurent THOMAS

cppcheck fixes

parent fc967bab
...@@ -38,7 +38,7 @@ void display_backtrace(void) { ...@@ -38,7 +38,7 @@ void display_backtrace(void) {
size_t i; size_t i;
char *test=getenv("NO_BACKTRACE"); char *test=getenv("NO_BACKTRACE");
if (test!=0) *((int *)0)=0; if (test!=0) abort();
size = backtrace(array, 10); size = backtrace(array, 10);
strings = backtrace_symbols(array, size); strings = backtrace_symbols(array, size);
......
...@@ -2199,7 +2199,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add ...@@ -2199,7 +2199,7 @@ void configure_nr_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_add
pnf.phys[0].udp.tx_port = vnf_p7_port; pnf.phys[0].udp.tx_port = vnf_p7_port;
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr); strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
strcpy(pnf.phys[0].local_addr, pnf_ip_addr); strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n", printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
__FUNCTION__,config->vnf_ip_addr, config->vnf_p5_port, __FUNCTION__,config->vnf_ip_addr, config->vnf_p5_port,
pnf.phys[0].local_addr, pnf.phys[0].local_addr,
pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port, pnf.phys[0].udp.tx_addr, pnf.phys[0].udp.tx_port,
...@@ -2250,7 +2250,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr, ...@@ -2250,7 +2250,7 @@ void configure_nfapi_pnf(char *vnf_ip_addr, int vnf_p5_port, char *pnf_ip_addr,
pnf.phys[0].udp.tx_port = vnf_p7_port; pnf.phys[0].udp.tx_port = vnf_p7_port;
strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr); strcpy(pnf.phys[0].udp.tx_addr, vnf_ip_addr);
strcpy(pnf.phys[0].local_addr, pnf_ip_addr); strcpy(pnf.phys[0].local_addr, pnf_ip_addr);
printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%d rx:%d]\n", printf("%s() VNF:%s:%d PNF_PHY[addr:%s UDP:tx_addr:%s:%u rx:%u]\n",
__FUNCTION__, __FUNCTION__,
config->vnf_ip_addr, config->vnf_p5_port, config->vnf_ip_addr, config->vnf_p5_port,
pnf.phys[0].local_addr, pnf.phys[0].local_addr,
......
...@@ -59,7 +59,7 @@ void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...) ...@@ -59,7 +59,7 @@ void nfapi_trace_dbg(nfapi_trace_level_t level, const char *format, ...)
if (num_chars > TRACE_HEADER_LENGTH) if (num_chars > TRACE_HEADER_LENGTH)
{ {
printf("trace_dbg: Error, num_chars is too large: %d", num_chars); printf("trace_dbg: Error, num_chars is too large: %u", num_chars);
return; return;
} }
......
...@@ -278,7 +278,7 @@ void *fapi_thread_start(void *ptr) { ...@@ -278,7 +278,7 @@ void *fapi_thread_start(void *ptr) {
if(instance->tick == 1000) { if(instance->tick == 1000) {
if(instance->tx_byte_count > 0) { if(instance->tx_byte_count > 0) {
printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count); printf("[FAPI] Tx rate %u bytes/sec\n", instance->tx_byte_count);
instance->tx_byte_count = 0; instance->tx_byte_count = 0;
} }
...@@ -319,7 +319,7 @@ void *fapi_thread_start(void *ptr) { ...@@ -319,7 +319,7 @@ void *fapi_thread_start(void *ptr) {
millisec = now_ts.tv_nsec / 1e6; millisec = now_ts.tv_nsec / 1e6;
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) { if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec) {
printf("*** missing millisec %d %d\n", last_millisec, millisec); printf("*** missing millisec %u %u\n", last_millisec, millisec);
catchup = millisec - last_millisec - 1; catchup = millisec - last_millisec - 1;
} }
......
...@@ -170,6 +170,7 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -170,6 +170,7 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
Msc_RS = msrsb * 6; Msc_RS = msrsb * 6;
k0 = ( ( (int16_t)(frame_parms->N_RB_UL>>1) - (int16_t)(msrs0>>1) ) * 12 ) + kTC; k0 = ( ( (int16_t)(frame_parms->N_RB_UL>>1) - (int16_t)(msrs0>>1) ) * 12 ) + kTC;
AssertFatal(msrsb,"divide by 0");
nb = (4*n_RRC/msrsb)%Nb; nb = (4*n_RRC/msrsb)%Nb;
for (b=0; b<=Bsrs; b++) { for (b=0; b<=Bsrs; b++) {
......
...@@ -648,18 +648,6 @@ error: ...@@ -648,18 +648,6 @@ error:
* ************************************ * ************************************
*/ */
int sort_ue_config(const void *a, const void *b) {
const Protocol__FlexUeConfig *fa = a;
const Protocol__FlexUeConfig *fb = b;
if (fa->rnti < fb->rnti)
return -1;
else if (fa->rnti < fb->rnti)
return 1;
return 0;
}
int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { int flexran_agent_ue_config_reply(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) {
xid_t xid; xid_t xid;
Protocol__FlexHeader *header = NULL; Protocol__FlexHeader *header = NULL;
......
...@@ -1010,7 +1010,7 @@ int get_format0(uint8_t index, ...@@ -1010,7 +1010,7 @@ int get_format0(uint8_t index,
uint8_t unpaired, uint8_t unpaired,
frequency_range_t frequency_range){ frequency_range_t frequency_range){
uint16_t format; uint16_t format=0;
if (unpaired) { if (unpaired) {
if (frequency_range==FR1) if (frequency_range==FR1)
format = table_6_3_3_2_3_prachConfig_Index[index][0]; format = table_6_3_3_2_3_prachConfig_Index[index][0];
......
...@@ -247,7 +247,6 @@ void schedule_control_sib1(module_id_t module_id, ...@@ -247,7 +247,6 @@ void schedule_control_sib1(module_id_t module_id,
gNB_mac->sched_ctrlCommon->search_space = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->search_space)); gNB_mac->sched_ctrlCommon->search_space = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->search_space));
gNB_mac->sched_ctrlCommon->active_bwp = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->active_bwp)); gNB_mac->sched_ctrlCommon->active_bwp = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->active_bwp));
gNB_mac->sched_ctrlCommon->coreset = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->coreset)); gNB_mac->sched_ctrlCommon->coreset = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->coreset));
gNB_mac->sched_ctrlCommon->active_bwp = calloc(1,sizeof(*gNB_mac->sched_ctrlCommon->active_bwp));
fill_default_searchSpaceZero(gNB_mac->sched_ctrlCommon->search_space); fill_default_searchSpaceZero(gNB_mac->sched_ctrlCommon->search_space);
fill_default_coresetZero(gNB_mac->sched_ctrlCommon->coreset,servingcellconfigcommon); fill_default_coresetZero(gNB_mac->sched_ctrlCommon->coreset,servingcellconfigcommon);
fill_default_initialDownlinkBWP(gNB_mac->sched_ctrlCommon->active_bwp,servingcellconfigcommon); fill_default_initialDownlinkBWP(gNB_mac->sched_ctrlCommon->active_bwp,servingcellconfigcommon);
......
...@@ -654,7 +654,7 @@ int checkTargetSSBInTCIStates_pdcchConfig(int ssb_index_t, int Mod_idP, int UE_i ...@@ -654,7 +654,7 @@ int checkTargetSSBInTCIStates_pdcchConfig(int ssb_index_t, int Mod_idP, int UE_i
//returns the measured RSRP value (upper limit) //returns the measured RSRP value (upper limit)
int get_measured_rsrp(uint8_t index) { int get_measured_rsrp(uint8_t index) {
//if index is invalid returning minimum rsrp -140 //if index is invalid returning minimum rsrp -140
if((index >= 0 && index <= 15) || index >= 114) if(index <= 15 || index >= 114)
return MIN_RSRP_VALUE; return MIN_RSRP_VALUE;
return L1_SSB_CSI_RSRP_measReport_mapping_38133_10_1_6_1_1[index]; return L1_SSB_CSI_RSRP_measReport_mapping_38133_10_1_6_1_1[index];
......
...@@ -869,7 +869,6 @@ static void *ru_thread_asynch_rxtx( void *param ) { ...@@ -869,7 +869,6 @@ static void *ru_thread_asynch_rxtx( void *param ) {
LOG_I(PHY, "devices ok (ru_thread_asynch_rxtx)\n"); LOG_I(PHY, "devices ok (ru_thread_asynch_rxtx)\n");
while (!oai_exit) { while (!oai_exit) {
if (oai_exit) break;
if (ru->state != RU_RUN) { if (ru->state != RU_RUN) {
subframe=0; subframe=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment