diff options
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/CMakeLists.txt | 21 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 8 |
2 files changed, 20 insertions, 9 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 41c70b7cd16..ccd763ef42c 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -37,9 +37,8 @@ set(INC_SYS set(SRC intern/GHOST_Buttons.cpp - intern/GHOST_CallbackEventConsumer.cpp intern/GHOST_C-api.cpp - intern/GHOST_Path-api.cpp + intern/GHOST_CallbackEventConsumer.cpp intern/GHOST_DisplayManager.cpp intern/GHOST_EventManager.cpp intern/GHOST_ISystem.cpp @@ -47,6 +46,7 @@ set(SRC intern/GHOST_ModifierKeys.cpp intern/GHOST_NDOFManager.cpp intern/GHOST_Path-api.cpp + intern/GHOST_Path-api.cpp intern/GHOST_Rect.cpp intern/GHOST_System.cpp intern/GHOST_TimerManager.cpp @@ -63,6 +63,7 @@ set(SRC GHOST_Path-api.h GHOST_Rect.h GHOST_Types.h + intern/GHOST_Buttons.h intern/GHOST_CallbackEventConsumer.h intern/GHOST_Debug.h @@ -146,7 +147,9 @@ if(WITH_HEADLESS OR WITH_GHOST_SDL) ) endif() - list(APPEND INC_SYS ${SDL_INCLUDE_DIR}) + list(APPEND INC_SYS + ${SDL_INCLUDE_DIR} + ) elseif(APPLE) if(WITH_COCOA) @@ -185,7 +188,9 @@ elseif(UNIX) add_definitions(-DWITH_X11_XINPUT) endif() - list(APPEND INC_SYS ${X11_X11_INCLUDE_PATH}) + list(APPEND INC_SYS + ${X11_X11_INCLUDE_PATH} + ) list(APPEND SRC intern/GHOST_DisplayManagerX11.cpp @@ -205,7 +210,9 @@ elseif(UNIX) if(X11_XF86keysym_INCLUDE_PATH) add_definitions(-DWITH_XF86KEYSYM) - list(APPEND INC_SYS ${X11_XF86keysym_INCLUDE_PATH}) + list(APPEND INC_SYS + ${X11_XF86keysym_INCLUDE_PATH} + ) endif() elseif(WIN32) @@ -213,7 +220,9 @@ elseif(WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") endif() - list(APPEND INC_SYS ${WINTAB_INC}) + list(APPEND INC_SYS + ${WINTAB_INC} + ) list(APPEND SRC intern/GHOST_DisplayManagerWin32.cpp 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 |