Skip to content

Commit

Permalink
dissector: Don't re-initialize packet_types array
Browse files Browse the repository at this point in the history
Both sparse and clang warn about the initializers overriding previous
initialization of the packet_types array. Since every access of the
packet_types array checks the value for NULL (the default value, since the
array is static) and prints a "?" if it isNULL, we don't need the prior
initialization with "?".

Signed-off-by: Tobias Klauser <[email protected]>
  • Loading branch information
tklauser committed Sep 9, 2014
1 parent e0a7ae8 commit dd8ce9f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion dissector.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
extern char *if_indextoname(unsigned ifindex, char *ifname);

static const char * const packet_types[256] = {
[0 ... 255] = "?", /* Unknown */
[PACKET_HOST] = "<", /* Incoming */
[PACKET_BROADCAST] = "B", /* Broadcast */
[PACKET_MULTICAST] = "M", /* Multicast */
Expand Down

0 comments on commit dd8ce9f

Please sign in to comment.