🔧 build(compile Werror): reduce warning

This commit is contained in:
yangwei
2024-08-07 11:34:52 +08:00
committed by luwenpeng
parent 0c6b441157
commit 526171618f
28 changed files with 41 additions and 24 deletions

View File

@@ -152,7 +152,7 @@ static void calculate_length_and_checksum(const struct packet *origin_pkt, int l
struct gre1_hdr *gre1 = NULL;
struct raw_layer *curr_layer = NULL;
struct raw_layer *last_layer = NULL;
struct fingerprint finger = {0};
struct fingerprint finger = {};
calc_packet_fingerprint(&finger);
for (int i = layer_count - 1; i >= 0; i--)
{

View File

@@ -37,7 +37,7 @@ int packet_dump_pcap(const struct packet *pkt, const char *file)
const char *data = packet_get_raw_data(pkt);
uint16_t len = packet_get_raw_len(pkt);
struct pcap_pkt_hdr pkt_hdr = {0};
struct pcap_pkt_hdr pkt_hdr = {};
struct pcap_file_hdr file_hdr = {
.magic = 0xA1B2C3D4,
.version_major = 0x0002,
@@ -60,7 +60,7 @@ int packet_dump_pcap(const struct packet *pkt, const char *file)
return -1;
}
struct timeval ts = {0};
struct timeval ts = {};
gettimeofday(&ts, NULL);
pkt_hdr.tv_sec = ts.tv_sec;