OSDN Git Service

Merge.cpp: cleanup
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 26 Apr 2018 11:03:23 +0000 (20:03 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Thu, 26 Apr 2018 11:03:23 +0000 (20:03 +0900)
Src/Merge.cpp

index cef647d..434cca5 100644 (file)
 #include "paths.h"
 #include "CompareStats.h"
 #include "TestMain.h"
-
-// For shutdown cleanup
-#include "charsets.h"
+#include "charsets.h" // For shutdown cleanup
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
 #endif
 
-
-
 /** @brief Location for command line help to open. */
-static TCHAR CommandLineHelpLocation[] = _T("::/htmlhelp/Command_line.html");
-
-// registry dir to WinMerge
-static String f_RegDir = _T("Software\\Thingamahoochie\\WinMerge");
+static const TCHAR CommandLineHelpLocation[] = _T("::/htmlhelp/Command_line.html");
 
 /** @brief Backup file extension. */
 static const TCHAR BACKUP_FILE_EXT[] = _T("bak");
 
-#ifndef WIN64
-/**
- * @brief Turn STL exceptions into MFC exceptions.
- * Based on the article "Visual C++ Exception-Handling Instrumentation"
- * by Eugene Gershnik, published at http://www.drdobbs.com/184416600.
- * Rethrow fix inspired by http://www.spinics.net/lists/wine/msg05996.html.
- */
-/*
-namespace Turn_STL_exceptions_into_MFC_exceptions
-{
-#      ifndef _STATIC_CPPLIB
-#      error This hack only works with _STATIC_CPPLIB defined.
-#      endif
-
-       class CDisguisedSTLException : public CException
-       {
-       private:
-               std::exception *m_pSTLException;
-       public:
-               CDisguisedSTLException(std::exception *pSTLException)
-               : m_pSTLException(pSTLException)
-               {
-               }
-               virtual BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError, PUINT)
-               {
-                       StringCchPrintf(lpszError, nMaxError, _T("%hs"), m_pSTLException->what());
-                       return TRUE;
-               }
-       };
-
-       const DWORD CPP_EXCEPTION = 0xE06D7363;
-       const DWORD MS_MAGIC = 0x19930520;
-
-       extern "C" void __stdcall _CxxThrowException(void *pObject, _s__ThrowInfo const *pObjectInfo)
-       {
-               __declspec(thread) static ULONG_PTR args[3] = { MS_MAGIC, 0, 0 };
-               if (pObject == NULL)
-               {
-                       pObject = reinterpret_cast<void *>(args[1]);
-                       pObjectInfo = reinterpret_cast<_s__ThrowInfo const *>(args[2]);
-               }
-               else
-               {
-                       args[1] = (ULONG_PTR)pObject;
-                       args[2] = (ULONG_PTR)pObjectInfo;
-               }
-               int i;
-               if (pObjectInfo->pCatchableTypeArray && (i = pObjectInfo->pCatchableTypeArray->nCatchableTypes))
-               {
-                       const char *name = typeid(std::exception).raw_name();
-                       if (pObjectInfo->pCatchableTypeArray->arrayOfCatchableTypes[i - 1]->pType->name == name)
-                       {
-                               throw new CDisguisedSTLException(static_cast<std::exception *>(pObject));
-                       }
-               }
-               RaiseException(CPP_EXCEPTION, EXCEPTION_NONCONTINUABLE, sizeof(args)/sizeof(args[0]), args);
-       }
-}
-*/
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // CMergeApp
 
@@ -158,7 +90,7 @@ BEGIN_MESSAGE_MAP(CMergeApp, CWinApp)
        ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
        ON_COMMAND(ID_HELP, OnHelp)
        ON_COMMAND_EX_RANGE(ID_FILE_PROJECT_MRU_FIRST, ID_FILE_PROJECT_MRU_LAST, OnOpenRecentFile)
-       ON_UPDATE_COMMAND_UI(ID_FILE_PROJECT_MRU_FIRST, &CWinApp::OnUpdateRecentFileMenu)
+       ON_UPDATE_COMMAND_UI(ID_FILE_PROJECT_MRU_FIRST, CWinApp::OnUpdateRecentFileMenu)
        ON_COMMAND(ID_FILE_MERGINGMODE, OnMergingMode)
        ON_UPDATE_COMMAND_UI(ID_FILE_MERGINGMODE, OnUpdateMergingMode)
        ON_UPDATE_COMMAND_UI(ID_STATUS_MERGINGMODE, OnUpdateMergingStatus)