more fixes for cppcheck, soon all the easiest ones completed (invalid printf format...)

This commit is contained in:
frtabu
2019-02-12 10:12:07 +01:00
parent 38bae9cc0e
commit 299f627d8a
16 changed files with 149 additions and 123 deletions
+6 -4
View File
@@ -166,7 +166,8 @@ int input_text(char *file,char *sdu)
printf("byte %d: %x (%s%s)\n",b_ind,byte,binary_table[byte>>4],binary_table[byte&0xf]);
b_ind++;
}
if (fd)
fclose(fd);
return(b_ind);
}
@@ -220,14 +221,14 @@ int parse_args(int argc, char** argv, args_t* args)
case 'I':
strcpy(args->input1_file,optarg);
args->input1_sdu_len = input_text(args->input1_file,args->input1_sdu);
printf("Got sdu1 of length %d bytes\n",args->input1_sdu_len);
printf("Got sdu1 of length %u bytes\n",args->input1_sdu_len);
args->input1_sdu_flag=1;
break;
case 'J':
strcpy(args->input2_file,optarg);
args->input2_sdu_len = input_text(args->input2_file,args->input2_sdu);
printf("Got sdu2 of length %d bytes\n",args->input2_sdu_len);
printf("Got sdu2 of length %u bytes\n",args->input2_sdu_len);
args->input2_sdu_flag=1;
break;
@@ -530,7 +531,8 @@ int main (int argc, char **argv)
if (args.input_sib == 0) {
openair_rrc_lite_eNB_init(0);
} else {
printf("Got SI from files (%d,%d,%d,%d,%d)\n",args.input_sib,args.input1_sdu_flag,args.input2_sdu_flag);
printf("Got SI from files (%d,%d,%d)\n",
args.input_sib,args.input1_sdu_flag,args.input2_sdu_flag);
}
openair_rrc_on(0,0);
+1 -1
View File
@@ -249,7 +249,7 @@ BOOL test_pdcp_data_req(void)
* information if we pass mem_block_ts via a linked list?
*/
if (pdcp_test_pdu_buffer_size == 0 || pdcp_test_pdu_buffer == NULL) {
if (pdcp_test_pdu_buffer_size == 0 ) {
msg("[TEST] PDU created by pdcp_data_req() is invalid!\n");
return FALSE;
}
+1 -1
View File
@@ -125,7 +125,7 @@ void pdcp_rlc_test_mac_rlc_loop (struct mac_data_ind *data_indP, struct mac_dat
if (tb_src != NULL) {
tb_size = ((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits >> 3;
printf("[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %d sizeof (mac_rlc_max_rx_header_size_t) %d\n",
printf("[RLC-LOOP] FOUND TB SIZE IN BITS %d IN BYTES %u sizeof (mac_rlc_max_rx_header_size_t) %d\n",
((struct mac_tb_req *) (tb_src->data))->tb_size_in_bits,
tb_size, sizeof (mac_rlc_max_rx_header_size_t));