diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-04-16 04:05:39 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-04-16 04:05:39 +0000 |
commit | e648060f0f307b2df23902338fa5d22c4d490465 (patch) | |
tree | 1f4158ed7e68052c732725d2535039b9523e38de | |
parent | 17f0d877faff64832b2a93f24d21b873fe59919e (diff) | |
download | wireshark-e648060f0f307b2df23902338fa5d22c4d490465.tar.gz wireshark-e648060f0f307b2df23902338fa5d22c4d490465.tar.bz2 wireshark-e648060f0f307b2df23902338fa5d22c4d490465.zip |
Fix the last(?) of the Win64 compilation problems.
svn path=/trunk/; revision=28065
-rw-r--r-- | Makefile.nmake | 7 | ||||
-rw-r--r-- | capture-wpcap.c | 4 | ||||
-rw-r--r-- | dumpcap.c | 26 | ||||
-rw-r--r-- | editcap.c | 10 | ||||
-rw-r--r-- | file.c | 10 | ||||
-rw-r--r-- | fileset.c | 6 | ||||
-rw-r--r-- | print.c | 4 | ||||
-rw-r--r-- | rawshark.c | 4 | ||||
-rw-r--r-- | sync_pipe_write.c | 8 | ||||
-rw-r--r-- | tempfile.c | 2 | ||||
-rw-r--r-- | text2pcap.c | 4 | ||||
-rw-r--r-- | util.c | 2 |
12 files changed, 46 insertions, 41 deletions
diff --git a/Makefile.nmake b/Makefile.nmake index 653cfbfe5b..0c0b725684 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -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 \ diff --git a/capture-wpcap.c b/capture-wpcap.c index 400b89f08b..3e4198f207 100644 --- a/capture-wpcap.c +++ b/capture-wpcap.c @@ -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); @@ -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" @@ -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); @@ -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); @@ -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 ... */ @@ -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) { diff --git a/rawshark.c b/rawshark.c index afa3d5c964..cea87ab2d6 100644 --- a/rawshark.c +++ b/rawshark.c @@ -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; diff --git a/sync_pipe_write.c b/sync_pipe_write.c index efb6eddd9b..4b627b884c 100644 --- a/sync_pipe_write.c +++ b/sync_pipe_write.c @@ -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); } diff --git a/tempfile.c b/tempfile.c index 0ad2fcff01..84e66f321c 100644 --- a/tempfile.c +++ b/tempfile.c @@ -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; diff --git a/text2pcap.c b/text2pcap.c index 0dc78694c1..fbcaa68071 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -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 @@ -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 */ } |