OSDN Git Service

Some code clean-up.
authorLoRd_MuldeR <mulder2@gmx.de>
Sat, 26 Oct 2013 13:49:16 +0000 (15:49 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Sat, 26 Oct 2013 13:49:16 +0000 (15:49 +0200)
etc/Translation/Blank.ts
etc/Translation/LameXP_PL.ts
etc/Translation/LameXP_SV.ts
src/Config.h
src/Global.cpp

index 8242633..2a535d2 100644 (file)
 <context>
     <name>QApplication</name>
     <message>
-        <location filename="../../src/Global.cpp" line="1442"/>
+        <location filename="../../src/Global.cpp" line="1415"/>
         <source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1384"/>
+        <location filename="../../src/Global.cpp" line="1357"/>
         <source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1389"/>
+        <location filename="../../src/Global.cpp" line="1362"/>
         <source>Executable &apos;%1&apos; was built for Qt &apos;%2&apos;, but found Qt &apos;%3&apos;.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1401"/>
+        <location filename="../../src/Global.cpp" line="1374"/>
         <source>Executable &apos;%1&apos; requires Windows XP or later.</source>
         <translation type="unfinished"></translation>
     </message>
index 9bcda36..ac96405 100644 (file)
 <context>
     <name>QApplication</name>
     <message>
-        <location filename="../../src/Global.cpp" line="1442"/>
+        <location filename="../../src/Global.cpp" line="1415"/>
         <source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
         <translation type="unfinished">Plik wykonywalny &apos;%1&apos; nie działa w trybie kompatybilności z Windows.</translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1384"/>
+        <location filename="../../src/Global.cpp" line="1357"/>
         <source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
         <translation type="unfinished">Plik wykonywalny &apos;%1&apos; wymaga Qt v%2, znaleziono jednak Qt v%3.</translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1389"/>
+        <location filename="../../src/Global.cpp" line="1362"/>
         <source>Executable &apos;%1&apos; was built for Qt &apos;%2&apos;, but found Qt &apos;%3&apos;.</source>
         <translation type="unfinished">Plik wykonywalny &quot;%1&quot; został skompilowany dla Qt &quot;%2&quot;, znaleziono &quot;%3&quot;.</translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1401"/>
+        <location filename="../../src/Global.cpp" line="1374"/>
         <source>Executable &apos;%1&apos; requires Windows XP or later.</source>
         <translation type="unfinished"></translation>
     </message>
index 977e571..862fa8c 100644 (file)
 <context>
     <name>QApplication</name>
     <message>
-        <location filename="../../src/Global.cpp" line="1442"/>
+        <location filename="../../src/Global.cpp" line="1415"/>
         <source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
         <translation>EXE-filen &apos;%1&apos; stöder inte Windows kompatibilitetsläge.</translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1384"/>
+        <location filename="../../src/Global.cpp" line="1357"/>
         <source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
         <translation>EXE-filen &apos;%1&apos; kräver Qt v%2, du har Qt v%3.</translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1389"/>
+        <location filename="../../src/Global.cpp" line="1362"/>
         <source>Executable &apos;%1&apos; was built for Qt &apos;%2&apos;, but found Qt &apos;%3&apos;.</source>
         <translation>EXE-filen &apos;%1&apos; är byggd för Qt &apos;%2&apos;, du har Qt &apos;%3&apos;.</translation>
     </message>
     <message>
-        <location filename="../../src/Global.cpp" line="1401"/>
+        <location filename="../../src/Global.cpp" line="1374"/>
         <source>Executable &apos;%1&apos; requires Windows XP or later.</source>
         <translation type="unfinished"></translation>
     </message>
index fcfd7e0..a0b30a9 100644 (file)
@@ -35,7 +35,7 @@
 #define VER_LAMEXP_MINOR_LO                                    9
 #define VER_LAMEXP_TYPE                                                Alpha
 #define VER_LAMEXP_PATCH                                       4
-#define VER_LAMEXP_BUILD                                       1426
+#define VER_LAMEXP_BUILD                                       1427
 #define VER_LAMEXP_CONFG                                       1348
 
 ///////////////////////////////////////////////////////////////////////////////
index 0282976..1172235 100644 (file)
@@ -1060,29 +1060,22 @@ lamexp_cpu_t lamexp_detect_cpu_features(const QStringList &argv)
  */
 static __forceinline bool lamexp_check_for_debugger(void)
 {
-       if(IsDebuggerPresent())
-       {
-               return true;
-       }
-       
        __try
        {
-               CloseHandle((HANDLE) 0x7FFFFFFF);
+               CloseHandle((HANDLE)((DWORD_PTR)-3));
        }
-       __except(EXCEPTION_EXECUTE_HANDLER)
+       __except(1)
        {
                return true;
        }
-
        __try 
        {
-               DebugBreak();
+               __debugbreak();
        }
-       __except(EXCEPTION_EXECUTE_HANDLER
+       __except(1
        {
-               return false;
+               return IsDebuggerPresent();
        }
-       
        return true;
 }
 
@@ -1099,7 +1092,7 @@ static unsigned int __stdcall lamexp_debug_thread_proc(LPVOID lpParameter)
                        lamexp_fatal_exit(L"Not a debug build. Please unload debugger and try again!");
                        return 666;
                }
-               lamexp_sleep(1);
+               lamexp_sleep(100);
        }
 }
 
@@ -1112,31 +1105,11 @@ static HANDLE lamexp_debug_thread_init()
        {
                lamexp_fatal_exit(L"Not a debug build. Please unload debugger and try again!");
        }
-
-       return (HANDLE) _beginthreadex(NULL, 0, lamexp_debug_thread_proc, NULL, 0, NULL);
+       const uintptr_t h = _beginthreadex(NULL, 0, lamexp_debug_thread_proc, NULL, 0, NULL);
+       return (HANDLE)(h^0xdeadbeef);
 }
 
 /*
- * Check for compatibility mode
- */
-//static bool lamexp_check_compatibility_mode(const char *exportName, const QString &executableName)
-//{
-//     QLibrary kernel32("kernel32.dll");
-//
-//     if((exportName != NULL) && kernel32.load())
-//     {
-//             if(kernel32.resolve(exportName) != NULL)
-//             {
-//                     qWarning("Function '%s' exported from 'kernel32.dll' -> Windows compatibility mode!", exportName);
-//                     qFatal("%s", QApplication::tr("Executable '%1' doesn't support Windows compatibility mode.").arg(executableName).toLatin1().constData());
-//                     return false;
-//             }
-//     }
-//
-//     return true;
-//}
-
-/*
  * Computus according to H. Lichtenberg
  */
 static bool lamexp_computus(const QDate &date)
@@ -3257,7 +3230,7 @@ void lamexp_finalization(void)
 /*
  * Initialize debug thread
  */
-static const HANDLE g_debug_thread = LAMEXP_DEBUG ? NULL : lamexp_debug_thread_init();
+static const HANDLE g_debug_thread1 = LAMEXP_DEBUG ? NULL : lamexp_debug_thread_init();
 
 /*
  * Get number private bytes [debug only]