OSDN Git Service

Removed some obsolete compatibility code in lamexp_detect_cpu_features().
authorLoRd_MuldeR <mulder2@gmx.de>
Wed, 16 Oct 2013 01:29:43 +0000 (03:29 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Wed, 16 Oct 2013 01:29:43 +0000 (03:29 +0200)
src/Dialog_Processing.cpp
src/Global.cpp

index 349e8a8..69e32af 100644 (file)
@@ -316,14 +316,6 @@ ProcessingDialog::~ProcessingDialog(void)
                }
        }
 
-       //while(!m_threadList.isEmpty())
-       //{
-       //      ProcessThread *thread = m_threadList.takeFirst();
-       //      thread->terminate();
-       //      thread->wait(15000);
-       //      delete thread;
-       //}
-
        if(m_threadPool)
        {
                if(!m_threadPool->waitForDone(100))
index b89d307..ee74634 100644 (file)
@@ -754,10 +754,6 @@ void lamexp_init_console(const QStringList &argv)
 lamexp_cpu_t lamexp_detect_cpu_features(const QStringList &argv)
 {
        typedef BOOL (WINAPI *IsWow64ProcessFun)(__in HANDLE hProcess, __out PBOOL Wow64Process);
-       typedef VOID (WINAPI *GetNativeSystemInfoFun)(__out LPSYSTEM_INFO lpSystemInfo);
-       
-       static IsWow64ProcessFun IsWow64ProcessPtr = NULL;
-       static GetNativeSystemInfoFun GetNativeSystemInfoPtr = NULL;
 
        lamexp_cpu_t features;
        SYSTEM_INFO systemInfo;
@@ -816,36 +812,23 @@ lamexp_cpu_t lamexp_detect_cpu_features(const QStringList &argv)
        if(strlen(features.brand) < 1) strncpy_s(features.brand, 0x40, "Unknown", _TRUNCATE);
        if(strlen(features.vendor) < 1) strncpy_s(features.vendor, 0x40, "Unknown", _TRUNCATE);
 
-#if !defined(_M_X64 ) && !defined(_M_IA64)
-       if(!IsWow64ProcessPtr || !GetNativeSystemInfoPtr)
-       {
-               QLibrary Kernel32Lib("kernel32.dll");
-               IsWow64ProcessPtr = (IsWow64ProcessFun) Kernel32Lib.resolve("IsWow64Process");
-               GetNativeSystemInfoPtr = (GetNativeSystemInfoFun) Kernel32Lib.resolve("GetNativeSystemInfo");
-       }
-       if(IsWow64ProcessPtr)
+#if (!(defined(_M_X64) || defined(_M_IA64)))
+       QLibrary Kernel32Lib("kernel32.dll");
+       if(IsWow64ProcessFun IsWow64ProcessPtr = (IsWow64ProcessFun) Kernel32Lib.resolve("IsWow64Process"))
        {
-               BOOL x64 = FALSE;
-               if(IsWow64ProcessPtr(GetCurrentProcess(), &x64))
+               BOOL x64flag = FALSE;
+               if(IsWow64ProcessPtr(GetCurrentProcess(), &x64flag))
                {
-                       features.x64 = x64;
+                       features.x64 = (x64flag == TRUE);
                }
        }
-       if(GetNativeSystemInfoPtr)
-       {
-               GetNativeSystemInfoPtr(&systemInfo);
-       }
-       else
-       {
-               GetSystemInfo(&systemInfo);
-       }
-       features.count = qBound(1UL, systemInfo.dwNumberOfProcessors, 64UL);
 #else
-       GetNativeSystemInfo(&systemInfo);
-       features.count = systemInfo.dwNumberOfProcessors;
        features.x64 = true;
 #endif
 
+       GetNativeSystemInfo(&systemInfo);
+       features.count = qBound(1UL, systemInfo.dwNumberOfProcessors, 64UL);
+
        if(argv.count() > 0)
        {
                bool flag = false;