Fix Win64 compilation problems in the plugins directory.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 16 Apr 2009 03:38:23 +0000 (03:38 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 16 Apr 2009 03:38:23 +0000 (03:38 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28064 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/asn1/asn1.c
plugins/ethercat/packet-ecatmb.c
plugins/ethercat/packet-ecatmb.h
plugins/irda/packet-sir.c
plugins/mate/Makefile.nmake
plugins/mate/mate_util.c
plugins/unistim/packet-unistim.c
plugins/wimaxasncp/Makefile.nmake

index 3c711f7ef8179123e54d04aa4741639cd8ce9bba..fe5b6c3f1cb081d2a328eb251ba6416e9c9fd2f6 100644 (file)
@@ -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;
 }
 
index 3623838afc5e20bb8a111818515b894a73440d2b..7c87c28840e3423309e436c641e307a00336822d 100644 (file)
@@ -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 )
    {
index eec89fc5f5bfef961d28cd982514ee7236742dc1..2d09a36154e6d36e20c46967c04adfa77303376b 100644 (file)
@@ -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);
 
index 3be593f42624df5801e66bc6372b685ad1397d1e..18a6a9d43bbff5441c526ca0ee5bc7a32a090d85 100644 (file)
@@ -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");
index 22e5902f2427f5a9b3540fe6434f66fc4d745f9a..bf33acc2d93fe340519fbbed7b76481748d3d2d5 100644 (file)
@@ -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
index ade8fb228564401a8723aa34143855612962eab5..3a6ce69878ce72d915b8dae5144a3c93dbc1d16e 100644 (file)
@@ -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;
index f2ecffb9c4807cd416efa346d81d1e4255b73706..86460e18a140cbe0e1c9d97fc5dbf04da5b3b2c3 100644 (file)
@@ -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
index dc3f07e5f66fd12d263ecf918993cbebbc101a0f..4d3fcf97b9da590da8189391e003564eaba94873 100644 (file)
@@ -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 \