aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/sctp_graph_dlg.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2007-03-21 03:26:26 +0000
committerUlf Lamping <ulf.lamping@web.de>2007-03-21 03:26:26 +0000
commit407d0aeab0fce64ba03a127b84b51bb18d4cecf0 (patch)
tree17c4ab8485e38fe59442c67b85967aaff666312c /gtk/sctp_graph_dlg.c
parentf953c1b000faffd77e1d27d8a586e006a42a2d8b (diff)
downloadwireshark-407d0aeab0fce64ba03a127b84b51bb18d4cecf0.tar.gz
wireshark-407d0aeab0fce64ba03a127b84b51bb18d4cecf0.tar.bz2
wireshark-407d0aeab0fce64ba03a127b84b51bb18d4cecf0.zip
fix all warnings in gtk dir & set the "treat all warnings as errors" MSVC flag
svn path=/trunk/; revision=21080
Diffstat (limited to 'gtk/sctp_graph_dlg.c')
-rw-r--r--gtk/sctp_graph_dlg.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/gtk/sctp_graph_dlg.c b/gtk/sctp_graph_dlg.c
index cfe547f039..1e3ff9a1d5 100644
--- a/gtk/sctp_graph_dlg.c
+++ b/gtk/sctp_graph_dlg.c
@@ -363,8 +363,8 @@ static void sctp_graph_draw(struct sctp_udata *u_data)
}
else
{
- u_data->io->min_x=u_data->io->x1_tmp_sec*1000000.0+u_data->io->x1_tmp_usec;
- u_data->io->max_x=u_data->io->x2_tmp_sec*1000000.0+u_data->io->x2_tmp_usec;
+ u_data->io->min_x=((guint32)(u_data->io->x1_tmp_sec*1000000.0))+u_data->io->x1_tmp_usec;
+ u_data->io->max_x=((guint32)(u_data->io->x2_tmp_sec*1000000.0))+u_data->io->x2_tmp_usec;
u_data->io->uoff = FALSE;
}
@@ -946,10 +946,10 @@ on_button_press (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_udata
{
gdk_draw_rectangle(u_data->io->pixmap,u_data->io->draw_area->style->white_gc,
FALSE,
- floor(MIN(u_data->io->x_old,u_data->io->x_new)),
- floor(MIN(u_data->io->y_old,u_data->io->y_new)),
- floor(abs((long)(u_data->io->x_new-u_data->io->x_old))),
- floor(abs((long)(u_data->io->y_new-u_data->io->y_old))));
+ (gint) floor(MIN(u_data->io->x_old,u_data->io->x_new)),
+ (gint) floor(MIN(u_data->io->y_old,u_data->io->y_new)),
+ (gint) floor(abs((long)(u_data->io->x_new-u_data->io->x_old))),
+ (gint) floor(abs((long)(u_data->io->y_new-u_data->io->y_old))));
ios=(sctp_graph_t *)OBJECT_GET_DATA(u_data->io->draw_area, "sctp_graph_t");
if(!ios){
@@ -1014,10 +1014,10 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
event->x = LEFT_BORDER+u_data->io->offset;
if (abs((long)(event->x-u_data->io->x_old))>10 || abs((long)(event->y-u_data->io->y_old))>10)
{
- u_data->io->rect_x_min = floor(MIN(u_data->io->x_old,event->x));
- u_data->io->rect_x_max = ceil(MAX(u_data->io->x_old,event->x));
- u_data->io->rect_y_min = floor(MIN(u_data->io->y_old,event->y));
- u_data->io->rect_y_max = ceil(MAX(u_data->io->y_old,event->y))+POINT_SIZE;
+ u_data->io->rect_x_min = (gint) floor(MIN(u_data->io->x_old,event->x));
+ u_data->io->rect_x_max = (gint) ceil(MAX(u_data->io->x_old,event->x));
+ u_data->io->rect_y_min = (gint) floor(MIN(u_data->io->y_old,event->y));
+ u_data->io->rect_y_max = (gint) ceil(MAX(u_data->io->y_old,event->y))+POINT_SIZE;
gdk_draw_rectangle(u_data->io->pixmap,u_data->io->draw_area->style->black_gc,
FALSE,
u_data->io->rect_x_min, u_data->io->rect_y_min,
@@ -1037,8 +1037,8 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
u_data->io->draw_area->allocation.width,
u_data->io->draw_area->allocation.height);
- x1_tmp=floor(u_data->io->min_x+((u_data->io->x_old-LEFT_BORDER-u_data->io->offset)*u_data->io->tmp_width/u_data->io->axis_width));
- x2_tmp=floor(u_data->io->min_x+((event->x-LEFT_BORDER-u_data->io->offset)*u_data->io->tmp_width/u_data->io->axis_width));
+ x1_tmp=(gint) floor(u_data->io->min_x+((u_data->io->x_old-LEFT_BORDER-u_data->io->offset)*u_data->io->tmp_width/u_data->io->axis_width));
+ x2_tmp=(gint) floor(u_data->io->min_x+((event->x-LEFT_BORDER-u_data->io->offset)*u_data->io->tmp_width/u_data->io->axis_width));
helpx=MIN(x1_tmp, x2_tmp);
if (helpx==x2_tmp)
{
@@ -1101,13 +1101,13 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
else
{
x_value = ((event->x-LEFT_BORDER-u_data->io->offset) * ((u_data->io->x2_tmp_sec+u_data->io->x2_tmp_usec/1000000.0)-(u_data->io->x1_tmp_sec+u_data->io->x1_tmp_usec/1000000.0)) / (u_data->io->pixmap_width-LEFT_BORDER-u_data->io->offset))+u_data->io->x1_tmp_sec+u_data->io->x1_tmp_usec/1000000.0;
- y_value = floor((u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset-event->y) * (max_tsn - min_tsn) / (u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)) + min_tsn;
+ y_value = (gint) floor((u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset-event->y) * (max_tsn - min_tsn) / (u_data->io->pixmap_height-BOTTOM_BORDER-u_data->io->offset)) + min_tsn;
text_color = u_data->io->draw_area->style->black_gc;
g_snprintf(label_string, 30, "(%.6f, %u)", x_value, y_value);
label_set = TRUE;
- gdk_draw_line(u_data->io->pixmap,text_color, event->x-2, event->y, event->x+2, event->y);
- gdk_draw_line(u_data->io->pixmap,text_color, event->x, event->y-2, event->x, event->y+2);
+ gdk_draw_line(u_data->io->pixmap,text_color, (gint)(event->x-2), (gint)(event->y), (gint)(event->x+2), (gint)(event->y));
+ gdk_draw_line(u_data->io->pixmap,text_color, (gint)(event->x), (gint)(event->y-2), (gint)(event->x), (gint)(event->y+2));
if (event->x+150>=u_data->io->pixmap_width)
position = event->x - 150;
else
@@ -1116,8 +1116,8 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
#if GTK_MAJOR_VERSION < 2
lwidth=gdk_string_width(font, label_string);
gdk_draw_string(u_data->io->pixmap,font,text_color,
- position,
- event->y-10,
+ (gint) (position),
+ (gint) (event->y-10),
label_string);
#else
memcpy(label_string,(gchar *)g_locale_to_utf8(label_string, -1 , NULL, NULL, NULL), 15);
@@ -1125,10 +1125,10 @@ on_button_release (GtkWidget *widget _U_, GdkEventButton *event, struct sctp_uda
pango_layout_get_pixel_size(layout, &lwidth, NULL);
gdk_draw_layout(u_data->io->pixmap,text_color,
- position,
- event->y-10,
+ (gint) (position),
+ (gint) (event->y-10),
layout);
- #endif
+#endif
ios=(sctp_graph_t *)OBJECT_GET_DATA(u_data->io->draw_area, "sctp_graph_t");
if(!ios){