summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2010-05-31 00:50:50 +0200
committerDaniel Elstner <danielk@openismus.com>2010-05-31 00:50:50 +0200
commitf510673363137d691f5063bc68d9fa7bb3ef9709 (patch)
treef7e55a8269dbdbc57a8232c1b6ff2e0dd7f16e05
parent2b782d7786bb061bb3ea4d3fe9156729851a0ed7 (diff)
downloadglibmm-f510673363137d691f5063bc68d9fa7bb3ef9709.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 b785a7b8..17f373f4 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-28 José Alburquerque <jaalburqu@svn.gnome.org>
Settings: Add [get|set]_strv().
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