Remove all warnings under Unix for the gtk/ directory.

svn path=/trunk/; revision=21160
This commit is contained in:
Stephen Fisher 2007-03-24 00:45:11 +00:00
parent 43a98f8fb8
commit 1909b97d4d
14 changed files with 50 additions and 41 deletions

View File

@ -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",

View File

@ -23,6 +23,10 @@
include Makefile.common
if HAVE_WARNINGS_AS_ERRORS
AM_CFLAGS = -Werror
endif
noinst_LIBRARIES = libui.a
CLEANFILES = \

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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];

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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];

View File

@ -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);
}

View File

@ -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;
}

View File

@ -1,5 +1,5 @@
/* XPM */
static char * capture_capture_16_xpm[] = {
char * capture_capture_16_xpm[] = {
"16 16 151 2",
" c None",
". c #7F7F7F",

View File

@ -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",

View File

@ -1,5 +1,5 @@
/* XPM */
static char * capture_prepare_16_xpm[] = {
char * capture_prepare_16_xpm[] = {
"16 16 159 2",
" c None",
". c #808080",