[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38495] trunk/blender/intern/ghost/intern/ GHOST_SystemX11.cpp: patch: [#27783] "Problem with clock" at 18:39: 00 by Daniel Dionne (mrzeon)
Dalai Felinto
dfelinto at gmail.com
Tue Jul 19 00:28:42 CEST 2011
Revision: 38495
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38495
Author: dfelinto
Date: 2011-07-18 22:28:42 +0000 (Mon, 18 Jul 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp
Modified: trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp 2011-07-18 20:31:08 UTC (rev 38494)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemX11.cpp 2011-07-18 22:28:42 UTC (rev 38495)
@@ -150,10 +150,11 @@
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 */
int use_xkb;
int xkb_opcode, xkb_event, xkb_error;
@@ -199,7 +200,8 @@
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
More information about the Bf-blender-cvs
mailing list