Wireshark-dev: [Wireshark-dev] problem with gtk/rtp_player.c
From: Ed Beroset <beroset@xxxxxxxxxxxxxx>
Date: Tue, 28 Dec 2010 17:23:45 -0500 (GMT-05:00)
Under Windows, the recent changes made to gtk/rtp_player.c cause the 2008 version of VC++ to die with a warning that assigning a double to time_t could cause a loss of precision.  I changed it by adding an explicit cast to guint64. This is the old problem with doing math on time -- time_t is an unspecified kind of numerical type.  My Linux box accepts either version.

Index: gtk/rtp_player.c
===================================================================
--- gtk/rtp_player.c    (revision 35292)
+++ gtk/rtp_player.c    (working copy)
@@ -1377,7 +1377,7 @@
                                        rci->draw_area->allocation.height-HEIGHT_TIME_LABEL+4);
 
                                if(GTK_TOGGLE_BUTTON(cb_view_as_time_of_day)->active) {
-                                       seconds = nstime_to_sec(&rci->start_time_abs) + i * MULT / SAMPLE_RATE;
+                                       seconds = (guint64)(nstime_to_sec(&rci->start_time_abs) + i * MULT / SAMPLE_RATE);
                                        timestamp = localtime(&seconds);
                                        g_snprintf(label_string, MAX_TIME_LABEL, "%02d:%02d:%02d", timestamp->tm_hour, timestamp->tm_min, timestamp->tm_sec);
                                } else {



Ed