From 1909b97d4d4b235fc6b3232bee3e3285d876b26d Mon Sep 17 00:00:00 2001 From: Stephen Fisher Date: Sat, 24 Mar 2007 00:45:11 +0000 Subject: [PATCH] Remove all warnings under Unix for the gtk/ directory. svn path=/trunk/; revision=21160 --- epan/dissectors/packet-ssl-utils.h | 2 +- gtk/Makefile.am | 4 ++++ gtk/find_dlg.c | 4 ++-- gtk/follow_dlg.c | 2 +- gtk/graph_analysis.c | 4 ++-- gtk/io_stat.c | 2 +- gtk/proto_draw.c | 34 +++++++++++++++------------- gtk/recent.c | 4 ++-- gtk/rtp_analysis.c | 2 +- gtk/stats_tree_stat.c | 25 ++++++++++---------- gtk/voip_calls_dlg.c | 2 ++ image/toolbar/capture_capture_16.xpm | 2 +- image/toolbar/capture_details_16.xpm | 2 +- image/toolbar/capture_prepare_16.xpm | 2 +- 14 files changed, 50 insertions(+), 41 deletions(-) diff --git a/epan/dissectors/packet-ssl-utils.h b/epan/dissectors/packet-ssl-utils.h index 52bb4b04db..114a00cd9a 100644 --- a/epan/dissectors/packet-ssl-utils.h +++ b/epan/dissectors/packet-ssl-utils.h @@ -71,7 +71,7 @@ /* corresponds to the #defines above */ -static const gchar* ssl_version_short_names[] = { +const gchar* ssl_version_short_names[] = { "SSL", "SSLv2", "SSLv3", diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 039bb526ad..1a08f80588 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -23,6 +23,10 @@ include Makefile.common +if HAVE_WARNINGS_AS_ERRORS +AM_CFLAGS = -Werror +endif + noinst_LIBRARIES = libui.a CLEANFILES = \ diff --git a/gtk/find_dlg.c b/gtk/find_dlg.c index 5b11f89ad5..c4becfd534 100644 --- a/gtk/find_dlg.c +++ b/gtk/find_dlg.c @@ -677,7 +677,7 @@ find_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) } else { /* The raw packet data */ if(string){ - found_packet = cf_find_packet_data(&cfile, string, strlen(string)); + found_packet = cf_find_packet_data(&cfile, (guint8*)string, strlen(string)); g_free(string); } if (!found_packet) { @@ -751,7 +751,7 @@ find_previous_next(GtkWidget *w, gpointer d, gboolean sens) cf_find_packet_summary_line(&cfile, string); } else { /* The raw packet data */ - cf_find_packet_data(&cfile, string, strlen(string)); + cf_find_packet_data(&cfile, (guint8*)string, strlen(string)); } g_free(string); } else { diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c index 2ca7e6ff7b..343c578a2d 100644 --- a/gtk/follow_dlg.c +++ b/gtk/follow_dlg.c @@ -694,7 +694,7 @@ follow_read_stream(follow_info_t *follow_info, case SHOW_EBCDIC: /* If our native arch is ASCII, call: */ - EBCDIC_to_ASCII(buffer, nchars); + EBCDIC_to_ASCII((guint8*)buffer, nchars); if (!(*print_line) (buffer, nchars, is_server, arg)) goto print_error; break; diff --git a/gtk/graph_analysis.c b/gtk/graph_analysis.c index 3189b27adf..3589006d36 100644 --- a/gtk/graph_analysis.c +++ b/gtk/graph_analysis.c @@ -617,7 +617,7 @@ static void dialog_graph_draw(graph_analysis_data_t* user_data) PangoLayout *big_layout; PangoLayout *small_layout; #endif - guint32 label_width, label_height; + gint label_width, label_height; guint32 draw_width, draw_height; char label_string[MAX_COMMENT]; GList* list; @@ -989,7 +989,7 @@ static void dialog_graph_draw(graph_analysis_data_t* user_data) label_x = arrow_width/2+end_arrow; } - if (label_width>arrow_width) arrow_width = label_width; + if (label_width>(gint)arrow_width) arrow_width = label_width; if ((int)left_x_border > ((int)label_x-(int)label_width/2)) label_x = left_x_border + label_width/2; diff --git a/gtk/io_stat.c b/gtk/io_stat.c index 92ce77d27c..218d19b8d9 100644 --- a/gtk/io_stat.c +++ b/gtk/io_stat.c @@ -513,7 +513,7 @@ io_stat_draw(io_stat_t *io) #else PangoLayout *layout; #endif - guint32 label_width, label_height; + int label_width, label_height; guint32 draw_width, draw_height; char label_string[15]; diff --git a/gtk/proto_draw.c b/gtk/proto_draw.c index 7edfcce755..ecd3be31b4 100644 --- a/gtk/proto_draw.c +++ b/gtk/proto_draw.c @@ -910,7 +910,7 @@ copy_hex_cb(GtkWidget * w _U_, gpointer data _U_, copy_data_type data_type) { GtkWidget *bv; - int len; + guint len; int bytes_consumed = 0; int flags; @@ -942,7 +942,7 @@ copy_hex_cb(GtkWidget * w _U_, gpointer data _U_, copy_data_type data_type) end = GPOINTER_TO_INT(OBJECT_GET_DATA(bv, E_BYTE_VIEW_START_KEY)); start = GPOINTER_TO_INT(OBJECT_GET_DATA(bv, E_BYTE_VIEW_END_KEY)); - if(start >= 0 && end > start && (end - start <= len)) { + if(start >= 0 && end > start && (end - start <= (int)len)) { len = end - start; data_p += start; } @@ -997,7 +997,8 @@ static void savehex_save_clicked_cb(GtkWidget * w _U_, gpointer data _U_) { GtkWidget *bv; - int fd, start, end, len; + int fd, start, end; + guint len; const guint8 *data_p = NULL; const char *file = NULL; @@ -1055,7 +1056,8 @@ savehex_save_clicked_cb(GtkWidget * w _U_, gpointer data _U_) /* Launch the dialog box to put up the file selection box etc */ void savehex_cb(GtkWidget * w _U_, gpointer data _U_) { - int start, end, len; + int start, end; + guint len; const guint8 *data_p = NULL; gchar *label; @@ -1456,8 +1458,8 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, else revstyle = "bold"; - gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, -1, "plain", - NULL); + gtk_text_buffer_insert_with_tags_by_name(buf, &iter, (gchar*)line, -1, + "plain", NULL); /* Do we start in reverse? */ reverse = i >= bstart && i < bend; j = i; @@ -1475,7 +1477,7 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, newreverse = i >= bstart && i < bend; /* Have we gone from reverse to plain? */ if (reverse && (reverse != newreverse)) { - gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, cur, + gtk_text_buffer_insert_with_tags_by_name(buf, &iter, (gchar*)line, cur, revstyle, NULL); cur = 0; } @@ -1489,7 +1491,7 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, } /* Have we gone from plain to reversed? */ if (!reverse && (reverse != newreverse)) { - gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, cur, + gtk_text_buffer_insert_with_tags_by_name(buf, &iter, (gchar*)line, cur, "plain", NULL); mark = gtk_text_buffer_create_mark(buf, NULL, &iter, TRUE); cur = 0; @@ -1497,13 +1499,13 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, reverse = newreverse; } /* Print remaining part of line */ - gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, cur, + gtk_text_buffer_insert_with_tags_by_name(buf, &iter, (gchar*)line, cur, reverse ? revstyle : "plain", NULL); cur = 0; /* Print some space at the end of the line */ line[cur++] = ' '; line[cur++] = ' '; line[cur++] = ' '; - gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, cur, + gtk_text_buffer_insert_with_tags_by_name(buf, &iter, (gchar*)line, cur, "plain", NULL); cur = 0; @@ -1530,7 +1532,7 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, newreverse = i >= bstart && i < bend; /* Have we gone from reverse to plain? */ if (reverse && (reverse != newreverse)) { - convline = g_locale_to_utf8(line, cur, NULL, &newsize, NULL); + convline = g_locale_to_utf8((gchar*)line, cur, NULL, &newsize, NULL); gtk_text_buffer_insert_with_tags_by_name(buf, &iter, convline, newsize, revstyle, NULL); g_free( (gpointer) convline); @@ -1544,7 +1546,7 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, } /* Have we gone from plain to reversed? */ if (!reverse && (reverse != newreverse)) { - convline = g_locale_to_utf8(line, cur, NULL, &newsize, NULL); + convline = g_locale_to_utf8((gchar*)line, cur, NULL, &newsize, NULL); gtk_text_buffer_insert_with_tags_by_name(buf, &iter, convline, newsize, "plain", NULL); g_free( (gpointer) convline); @@ -1553,14 +1555,14 @@ packet_hex_print_common(GtkWidget *bv, const guint8 *pd, int len, int bstart, reverse = newreverse; } /* Print remaining part of line */ - convline = g_locale_to_utf8(line, cur, NULL, &newsize, NULL); + convline = g_locale_to_utf8((gchar*)line, cur, NULL, &newsize, NULL); gtk_text_buffer_insert_with_tags_by_name(buf, &iter, convline, newsize, reverse ? revstyle : "plain", NULL); g_free( (gpointer) convline); cur = 0; line[cur++] = '\n'; - gtk_text_buffer_insert_with_tags_by_name(buf, &iter, line, cur, + gtk_text_buffer_insert_with_tags_by_name(buf, &iter, (gchar*)line, cur, "plain", NULL); #endif } @@ -1616,7 +1618,7 @@ packet_hex_print(GtkWidget *bv, const guint8 *pd, frame_data *fd, OBJECT_SET_DATA(bv, E_BYTE_VIEW_START_KEY, GINT_TO_POINTER(bend)); OBJECT_SET_DATA(bv, E_BYTE_VIEW_END_KEY, GINT_TO_POINTER(bstart)); OBJECT_SET_DATA(bv, E_BYTE_VIEW_ENCODE_KEY, - GINT_TO_POINTER(fd->flags.encoding)); + GUINT_TO_POINTER((guint)fd->flags.encoding)); packet_hex_print_common(bv, pd, len, bstart, bend, fd->flags.encoding); } @@ -1991,7 +1993,7 @@ tree_view_follow_link(field_info *fi) cf_goto_frame(&cfile, fi->value.value.uinteger); } if(FI_GET_FLAG(fi, FI_URL) && IS_FT_STRING(fi->hfinfo->type)) { - url = g_strndup(tvb_get_ptr(fi->ds_tvb, fi->start, fi->length), fi->length); + url = g_strndup((gchar*)tvb_get_ptr(fi->ds_tvb, fi->start, fi->length), fi->length); browser_open_url(url); g_free(url); } diff --git a/gtk/recent.c b/gtk/recent.c index 929c65558b..95c81379a8 100644 --- a/gtk/recent.c +++ b/gtk/recent.c @@ -489,7 +489,7 @@ recent_set_arg(char *prefarg) guchar *p, *colonp; int ret; - colonp = strchr(prefarg, ':'); + colonp = (guchar*)strchr(prefarg, ':'); if (colonp == NULL) return PREFS_SET_SYNTAX_ERR; @@ -513,7 +513,7 @@ recent_set_arg(char *prefarg) return PREFS_SET_SYNTAX_ERR; } - ret = read_set_recent_pair_static(prefarg, p, NULL); + ret = read_set_recent_pair_static(prefarg, (gchar*)p, NULL); *colonp = ':'; /* put the colon back */ return ret; } diff --git a/gtk/rtp_analysis.c b/gtk/rtp_analysis.c index 81ebdb367f..428fd99758 100644 --- a/gtk/rtp_analysis.c +++ b/gtk/rtp_analysis.c @@ -1243,7 +1243,7 @@ static void dialog_graph_draw(user_data_t* user_data) #else PangoLayout *layout; #endif - guint32 label_width, label_height; + int label_width, label_height; guint32 draw_width, draw_height; char label_string[15]; diff --git a/gtk/stats_tree_stat.c b/gtk/stats_tree_stat.c index 7f87e83945..a9b5340e40 100644 --- a/gtk/stats_tree_stat.c +++ b/gtk/stats_tree_stat.c @@ -131,7 +131,8 @@ static void draw_gtk_node(stat_node* node) { static gchar percent[NUM_BUF_SIZE]; stat_node* child; - stats_tree_get_strs_from_node(node, value, rate, percent); + stats_tree_get_strs_from_node(node, (guint8*)value, (guint8*)rate, + (guint8*)percent); #if GTK_MAJOR_VERSION >= 2 if (node->st->pr->store && node->pr->iter) { @@ -229,12 +230,12 @@ static void reset_tap(void* p) { /* initializes the stats_tree window */ static void init_gtk_tree(const char* optarg, void *userdata _U_) { - guint8* abbr = stats_tree_get_abbr(optarg); + guint8* abbr = stats_tree_get_abbr((guint8*)optarg); stats_tree* st = NULL; stats_tree_cfg* cfg = NULL; tree_pres* pr = g_malloc(sizeof(tree_pres)); - guint8* title = NULL; - guint8* window_name = NULL; + gchar* title = NULL; + gchar* window_name = NULL; GString* error_string; GtkWidget *scr_win; guint init_strlen; @@ -268,7 +269,7 @@ static void init_gtk_tree(const char* optarg, void *userdata _U_) { if (init_strlen == strlen(optarg)) { st = stats_tree_new(cfg,pr,NULL); } else { - st = stats_tree_new(cfg,pr,((guint8*)optarg)+init_strlen+1); + st = stats_tree_new(cfg,pr,((gchar*)optarg)+init_strlen+1); } } else { @@ -370,12 +371,12 @@ static void init_gtk_tree(const char* optarg, void *userdata _U_) { gtk_container_add( GTK_CONTAINER(main_vb), scr_win); - error_string = register_tap_listener( cfg->tapname, - st, - st->filter, - reset_tap, - stats_tree_packet, - draw_gtk_tree); + error_string = register_tap_listener( (char*)cfg->tapname, + st, + st->filter, + reset_tap, + stats_tree_packet, + draw_gtk_tree); if (error_string) { /* error, we failed to attach to the tap. clean up */ @@ -418,7 +419,7 @@ static void register_gtk_stats_tree_tap (gpointer k _U_, gpointer v, gpointer p cfg->pr->stat_dlg->tap_init_cb = init_gtk_tree; cfg->pr->stat_dlg->index = -1; - register_dfilter_stat(cfg->pr->stat_dlg, cfg->name, + register_dfilter_stat(cfg->pr->stat_dlg, (char*)cfg->name, REGISTER_STAT_GROUP_NONE); } diff --git a/gtk/voip_calls_dlg.c b/gtk/voip_calls_dlg.c index 531d17efbf..164333b7d9 100644 --- a/gtk/voip_calls_dlg.c +++ b/gtk/voip_calls_dlg.c @@ -369,6 +369,8 @@ voip_calls_on_filter (GtkButton *button _U_, case VOIP_AC_ISDN: case VOIP_AC_CAS: case MEDIA_T38: + case TEL_BSSMAP: + case TEL_RANAP: /* XXX - not supported */ break; } diff --git a/image/toolbar/capture_capture_16.xpm b/image/toolbar/capture_capture_16.xpm index ef2a0f573f..cbcb8420e6 100644 --- a/image/toolbar/capture_capture_16.xpm +++ b/image/toolbar/capture_capture_16.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * capture_capture_16_xpm[] = { +char * capture_capture_16_xpm[] = { "16 16 151 2", " c None", ". c #7F7F7F", diff --git a/image/toolbar/capture_details_16.xpm b/image/toolbar/capture_details_16.xpm index 727a33b81e..fb38b2acbf 100644 --- a/image/toolbar/capture_details_16.xpm +++ b/image/toolbar/capture_details_16.xpm @@ -1,5 +1,5 @@ /* XPM */ -static const char * capture_details_16_xpm[] = { +const char * capture_details_16_xpm[] = { "16 16 131 2", " c None", ". c #000000", diff --git a/image/toolbar/capture_prepare_16.xpm b/image/toolbar/capture_prepare_16.xpm index 084d4bb6d0..4eb9f75d71 100644 --- a/image/toolbar/capture_prepare_16.xpm +++ b/image/toolbar/capture_prepare_16.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * capture_prepare_16_xpm[] = { +char * capture_prepare_16_xpm[] = { "16 16 159 2", " c None", ". c #808080",