mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-28 01:57:14 +02:00
Fix off-by-one error. (#100853)
2002-12-11 Tor Lillqvist <tml@iki.fi> * glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
This commit is contained in:
committed by
Tor Lillqvist
parent
d7b6f09803
commit
2fbe8d8b5f
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
2002-12-11 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
|
||||
|
||||
2002-12-11 Pauli Virtanen <pauli.virtanen@hut.fi>
|
||||
|
||||
* configure.in: Added "fi" to ALL_LINGUAS.
|
||||
|
@@ -133,7 +133,7 @@ g_timer_elapsed (GTimer *timer,
|
||||
|
||||
/* Check for wraparound, which happens every 49.7 days. */
|
||||
if (timer->end < timer->start)
|
||||
total = (UINT_MAX - (timer->start - timer->end)) / 1000.0;
|
||||
total = (UINT_MAX - (timer->start - timer->end - 1)) / 1000.0;
|
||||
else
|
||||
total = (timer->end - timer->start) / 1000.0;
|
||||
|
||||
@@ -141,7 +141,7 @@ g_timer_elapsed (GTimer *timer,
|
||||
{
|
||||
if (timer->end < timer->start)
|
||||
*microseconds =
|
||||
((UINT_MAX - (timer->start - timer->end)) % 1000) * 1000;
|
||||
((UINT_MAX - (timer->start - timer->end - 1)) % 1000) * 1000;
|
||||
else
|
||||
*microseconds =
|
||||
((timer->end - timer->start) % 1000) * 1000;
|
||||
|
Reference in New Issue
Block a user