aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/sctp_graph_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2007-05-22 23:56:52 +0000
committerGuy Harris <guy@alum.mit.edu>2007-05-22 23:56:52 +0000
commitee3d6b43d530be13d9e0d0fca5ccd261fe06e19b (patch)
tree2af7e71a60f08f58aa3aa050973308dec03344c0 /gtk/sctp_graph_dlg.c
parent49849c691e65d4e7da0fc1e0138f1f7e42042965 (diff)
downloadwireshark-ee3d6b43d530be13d9e0d0fca5ccd261fe06e19b.tar.gz
wireshark-ee3d6b43d530be13d9e0d0fca5ccd261fe06e19b.tar.bz2
wireshark-ee3d6b43d530be13d9e0d0fca5ccd261fe06e19b.zip
Put back some casts, and don't use rint() on Windows, in the hopes of
clearing up at least some buildbot errors on Windows. svn path=/trunk/; revision=21900
Diffstat (limited to 'gtk/sctp_graph_dlg.c')
-rw-r--r--gtk/sctp_graph_dlg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/sctp_graph_dlg.c b/gtk/sctp_graph_dlg.c
index 7446e85227..f9f306614e 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;
}
@@ -1105,7 +1105,16 @@ 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-RIGHT_BORDER-u_data->io->offset))+u_data->io->x1_tmp_sec+u_data->io->x1_tmp_usec/1000000.0;
+#ifdef _WIN32
+ /*
+ * The MSVC version used in the buildbot doesn't have
+ * rint(). (There may be UN*X environments without
+ * rint(), too, in which case we'll stop using it.)
+ */
+ 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;
+#else
y_value = (gint)rint((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;
+#endif
text_color = u_data->io->draw_area->style->black_gc;
if (u_data->dir == 1)