pcapng.c: Use preprocessor directive to compare G_BYTE_ORDER with G_LITTLE_ENDIAN.
authorMichael Mann <mmann78@netscape.net>
Wed, 13 Jul 2016 23:26:16 +0000 (19:26 -0400)
committerMichael Mann <mmann78@netscape.net>
Thu, 14 Jul 2016 02:45:20 +0000 (02:45 +0000)
VS Code analysis considers them hardcoded values so the if statement is either
always true or always false.

Change-Id: Iabb8462b66f728195bf378ae26c79a783feddb03
Reviewed-on: https://code.wireshark.org/review/16422
Reviewed-by: Michael Mann <mmann78@netscape.net>
wiretap/pcapng.c

index 305a252d4631b24f78f9b8b61eee4e993ae17e23..afb2d72092344a63f2329359fcd32a27b25ca3a0 100644 (file)
@@ -2179,7 +2179,11 @@ pcapng_read_sysdig_event_block(FILE_T fh, pcapng_block_header_t *bh, pcapng_t *p
     /* XXX Use Gxxx_FROM_LE macros instead? */
     if (pn->byte_swapped) {
         wblock->packet_header->pseudo_header.sysdig_event.byte_order =
-                G_BYTE_ORDER == G_LITTLE_ENDIAN ? G_BIG_ENDIAN : G_LITTLE_ENDIAN;
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+            G_BIG_ENDIAN;
+#else
+            G_LITTLE_ENDIAN;
+#endif
         wblock->packet_header->pseudo_header.sysdig_event.cpu_id = GUINT16_SWAP_LE_BE(cpu_id);
         ts = GUINT64_SWAP_LE_BE(wire_ts);
         wblock->packet_header->pseudo_header.sysdig_event.thread_id = GUINT64_SWAP_LE_BE(thread_id);