Fix the last(?) of the Win64 compilation problems.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 16 Apr 2009 04:05:39 +0000 (04:05 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 16 Apr 2009 04:05:39 +0000 (04:05 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28065 f5534014-38df-0310-8fa8-9805f1628bb7

12 files changed:
Makefile.nmake
capture-wpcap.c
dumpcap.c
editcap.c
file.c
fileset.c
print.c
rawshark.c
sync_pipe_write.c
tempfile.c
text2pcap.c
util.c

index 653cfbfe5babaef73ad8db268ee0a1adc279f2f9..0c0b72568465acdddcab3fa2fbab87425418c523 100644 (file)
@@ -19,12 +19,14 @@ WIN_SETUP=tools\$(WIRESHARK_TARGET_PLATFORM)-setup.sh
 
 LDFLAGS = /NOLOGO /INCREMENTAL:no $(LOCAL_LDFLAGS)
 
-CFLAGS=-WX -DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
+# We use GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
+GENERATED_CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
        $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
        $(AIRPCAP_CFLAGS) \
        $(C_ARES_CFLAGS) $(ADNS_CFLAGS) $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) \
        $(LUA_CFLAGS) $(SMI_CFLAGS) $(GEOIP_CFLAGS) \
        -D_U_="" -D_NEED_VAR_IMPORT_
+CFLAGS=-WX $(GENERATED_CFLAGS)
 
 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
 
@@ -405,6 +407,9 @@ tshark-tap-register.c: $(TSHARK_TAP_SRC) make-tapreg-dotc
 text2pcap-scanner.c : text2pcap-scanner.l
        $(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
 
+text2pcap-scanner.obj : text2pcap-scanner.c
+       $(CC) $(CVARSDLL) $(GENERATED_CFLAGS) -Fd.\ -c $?
+
 clean-local: clean-deps
        rm -f $(wireshark_OBJECTS) $(tshark_OBJECTS) $(dumpcap_OBJECTS) $(rawshark_OBJECTS) \
                $(EXTRA_OBJECTS) $(EXECUTABLES) *.pdb *.exe.manifest \
index 400b89f08b4e6e4a148359f021db1dc29285a086..3e4198f207a15769f92b5aef5a91ff1590211165 100644 (file)
@@ -62,7 +62,7 @@ static int     (*p_pcap_snapshot) (pcap_t *);
 static int     (*p_pcap_datalink) (pcap_t *);
 static int     (*p_pcap_setfilter) (pcap_t *, struct bpf_program *);
 static char*   (*p_pcap_geterr) (pcap_t *);
-static int     (*p_pcap_compile) (pcap_t *, struct bpf_program *, char *, int,
+static int     (*p_pcap_compile) (pcap_t *, struct bpf_program *, const char *, int,
                        bpf_u_int32);
 #ifdef WPCAP_CONSTIFIED
 static int     (*p_pcap_lookupnet) (const char *, bpf_u_int32 *, bpf_u_int32 *,
@@ -282,7 +282,7 @@ pcap_geterr(pcap_t *a)
 }
 
 int
-pcap_compile(pcap_t *a, struct bpf_program *b, char *c, int d,
+pcap_compile(pcap_t *a, struct bpf_program *b, const char *c, int d,
             bpf_u_int32 e)
 {
        g_assert(has_wpcap);
index 7820cb736761fa8c42889704cff0db791f469136..092a8a7ca70623383f7593ba1fa6b76d245920ee 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -1152,37 +1152,37 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
     switch (err) {
 
     case WSASYSNOTREADY:
-      g_snprintf(errmsg, errmsg_len,
+      g_snprintf(errmsg, (gulong) errmsg_len,
         "Couldn't initialize Windows Sockets: Network system not ready for network communication");
       break;
 
     case WSAVERNOTSUPPORTED:
-      g_snprintf(errmsg, errmsg_len,
+      g_snprintf(errmsg, (gulong) errmsg_len,
         "Couldn't initialize Windows Sockets: Windows Sockets version %u.%u not supported",
         LOBYTE(wVersionRequested), HIBYTE(wVersionRequested));
       break;
 
     case WSAEINPROGRESS:
-      g_snprintf(errmsg, errmsg_len,
+      g_snprintf(errmsg, (gulong) errmsg_len,
         "Couldn't initialize Windows Sockets: Blocking operation is in progress");
       break;
 
     case WSAEPROCLIM:
-      g_snprintf(errmsg, errmsg_len,
+      g_snprintf(errmsg, (gulong) errmsg_len,
         "Couldn't initialize Windows Sockets: Limit on the number of tasks supported by this WinSock implementation has been reached");
       break;
 
     case WSAEFAULT:
-      g_snprintf(errmsg, errmsg_len,
+      g_snprintf(errmsg, (gulong) errmsg_len,
         "Couldn't initialize Windows Sockets: Bad pointer passed to WSAStartup");
       break;
 
     default:
-      g_snprintf(errmsg, errmsg_len,
+      g_snprintf(errmsg, (gulong) errmsg_len,
         "Couldn't initialize Windows Sockets: error %d", err);
       break;
     }
-    g_snprintf(secondary_errmsg, secondary_errmsg_len, please_report);
+    g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len, please_report);
     return FALSE;
   }
 #endif
@@ -1285,9 +1285,9 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
       set_linktype_err_str = set_pcap_linktype(ld->pcap_h, capture_opts->iface,
        capture_opts->linktype);
       if (set_linktype_err_str != NULL) {
-       g_snprintf(errmsg, errmsg_len, "Unable to set data link type (%s).",
+       g_snprintf(errmsg, (gulong) errmsg_len, "Unable to set data link type (%s).",
                   set_linktype_err_str);
-        g_snprintf(secondary_errmsg, secondary_errmsg_len, please_report);
+        g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len, please_report);
        return FALSE;
       }
     }
@@ -1295,7 +1295,7 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
   } else {
     /* We couldn't open "iface" as a network device. */
     /* Try to open it as a pipe */
-    ld->cap_pipe_fd = cap_pipe_open_live(capture_opts->iface, &ld->cap_pipe_hdr, ld, errmsg, errmsg_len);
+    ld->cap_pipe_fd = cap_pipe_open_live(capture_opts->iface, &ld->cap_pipe_hdr, ld, errmsg, (int) errmsg_len);
 
     if (ld->cap_pipe_fd == -1) {
 
@@ -1321,14 +1321,14 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
            "at the URL lists a number of mirror sites.";
        else
          libpcap_warn = "";
-       g_snprintf(errmsg, errmsg_len,
+       g_snprintf(errmsg, (gulong) errmsg_len,
          "The capture session could not be initiated (%s).", open_err_str);
 #ifndef _WIN32
-       g_snprintf(secondary_errmsg, secondary_errmsg_len,
+       g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len,
 "Please check to make sure you have sufficient permissions, and that you have "
 "the proper interface or pipe specified.%s", libpcap_warn);
 #else
-    g_snprintf(secondary_errmsg, secondary_errmsg_len,
+    g_snprintf(secondary_errmsg, (gulong) secondary_errmsg_len,
 "\n"
 "Please check that \"%s\" is the proper interface.\n"
 "\n"
index cdcfa99a6fb78b71289e536e28e578b00258fa16..c6cf7c2cba8501825c23038fab3e004552a5a6ec 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -205,7 +205,7 @@ set_time_adjustment(char *optarg)
 {
   char *frac, *end;
   long val;
-  int frac_digits;
+  size_t frac_digits;
 
   if (!optarg)
     return;
@@ -657,7 +657,7 @@ main(int argc, char *argv[])
       if (!filename) {
         exit(5);
       }
-      g_snprintf(filename, filenamelen, "%s-%05d", argv[optind+1], 0);
+      g_snprintf(filename, (gulong) filenamelen, "%s-%05d", argv[optind+1], 0);
     } else {
       if (secs_per_block > 0) {
         filenamelen = strlen(argv[optind+1]) + 7;
@@ -665,7 +665,7 @@ main(int argc, char *argv[])
         if (!filename) {
           exit(5);
           }
-        g_snprintf(filename, filenamelen, "%s-%05d", argv[optind+1], block_cnt);
+        g_snprintf(filename, (gulong) filenamelen, "%s-%05d", argv[optind+1], block_cnt);
         }
       else {
         filename = argv[optind+1];
@@ -706,7 +706,7 @@ main(int argc, char *argv[])
             exit(1);
             }
           block_start.secs = block_start.secs +  secs_per_block; /* reset for next interval */
-          g_snprintf(filename, filenamelen, "%s-%05d",argv[optind+1], ++block_cnt);
+          g_snprintf(filename, (gulong) filenamelen, "%s-%05d",argv[optind+1], ++block_cnt);
 
           if (verbose) {
             fprintf(stderr, "Continuing writing in file %s\n", filename);
@@ -731,7 +731,7 @@ main(int argc, char *argv[])
           exit(1);
         }
 
-        g_snprintf(filename, filenamelen, "%s-%05d",argv[optind+1], count / split_packet_count);
+        g_snprintf(filename, (gulong) filenamelen, "%s-%05d",argv[optind+1], count / split_packet_count);
 
         if (verbose) {
           fprintf(stderr, "Continuing writing in file %s\n", filename);
diff --git a/file.c b/file.c
index a854e8358d390fe598fd1bf55ff26c3ef80faa61..d61b189306fb08a369f11cb9bb7c645fb53fc4e1 100644 (file)
--- a/file.c
+++ b/file.c
@@ -2020,7 +2020,7 @@ print_packet(capture_file *cf, frame_data *fdata,
     line_len = 0;
     for (i = 0; i < cf->cinfo.num_cols; i++) {
       /* Find the length of the string for this column. */
-      column_len = strlen(cf->cinfo.col_data[i]);
+      column_len = (int) strlen(cf->cinfo.col_data[i]);
       if (args->col_widths[i] > column_len)
          column_len = args->col_widths[i];
 
@@ -2028,7 +2028,7 @@ print_packet(capture_file *cf, frame_data *fdata,
          double its length. */
       line_len += column_len + 1;      /* "+1" for space */
       if (line_len > args->line_buf_len) {
-        cp_off = cp - args->line_buf;
+        cp_off = (int) (cp - args->line_buf);
         args->line_buf_len = 2 * line_len;
         args->line_buf = g_realloc(args->line_buf, args->line_buf_len + 1);
         cp = args->line_buf + cp_off;
@@ -2152,14 +2152,14 @@ cf_print_packets(capture_file *cf, print_args_t *print_args)
       if (i == cf->cinfo.num_cols - 1)
         callback_args.col_widths[i] = 0;
       else {
-        callback_args.col_widths[i] = strlen(cf->cinfo.col_title[i]);
+        callback_args.col_widths[i] = (gint) strlen(cf->cinfo.col_title[i]);
         data_width = get_column_char_width(get_column_format(i));
         if (data_width > callback_args.col_widths[i])
           callback_args.col_widths[i] = data_width;
       }
 
       /* Find the length of the string for this column. */
-      column_len = strlen(cf->cinfo.col_title[i]);
+      column_len = (int) strlen(cf->cinfo.col_title[i]);
       if (callback_args.col_widths[i] > column_len)
         column_len = callback_args.col_widths[i];
 
@@ -2167,7 +2167,7 @@ cf_print_packets(capture_file *cf, print_args_t *print_args)
          double its length. */
       line_len += column_len + 1;      /* "+1" for space */
       if (line_len > callback_args.header_line_buf_len) {
-        cp_off = cp - callback_args.header_line_buf;
+        cp_off = (int) (cp - callback_args.header_line_buf);
         callback_args.header_line_buf_len = 2 * line_len;
         callback_args.header_line_buf = g_realloc(callback_args.header_line_buf,
                                                   callback_args.header_line_buf_len + 1);
index 159c49270b74d54e51666eb7331990e6839e6d10..f3697e8390daaeef8ff01b1599955bc94e36e1c5 100644 (file)
--- a/fileset.c
+++ b/fileset.c
@@ -74,8 +74,8 @@ gboolean
 fileset_filename_match_pattern(const char *fname)
 {
     char        *pfx;
-    int         baselen;
-    int         minlen = strlen("_00001_20050418010750");
+    size_t       baselen;
+    size_t      minlen = strlen("_00001_20050418010750");
     char        *filename;
 
 
@@ -133,7 +133,7 @@ fileset_is_file_in_set(const char *fname1, const char *fname2)
     char        *pfx2;
     char        *dup_f1;
     char        *dup_f2;
-    int         minlen = strlen("_00001_20050418010750");
+    size_t       minlen = strlen("_00001_20050418010750");
 
 
     /* just to be sure ... */
diff --git a/print.c b/print.c
index d72a0dbfeedaea2d7cafcf2617cdcfbc1847c44a..580ba1ff885bb9f06ecd9a70a257fb4221f7b2c4 100644 (file)
--- a/print.c
+++ b/print.c
@@ -260,7 +260,7 @@ proto_tree_write_node_pdml(proto_node *node, gpointer data)
        const gchar     *label_ptr;
        gchar           label_str[ITEM_LABEL_LENGTH];
        char            *dfilter_string;
-       int             chop_len;
+       size_t          chop_len;
        int             i;
 
        /* Will wrap up top-level field items inside a fake protocol wrapper to
@@ -1506,7 +1506,7 @@ const gchar* get_node_field_value(field_info* fi, epan_dissect_t* edt)
     else {
         /* Normal protocols and fields */
         gchar      *dfilter_string;
-        gint        chop_len;
+        size_t      chop_len;
 
         switch (fi->hfinfo->type)
         {
index afa3d5c964bbddfa946f2dead61bc5449fe60a9b..cea87ab2d61a4b78ced2fbce79e476c20ba28f6c 100644 (file)
@@ -1503,8 +1503,8 @@ add_string_fmt(string_fmt_e format, gchar *plain) {
 static gboolean
 parse_field_string_format(gchar *format) {
        GString *plain_s = g_string_new("");
-       int len;
-       int pos = 0;
+       size_t len;
+       size_t pos = 0;
 
        if (!format) {
                return FALSE;
index efb6eddd9b79c1c6ac8cce7aebeaf5a4ca62b64f..4b627b884c12a974e4bb9499c4830f3ed1a0f189 100644 (file)
@@ -72,12 +72,12 @@ void
 pipe_write_block(int pipe_fd, char indicator, const char *msg)
 {
     int ret;
-    size_t len;
+    int len;
 
     /*g_warning("write %d enter", pipe_fd);*/
 
     if(msg != NULL) {
-        len = strlen(msg) + 1;    /* including the terminating '\0'! */
+        len = (int) strlen(msg) + 1;    /* including the terminating '\0'! */
     } else {
         len = 0;
     }
@@ -91,7 +91,7 @@ pipe_write_block(int pipe_fd, char indicator, const char *msg)
     /* write value (if we have one) */
     if(len) {
         /*g_warning("write %d indicator: %c value len: %u msg: %s", pipe_fd, indicator, len, msg);*/
-        ret = write(pipe_fd, msg, len);
+        ret = (int) write(pipe_fd, msg, len);
         if(ret == -1) {
             return;
         }
@@ -109,7 +109,7 @@ sync_pipe_errmsg_to_parent(int pipe_fd, const char *error_msg,
 {
 
     /* first write a "master header" with the length of the two messages plus their "slave headers" */
-    pipe_write_header(pipe_fd, SP_ERROR_MSG, strlen(error_msg) + 1 + 4 + strlen(secondary_error_msg) + 1 + 4);
+    pipe_write_header(pipe_fd, SP_ERROR_MSG, (int) (strlen(error_msg) + 1 + 4 + strlen(secondary_error_msg) + 1 + 4));
     pipe_write_block(pipe_fd, SP_ERROR_MSG, error_msg);
     pipe_write_block(pipe_fd, SP_ERROR_MSG, secondary_error_msg);
 }
index 0ad2fcff01640589fcf415b67c1d552b5192d003..84e66f321cf48763138376842a7efa2fa12eb319 100644 (file)
@@ -65,7 +65,7 @@ static int
 try_tempfile(char *namebuf, int namebuflen, const char *dir, const char *pfx)
 {
        static const char suffix[] = "XXXXXXXXXX";
-       int namelen = strlen(dir) + strlen(pfx) + sizeof suffix;
+       int namelen = (int) (strlen(dir) + strlen(pfx) + sizeof(suffix));
        int old_umask;
        int tmp_fd;
 
index 0dc78694c12618a5204625ad391db18f29a491c7..fbcaa6807199eb61cbcfee33a8a09d839c7b9c58 100644 (file)
@@ -721,7 +721,7 @@ append_to_preamble(char *str)
         if (packet_preamble_len + toklen > PACKET_PREAMBLE_MAX_LEN)
             return;    /* no room to add the token to the preamble */
         g_strlcpy(&packet_preamble[packet_preamble_len], str, PACKET_PREAMBLE_MAX_LEN);
-        packet_preamble_len += toklen;
+        packet_preamble_len += (int) toklen;
        if (debug >= 2) {
                char *c;
                char xs[PACKET_PREAMBLE_MAX_LEN];
@@ -810,7 +810,7 @@ parse_preamble (void)
                                 * 10^-6 seconds, we multiply by
                                 * 10^(6-N).
                                 */
-                               subseclen = p - subsecs;
+                               subseclen = (int) (p - subsecs);
                                if (subseclen > 6) {
                                        /*
                                         * *More* than 6 digits; 6-N is
diff --git a/util.c b/util.c
index 7e2bb41b1623087f75a74d78a84535c696c1b145..a86b48afd34a7c09c9e971927294b062c37ab812 100644 (file)
--- a/util.c
+++ b/util.c
@@ -59,7 +59,7 @@ get_args_as_string(int argc, char **argv, int optindex)
         */
        len = 0;
        for (i = optindex; i < argc; i++) {
-               len += strlen(argv[i]);
+               len += (int) strlen(argv[i]);
                len++;  /* space, or '\0' if this is the last argument */
        }