diff options
author | Daniel Elstner <danielk@openismus.com> | 2010-05-31 00:50:50 +0200 |
---|---|---|
committer | Daniel Elstner <danielk@openismus.com> | 2010-05-31 00:50:50 +0200 |
commit | f510673363137d691f5063bc68d9fa7bb3ef9709 (patch) | |
tree | f7e55a8269dbdbc57a8232c1b6ff2e0dd7f16e05 | |
parent | 2b782d7786bb061bb3ea4d3fe9156729851a0ed7 (diff) | |
download | glibmm-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | glib/glibmm/timeval.h | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -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 |