diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2011-07-19 02:28:42 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2011-07-19 02:28:42 +0400 |
commit | 1f5d60ba01526cb1e5a22e10030a4d1ec8ff2727 (patch) | |
tree | 9ea18db4a417264883b90d738bb70cf409af58c2 /intern/ghost | |
parent | 7de78a812c633e268d96fd0881004f1e126089ed (diff) |
patch: [#27783] "Problem with clock" at 18:39:00 by Daniel Dionne (mrzeon)
the overflow of the clock was causing crash in the game engine in Linux.
(on June 11 2011, 18:39:00 GMT)
running to the "where is waldo (wally)" bug award of 2011.
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 3ebd24c008b..dd296fa979c 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -150,8 +150,9 @@ GHOST_SystemX11( if (gettimeofday(&tv,NULL) == -1) { GHOST_ASSERT(false,"Could not instantiate timer!"); } - - m_start_time = GHOST_TUns64(tv.tv_sec*1000 + tv.tv_usec/1000); + + // Taking care not to overflow the tv.tv_sec*1000 + m_start_time = GHOST_TUns64(tv.tv_sec)*1000 + tv.tv_usec/1000; /* use detectable autorepeate, mac and windows also do this */ @@ -199,7 +200,8 @@ getMilliSeconds( GHOST_ASSERT(false,"Could not compute time!"); } - return GHOST_TUns64(tv.tv_sec*1000 + tv.tv_usec/1000) - m_start_time; + // Taking care not to overflow the tv.tv_sec*1000 + return GHOST_TUns64(tv.tv_sec)*1000 + tv.tv_usec/1000 - m_start_time; } GHOST_TUns8 |