From 21315531bcf393adebaf5a9316523c8d644a70e1 Mon Sep 17 00:00:00 2001 From: gerald Date: Thu, 16 Apr 2009 03:38:23 +0000 Subject: [PATCH] Fix Win64 compilation problems in the plugins directory. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28064 f5534014-38df-0310-8fa8-9805f1628bb7 --- plugins/asn1/asn1.c | 2 +- plugins/ethercat/packet-ecatmb.c | 2 +- plugins/ethercat/packet-ecatmb.h | 14 +++++++------- plugins/irda/packet-sir.c | 2 +- plugins/mate/Makefile.nmake | 5 ++++- plugins/mate/mate_util.c | 4 ++-- plugins/unistim/packet-unistim.c | 4 ++-- plugins/wimaxasncp/Makefile.nmake | 8 +++++++- 8 files changed, 25 insertions(+), 16 deletions(-) diff --git a/plugins/asn1/asn1.c b/plugins/asn1/asn1.c index 3c711f7ef8..fe5b6c3f1c 100644 --- a/plugins/asn1/asn1.c +++ b/plugins/asn1/asn1.c @@ -705,7 +705,7 @@ asn1_bits_decode ( ASN1_SCK *asn1, int enc_len, guchar **bits, return ret; } } - *len = ptr - *bits; + *len = (guint) (ptr - *bits); return ASN1_ERR_NOERROR; } diff --git a/plugins/ethercat/packet-ecatmb.c b/plugins/ethercat/packet-ecatmb.c index 3623838afc..7c87c28840 100644 --- a/plugins/ethercat/packet-ecatmb.c +++ b/plugins/ethercat/packet-ecatmb.c @@ -1312,7 +1312,7 @@ static void dissect_ecat_mailbox(tvbuff_t *tvb, packet_info *pinfo, proto_tree * char szText[200]; int nMax = sizeof(szText)-1; - guint mailbox_length = tvb_reported_length(tvb); + gint mailbox_length = tvb_reported_length(tvb); if( mailbox_length >= ETHERCAT_MBOX_HEADER_LEN ) { diff --git a/plugins/ethercat/packet-ecatmb.h b/plugins/ethercat/packet-ecatmb.h index eec89fc5f5..2d09a36154 100644 --- a/plugins/ethercat/packet-ecatmb.h +++ b/plugins/ethercat/packet-ecatmb.h @@ -31,7 +31,7 @@ typedef struct TETHERNET_ADDRESS { guint8 b[6]; } ETHERNET_ADDRESS, *PETHERNET_ADDRESS; -#define ETHERNET_ADDRESS_LEN sizeof(ETHERNET_ADDRESS) +#define ETHERNET_ADDRESS_LEN ((int) sizeof(ETHERNET_ADDRESS)) /* Mailbox*/ #define ETHERCAT_MBOX_TYPE_ADS 1 /* AMS/ADS header follows*/ @@ -60,7 +60,7 @@ typedef struct TETHERCAT_MBOX_HEADER MbxHeaderControlUnion aControlUnion; } ETHERCAT_MBOX_HEADER, *PETHERCAT_MBOX_HEADER; -#define ETHERCAT_MBOX_HEADER_LEN sizeof(ETHERCAT_MBOX_HEADER) +#define ETHERCAT_MBOX_HEADER_LEN ((int) sizeof(ETHERCAT_MBOX_HEADER)) /*/////////////////////////////////////////////////////////////////////////////*/ /* EoE*/ @@ -118,13 +118,13 @@ typedef struct TETHERCAT_EOE_MACFILTER ETHERNET_ADDRESS MacFilter[16]; ETHERNET_ADDRESS MacFilterMask[4]; } ETHERCAT_EOE_MACFILTER; -#define ETHERCAT_EOE_MACFILTER_LEN sizeof(ETHERCAT_EOE_MACFILTER) +#define ETHERCAT_EOE_MACFILTER_LEN ((int) sizeof(ETHERCAT_EOE_MACFILTER)) typedef struct TETHERCAT_EOE_TIMESTAMP { guint32 TimeStamp; /* 32 bit time stamp */ } ETHERCAT_EOE_TIMESTAMP; -#define ETHERCAT_EOE_TIMESTAMP_LEN sizeof(ETHERCAT_EOE_TIMESTAMP) +#define ETHERCAT_EOE_TIMESTAMP_LEN ((int) sizeof(ETHERCAT_EOE_TIMESTAMP)) typedef union tEoeHeaderDataUnion { @@ -157,7 +157,7 @@ typedef struct TETHERCAT_EOE_HEADER EoeHeaderInfoUnion anEoeHeaderInfoUnion; EoeHeaderDataUnion anEoeHeaderDataUnion; } ETHERCAT_EOE_HEADER, *PETHERCAT_EOE_HEADER; -#define ETHERCAT_EOE_HEADER_LEN sizeof(ETHERCAT_EOE_HEADER) +#define ETHERCAT_EOE_HEADER_LEN ((int) sizeof(ETHERCAT_EOE_HEADER)) /*/////////////////////////////////////////////////////////////////////////////*/ /* CANopen*/ @@ -180,7 +180,7 @@ typedef union TETHERCAT_COE_HEADER } v; guint16 header; } ETHERCAT_COE_HEADER, *PETHERCAT_COE_HEADER; -#define ETHERCAT_COE_HEADER_LEN sizeof(ETHERCAT_COE_HEADER) +#define ETHERCAT_COE_HEADER_LEN ((int) sizeof(ETHERCAT_COE_HEADER)) typedef union tSdoHeaderUnion @@ -475,7 +475,7 @@ typedef struct TETHERCAT_SOE_HEADER guint16 ErrorCode if (Error==1) } MailBoxDataUnion;*/ } ETHERCAT_SOE_HEADER, *PETHERCAT_SOE_HEADER; -#define ETHERCAT_SOE_HEADER_LEN sizeof(ETHERCAT_SOE_HEADER) +#define ETHERCAT_SOE_HEADER_LEN ((int) sizeof(ETHERCAT_SOE_HEADER)) extern void init_mbx_header(PETHERCAT_MBOX_HEADER pMbox, tvbuff_t *tvb, gint offset); diff --git a/plugins/irda/packet-sir.c b/plugins/irda/packet-sir.c index 3be593f426..18a6a9d43b 100644 --- a/plugins/irda/packet-sir.c +++ b/plugins/irda/packet-sir.c @@ -85,7 +85,7 @@ unescape_data(tvbuff_t *tvb, packet_info *pinfo) *dst++ = c; } - next_tvb = tvb_new_real_data(data, dst-data, dst-data); + next_tvb = tvb_new_real_data(data, (guint) (dst-data), (guint) (dst-data)); tvb_set_free_cb(next_tvb, g_free); tvb_set_child_real_data_tvbuff(tvb, next_tvb); add_new_data_source(pinfo, next_tvb, "Unescaped SIR"); diff --git a/plugins/mate/Makefile.nmake b/plugins/mate/Makefile.nmake index 22e5902f24..bf33acc2d9 100644 --- a/plugins/mate/Makefile.nmake +++ b/plugins/mate/Makefile.nmake @@ -13,8 +13,10 @@ include Makefile.common LEMON=..\..\tools\lemon -CFLAGS=/WX /DHAVE_CONFIG_H /I../.. $(GLIB_CFLAGS) /I$(LEMON)\ +# We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output +GENERATED_CFLAGS=/DHAVE_CONFIG_H /I../.. $(GLIB_CFLAGS) /I$(LEMON)\ /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS) +CFLAGS=/WX $(GENERATED_CFLAGS) .c.obj:: $(CC) $(CFLAGS) -Fd.\ -c $< @@ -117,6 +119,7 @@ RUNLEX = ..\..\tools\runlex.sh mate_parser_lex.h : mate_parser.c mate_parser.obj : mate_parser.c + $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $? mate_grammar.h : mate_grammar.c mate_grammar.c : mate_grammar.lemon $(LEMON)\lemon.exe diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c index ade8fb2285..3a6ce69878 100644 --- a/plugins/mate/mate_util.c +++ b/plugins/mate/mate_util.c @@ -986,8 +986,8 @@ extern AVP* match_avp(AVP* src, AVP* op) { } case AVP_OP_ENDS: /* does this work? */ - ls = strlen(src->v); - lo = strlen(op->v); + ls = (guint) strlen(src->v); + lo = (guint) strlen(op->v); if ( ls < lo ) { return NULL; diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index f2ecffb9c4..86460e18a1 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -2604,7 +2604,7 @@ dissect_audio_phone(proto_tree *msg_tree, static void set_ascii_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len){ char *buffer=NULL; - guint16 buffer_index=0; + gsize buffer_index=0; guint16 msg_index=0; guint8 character; char *label="DATA: "; @@ -2637,7 +2637,7 @@ set_ascii_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len){ static void set_ascii_null_term_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len,char *label){ char *buffer=NULL; - guint16 buffer_index=0; + gsize buffer_index=0; guint16 msg_index=0; guint8 character; #define MAX_BUFFER 1024 diff --git a/plugins/wimaxasncp/Makefile.nmake b/plugins/wimaxasncp/Makefile.nmake index dc3f07e5f6..4d3fcf97b9 100644 --- a/plugins/wimaxasncp/Makefile.nmake +++ b/plugins/wimaxasncp/Makefile.nmake @@ -10,8 +10,13 @@ include ..\..\Makefile.nmake.inc include Makefile.common -CFLAGS=/WX /DHAVE_CONFIG_H /I../.. $(GLIB_CFLAGS) \ +# We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output +GENERATED_CFLAGS=/DHAVE_CONFIG_H /I../.. $(GLIB_CFLAGS) \ /I$(PCAP_DIR)\include -D_U_="" $(LOCAL_CFLAGS) +CFLAGS=/WX $(GENERATED_CFLAGS) + + + .c.obj:: $(CC) $(CFLAGS) -Fd.\ -c $< @@ -96,6 +101,7 @@ RUNLEX = ..\..\tools\runlex.sh wimaxasncp_dict_lex.h : wimaxasncp_dict.c wimaxasncp_dict.obj : wimaxasncp_dict.c + $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $? clean: rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb \ -- 2.34.1