dissector: explicitly init array
authorDaniel Borkmann <dborkman@redhat.com>
Mon, 17 Jun 2013 21:12:18 +0000 (17 23:12 +0200)
committerDaniel Borkmann <dborkman@redhat.com>
Mon, 17 Jun 2013 21:12:18 +0000 (17 23:12 +0200)
Use explicit form to initialize array.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
dissector.h

index 60bc429..e26c235 100644 (file)
 #define PRINT_HEX_ASCII                4
 #define PRINT_NONE             5
 
-static const char * const packet_types[256]={
-       "<", /* Incoming */
-       "B", /* Broadcast */
-       "M", /* Multicast */
-       "P", /* Promisc */
-       ">", /* Outgoing */
-       "?", /* Unknown */
-};
-
 extern char *if_indextoname(unsigned ifindex, char *ifname);
 
+static const char * const packet_types[256] = {
+       [PACKET_HOST]           =       "<", /* Incoming */
+       [PACKET_BROADCAST]      =       "B", /* Broadcast */
+       [PACKET_MULTICAST]      =       "M", /* Multicast */
+       [PACKET_OTHERHOST]      =       "P", /* Promisc */
+       [PACKET_OUTGOING]       =       ">", /* Outgoing */
+                                       "?", /* Unknown */
+};
+
 static inline const char *__show_ts_source(uint32_t status)
 {
        if (status & TP_STATUS_TS_RAW_HARDWARE)
@@ -58,7 +58,6 @@ static inline void __show_frame_hdr(struct sockaddr_ll *s_ll,
                return;
 
        hdr.raw = raw;
-
        switch (mode) {
        case PRINT_LESS:
                tprintf("%s %s %u",