summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2010-05-31 00:50:50 +0200
committerMurray Cumming <murrayc@murrayc.com>2010-05-31 11:41:09 +0200
commit5dabbc18913738b4b0dd0277442f95474bcb7a1b (patch)
tree7e7f418255add9cde62fd7ff06591ba5fc8a2fc0
parent0e1267d75549379bea9f702df52e2d35746be132 (diff)
downloadglibmm-5dabbc18913738b4b0dd0277442f95474bcb7a1b.tar.gz
Avoid compiler warning in TimeVal::as_double()
* glib/glibmm/timeval.h (TimeVal::as_double): Cast long int operands to double explicitly, to avoid a conversion warning due to possible loss of precision. Reported by Alexander Shaduri, GNOME bug #617463.
-rw-r--r--ChangeLog8
-rw-r--r--glib/glibmm/timeval.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 08d6d6bd..85c35393 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-30 Daniel Elstner <danielk@openismus.com>
+
+ Avoid compiler warning in TimeVal::as_double()
+
+ * glib/glibmm/timeval.h (TimeVal::as_double): Cast long int operands
+ to double explicitly, to avoid a conversion warning due to possible
+ loss of precision. Reported by Alexander Shaduri, GNOME bug #617463.
+
2010-05-25 José Alburquerque <jaalburqu@svn.gnome.org>
Add _IGNORE's for g_iconv().
diff --git a/glib/glibmm/timeval.h b/glib/glibmm/timeval.h
index 685f7832..8897ee1c 100644
--- a/glib/glibmm/timeval.h
+++ b/glib/glibmm/timeval.h
@@ -157,7 +157,7 @@ TimeVal& TimeVal::operator-=(long seconds)
inline
double TimeVal::as_double() const
{
- return tv_sec + ((double) tv_usec / (double) G_USEC_PER_SEC);
+ return double(tv_sec) + double(tv_usec) / double(G_USEC_PER_SEC);
}
inline