[Orxonox-commit 6466] r11115 - in code/trunk/src: external/bullet/LinearMath libraries/core libraries/util modules/overlays

landauf at orxonox.net landauf at orxonox.net
Sun Feb 14 18:08:13 CET 2016


Author: landauf
Date: 2016-02-14 18:08:13 +0100 (Sun, 14 Feb 2016)
New Revision: 11115

Modified:
   code/trunk/src/external/bullet/LinearMath/btAlignedAllocator.cpp
   code/trunk/src/external/bullet/LinearMath/btSerializer.h
   code/trunk/src/libraries/core/Core.cc
   code/trunk/src/libraries/core/GraphicsManager.cc
   code/trunk/src/libraries/util/SignalHandler.cc
   code/trunk/src/libraries/util/SignalHandler.h
   code/trunk/src/modules/overlays/GUIOverlay.cc
Log:
fixed code to compile in 64bit mode

Modified: code/trunk/src/external/bullet/LinearMath/btAlignedAllocator.cpp
===================================================================
--- code/trunk/src/external/bullet/LinearMath/btAlignedAllocator.cpp	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/external/bullet/LinearMath/btAlignedAllocator.cpp	2016-02-14 17:08:13 UTC (rev 11115)
@@ -66,7 +66,7 @@
 
   real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
   if (real) {
-    offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
+    offset = (alignment - (unsigned long long)(real + sizeof(void *))) & (alignment-1);
     ret = (void *)((real + sizeof(void *)) + offset);
     *((void **)(ret)-1) = (void *)(real);
   } else {

Modified: code/trunk/src/external/bullet/LinearMath/btSerializer.h
===================================================================
--- code/trunk/src/external/bullet/LinearMath/btSerializer.h	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/external/bullet/LinearMath/btSerializer.h	2016-02-14 17:08:13 UTC (rev 11115)
@@ -247,7 +247,7 @@
 				cp++;
 			}
 			{
-				nr= (long)cp;
+				nr= (long long)cp;
 			//	long mask=3;
 				nr= ((nr+3)&~3)-nr;
 				while (nr--)
@@ -282,7 +282,7 @@
 			}
 
 		{
-				nr= (long)cp;
+				nr= (long long)cp;
 			//	long mask=3;
 				nr= ((nr+3)&~3)-nr;
 				while (nr--)

Modified: code/trunk/src/libraries/core/Core.cc
===================================================================
--- code/trunk/src/libraries/core/Core.cc	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/libraries/core/Core.cc	2016-02-14 17:08:13 UTC (rev 11115)
@@ -432,8 +432,8 @@
 
         unsigned int coreNr = limitToCPU - 1;
         // Get the current process core mask
-        DWORD procMask;
-        DWORD sysMask;
+        ULONG_PTR procMask;
+        ULONG_PTR sysMask;
 #  if _MSC_VER >= 1400 && defined (_M_X64)
         GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR)&procMask, (PDWORD_PTR)&sysMask);
 #  else

Modified: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/libraries/core/GraphicsManager.cc	2016-02-14 17:08:13 UTC (rev 11115)
@@ -319,8 +319,8 @@
 #if defined(ORXONOX_PLATFORM_WINDOWS)
         HWND hwnd;
         this->renderWindow_->getCustomAttribute("WINDOW", (void*)&hwnd);
-        LONG iconID = (LONG)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(101));
-        SetClassLong(hwnd, GCL_HICON, iconID);
+        LONG_PTR iconID = (LONG_PTR)LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(101));
+        SetClassLongPtr(hwnd, GCLP_HICON, iconID);
 #endif
 
 

Modified: code/trunk/src/libraries/util/SignalHandler.cc
===================================================================
--- code/trunk/src/libraries/util/SignalHandler.cc	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/libraries/util/SignalHandler.cc	2016-02-14 17:08:13 UTC (rev 11115)
@@ -721,7 +721,7 @@
 
         // Now print information about where the fault occured
         output += " at location " + SignalHandler::pointerToString(pExceptionRecord->ExceptionAddress);
-        if ((hModule = (HMODULE) SignalHandler::getModuleBase((DWORD) pExceptionRecord->ExceptionAddress)) && GetModuleFileName(hModule, szModule, MAX_PATH))
+        if ((hModule = (HMODULE) SignalHandler::getModuleBase(pExceptionRecord->ExceptionAddress)) && GetModuleFileName(hModule, szModule, MAX_PATH))
         {
             output += " in module ";
             output += SignalHandler::getModuleName(szModule);
@@ -747,11 +747,11 @@
 
     /// Retrieves the base address of the module that contains the specified address.
     // Code from Dr. Mingw by Jos\E9 Fonseca
-    /* static */ DWORD SignalHandler::getModuleBase(DWORD dwAddress)
+    /* static */ PVOID SignalHandler::getModuleBase(LPCVOID dwAddress)
     {
         MEMORY_BASIC_INFORMATION Buffer;
 
-        return VirtualQuery((LPCVOID) dwAddress, &Buffer, sizeof(Buffer)) ? (DWORD) Buffer.AllocationBase : 0;
+        return VirtualQuery(dwAddress, &Buffer, sizeof(Buffer)) ? Buffer.AllocationBase : 0;
     }
 
     /// Converts a value to string, formatted as pointer.

Modified: code/trunk/src/libraries/util/SignalHandler.h
===================================================================
--- code/trunk/src/libraries/util/SignalHandler.h	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/libraries/util/SignalHandler.h	2016-02-14 17:08:13 UTC (rev 11115)
@@ -119,7 +119,7 @@
             static LONG WINAPI exceptionFilter(PEXCEPTION_POINTERS pExceptionInfo);
 
             static std::string getModuleName(const std::string& path);
-            static DWORD getModuleBase(DWORD dwAddress);
+            static PVOID getModuleBase(LPCVOID dwAddress);
 
             template <typename T>
             static std::string pointerToString(T pointer, bool bFillZeros = true);

Modified: code/trunk/src/modules/overlays/GUIOverlay.cc
===================================================================
--- code/trunk/src/modules/overlays/GUIOverlay.cc	2016-02-14 16:13:03 UTC (rev 11114)
+++ code/trunk/src/modules/overlays/GUIOverlay.cc	2016-02-14 17:08:13 UTC (rev 11115)
@@ -72,7 +72,7 @@
 
         if (this->isVisible())
         {
-            const std::string& str = multi_cast<std::string>(reinterpret_cast<long>(this));
+            const std::string& str = multi_cast<std::string>(reinterpret_cast<long long>(this));
             GUIManager::getInstance().showGUIExtra(this->guiName_, str);
 
             orxout(verbose, context::misc::gui) << "Showing GUI " << this->guiName_ << endl;




More information about the Orxonox-commit mailing list