another batch of cppcheck error corrections

This commit is contained in:
yilmazt
2019-09-24 11:59:17 +02:00
parent 47825cbc6a
commit 84af6103f8
20 changed files with 303 additions and 282 deletions
+10 -13
View File
@@ -224,9 +224,9 @@ int size_dist(
return size_data;
}
int adjust_size(int size)
{
if (size<PAYLOAD_MIN) {
LOG_W(OTG,"Packet Size=%d out of range, size=%d \n", size, PAYLOAD_MIN);
size=PAYLOAD_MIN;
@@ -239,9 +239,6 @@ int adjust_size(int size)
}
unsigned char *packet_gen(
const int src_instance,
const int dst_instance,
@@ -391,22 +388,20 @@ unsigned char *packet_gen(
}
unsigned char *packet_gen_multicast(
const int src_instance,
const int dst_instance,
const int ctime,
unsigned int * const pkt_size)
{
*pkt_size =0;
unsigned int size=0;
unsigned int buffer_size =0;
*pkt_size = 0;
unsigned int size = 0;
unsigned int buffer_size = 0;
char *payload=NULL;
char *header=NULL;
unsigned int flag;
int app,seq_num=0;
int otg_hdr_size= sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t);
unsigned int flag = 0;
int app, seq_num = 0;
int otg_hdr_size = sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t);
set_ctime(ctime); // fixme: this should be done separetly from packet_gen and packet_gen_multicast
@@ -488,7 +483,9 @@ unsigned char *packet_gen_multicast(
payload,
buffer_size,
0/*g_otg_multicast->application_type[src_instance][dst][app]*/,
flag, 0, ctime,
flag,
0,
ctime,
seq_num,
0,
HDR_IP_v4_MIN+HDR_UDP,