aboutsummaryrefslogtreecommitdiffstats
path: root/text2pcap.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2013-06-18 12:22:40 +0000
committerJörg Mayer <jmayer@loplof.de>2013-06-18 12:22:40 +0000
commit99e1ad5443468134de4062b53e05764a03c713c0 (patch)
tree63c7e55f5d30e9703acf07f58c24f69911cc7ff0 /text2pcap.c
parent701fb00afafd6e835ee92d9fcae374dd21e6403c (diff)
Fix compile error:
[ 79%] Building C object CMakeFiles/text2pcap.dir/text2pcap.c.o In file included from /usr/include/glib-2.0/glib/galloca.h:34:0, from /usr/include/glib-2.0/glib.h:32, from /home/jmayer/work/wireshark/svn/trunk/wsutil/file_util.h:34, from /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:116: /home/jmayer/work/wireshark/svn/trunk/text2pcap.c: In function ‘write_current_packet’: /usr/include/glib-2.0/glib/gtypes.h:186:22: error: declaration of ‘__v’ shadows a previous local [-Werror=shadow] ({ register guint16 __v, __x = ((guint16) (val)); \ ^ /usr/include/glib-2.0/glib/gtypes.h:237:38: note: in expansion of macro ‘GUINT16_SWAP_LE_BE_IA32’ # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) ^ /usr/lib/glib-2.0/include/glibconfig.h:192:29: note: in expansion of macro ‘GUINT16_SWAP_LE_BE’ #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:359:23: note: in expansion of macro ‘GUINT16_TO_BE’ #define g_htons(val) (GUINT16_TO_BE (val)) ^ /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:705:35: note: in expansion of macro ‘g_htons’ pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP)); ^ /usr/include/glib-2.0/glib/gtypes.h:237:38: note: in expansion of macro ‘GUINT16_SWAP_LE_BE_IA32’ # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) ^ /usr/lib/glib-2.0/include/glibconfig.h:192:29: note: in expansion of macro ‘GUINT16_SWAP_LE_BE’ #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:327:31: note: in expansion of macro ‘GUINT16_TO_BE’ #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:357:23: note: in expansion of macro ‘GUINT16_FROM_BE’ #define g_ntohs(val) (GUINT16_FROM_BE (val)) ^ /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:705:52: note: in expansion of macro ‘g_ntohs’ pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP)); ^ /usr/include/glib-2.0/glib/gtypes.h:186:22: error: shadowed declaration is here [-Werror=shadow] ({ register guint16 __v, __x = ((guint16) (val)); \ ^ /usr/include/glib-2.0/glib/gtypes.h:237:38: note: in expansion of macro ‘GUINT16_SWAP_LE_BE_IA32’ # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) ^ /usr/lib/glib-2.0/include/glibconfig.h:192:29: note: in expansion of macro ‘GUINT16_SWAP_LE_BE’ #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:359:23: note: in expansion of macro ‘GUINT16_TO_BE’ #define g_htons(val) (GUINT16_TO_BE (val)) ^ /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:705:35: note: in expansion of macro ‘g_htons’ pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP)); ^ /usr/include/glib-2.0/glib/gtypes.h:186:27: error: declaration of ‘__x’ shadows a previous local [-Werror=shadow] ({ register guint16 __v, __x = ((guint16) (val)); \ ^ /usr/include/glib-2.0/glib/gtypes.h:237:38: note: in expansion of macro ‘GUINT16_SWAP_LE_BE_IA32’ # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) ^ /usr/lib/glib-2.0/include/glibconfig.h:192:29: note: in expansion of macro ‘GUINT16_SWAP_LE_BE’ #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:359:23: note: in expansion of macro ‘GUINT16_TO_BE’ #define g_htons(val) (GUINT16_TO_BE (val)) ^ /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:705:35: note: in expansion of macro ‘g_htons’ pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP)); ^ /usr/include/glib-2.0/glib/gtypes.h:237:38: note: in expansion of macro ‘GUINT16_SWAP_LE_BE_IA32’ # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) ^ /usr/lib/glib-2.0/include/glibconfig.h:192:29: note: in expansion of macro ‘GUINT16_SWAP_LE_BE’ #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:327:31: note: in expansion of macro ‘GUINT16_TO_BE’ #define GUINT16_FROM_BE(val) (GUINT16_TO_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:357:23: note: in expansion of macro ‘GUINT16_FROM_BE’ #define g_ntohs(val) (GUINT16_FROM_BE (val)) ^ /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:705:52: note: in expansion of macro ‘g_ntohs’ pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP)); ^ /usr/include/glib-2.0/glib/gtypes.h:186:27: error: shadowed declaration is here [-Werror=shadow] ({ register guint16 __v, __x = ((guint16) (val)); \ ^ /usr/include/glib-2.0/glib/gtypes.h:237:38: note: in expansion of macro ‘GUINT16_SWAP_LE_BE_IA32’ # define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (val)) ^ /usr/lib/glib-2.0/include/glibconfig.h:192:29: note: in expansion of macro ‘GUINT16_SWAP_LE_BE’ #define GUINT16_TO_BE(val) (GUINT16_SWAP_LE_BE (val)) ^ /usr/include/glib-2.0/glib/gtypes.h:359:23: note: in expansion of macro ‘GUINT16_TO_BE’ #define g_htons(val) (GUINT16_TO_BE (val)) ^ /home/jmayer/work/wireshark/svn/trunk/text2pcap.c:705:35: note: in expansion of macro ‘g_htons’ pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP)); ^ cc1: all warnings being treated as errors make[2]: *** [CMakeFiles/text2pcap.dir/text2pcap.c.o] Error 1 Feel free to choose a less offensive variable name svn path=/trunk/; revision=50005
Diffstat (limited to 'text2pcap.c')
-rw-r--r--text2pcap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/text2pcap.c b/text2pcap.c
index 119d105846..69e3c3c723 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -647,6 +647,7 @@ write_current_packet(gboolean cont)
guint32 length = 0;
guint16 padding_length = 0;
int err;
+ guint16 ihatemacros;
gboolean success;
if (curr_offset > header_length) {
@@ -702,7 +703,8 @@ write_current_packet(gboolean cont)
pseudoh6.dst_addr6 = HDR_IPv6.ip6_dst;
pseudoh6.zero = 0;
pseudoh6.protocol = (guint8) hdr_ip_proto;
- pseudoh.length = g_htons(length - g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen) + sizeof(HDR_UDP));
+ ihatemacros = g_ntohs(HDR_IPv6.ip6_ctlun.ip6_un1.ip6_un1_plen);
+ pseudoh.length = g_htons(length - ihatemacros + sizeof(HDR_UDP));
}
if(!hdr_ipv6) {