From ed2f7c98e8d441cfc64d4f61e77e96f854ec98b0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 6 Mar 2013 10:32:40 +0100 Subject: [PATCH] pcap_io: Remove duplicate const Arrays are "const pointers" anyway. This fixes a smatch warning. Make the members of struct pcap_magic_type const as these don't need to be modified. Signed-off-by: Tobias Klauser --- pcap_io.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pcap_io.h b/pcap_io.h index b2e6f03..0784195 100644 --- a/pcap_io.h +++ b/pcap_io.h @@ -415,12 +415,12 @@ static inline void pcap_pkthdr_to_tpacket_hdr(pcap_pkthdr_t *phdr, #define FEATURE_PKTTYPE (1 << 7) struct pcap_magic_type { - uint32_t magic; - char *desc; - uint16_t features; + const uint32_t magic; + const char *desc; + const uint16_t features; }; -static const struct pcap_magic_type const pcap_magic_types[] __maybe_unused = { +static const struct pcap_magic_type pcap_magic_types[] __maybe_unused = { { .magic = ORIGINAL_TCPDUMP_MAGIC, .desc = "tcpdump-capable pcap", @@ -496,7 +496,7 @@ static const char *pcap_ops_group_to_str[] __maybe_unused = { [PCAP_OPS_MM] = "mm", }; -static const struct pcap_file_ops const *pcap_ops[] __maybe_unused = { +static const struct pcap_file_ops *pcap_ops[] __maybe_unused = { [PCAP_OPS_RW] = &pcap_rw_ops, [PCAP_OPS_SG] = &pcap_sg_ops, [PCAP_OPS_MM] = &pcap_mm_ops, -- 2.11.4.GIT