• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XKeymacs for 64bit Windows


Commit MetaInfo

Revisão6d0ba6d7e3d96d3503c139ee1d04c4eb1dd06bea (tree)
Hora2011-05-27 08:38:38
AutorKazuhiro Fujieda <fujieda@user...>
CommiterKazuhiro Fujieda

Mensagem de Log

Remove typedef of Translate_t and the declaration of struct
Translate and enum Instance in xkeymacs/xkeymacs.h. Remove
m_Instance in CXkeymacsApp. Remove CXkeymacsApp::OnAppAbout.

Mudança Sumário

Diff

--- a/xkeymacs/dotxkeymacs.cpp
+++ b/xkeymacs/dotxkeymacs.cpp
@@ -5,7 +5,6 @@
55 #include "stdafx.h"
66 #include <direct.h>
77 #include <Shlwapi.h>
8-#include "xkeymacs.h"
98 #include "DotXkeymacs.h"
109
1110 #ifdef _DEBUG
@@ -276,10 +275,13 @@ LPCTSTR CDotXkeymacs::GetLanguage()
276275 LPVOID lpData = malloc(dwLen);
277276
278277 if (lpData && GetFileVersionInfo(lptstrFilename, NULL, dwLen, lpData)) {
279- Translate_t *lpTranslate;
278+ struct Translate {
279+ WORD wLanguage;
280+ WORD wCodePage;
281+ } *lpTranslate;
280282 UINT cbTranslate = 0;
281283
282- if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate) && sizeof(Translate_t) <= cbTranslate) {
284+ if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate) && sizeof(Translate) <= cbTranslate) {
283285 for (int i = 0; i < sizeof(Languages)/sizeof(Languages[0]); ++i) {
284286 if (Languages[i].wLanguage == lpTranslate->wLanguage) {
285287 szLanguage = Languages[i].szLanguage;
--- a/xkeymacs/xkeymacs.cpp
+++ b/xkeymacs/xkeymacs.cpp
@@ -17,13 +17,9 @@ static char THIS_FILE[] = __FILE__;
1717
1818 BEGIN_MESSAGE_MAP(CXkeymacsApp, CWinApp)
1919 //{{AFX_MSG_MAP(CXkeymacsApp)
20- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
2120 // NOTE - the ClassWizard will add and remove mapping macros here.
2221 // DO NOT EDIT what you see in these blocks of generated code!
2322 //}}AFX_MSG_MAP
24- // Standard file based document commands
25- ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
26- ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
2723 END_MESSAGE_MAP()
2824
2925 /////////////////////////////////////////////////////////////////////////////
@@ -31,7 +27,7 @@ END_MESSAGE_MAP()
3127
3228 CXkeymacsApp::CXkeymacsApp()
3329 {
34- m_Instance = FirstInstance;
30+ m_hMutex = NULL;
3531 }
3632
3733 /////////////////////////////////////////////////////////////////////////////
@@ -55,10 +51,9 @@ BOOL CXkeymacsApp::InitInstance()
5551 #else
5652 m_hMutex = CreateMutex(FALSE, 0, CString(MAKEINTRESOURCE(AFX_IDS_APP_TITLE)));
5753 #endif
58-
59- if (::GetLastError() == ERROR_ALREADY_EXISTS) {
60- m_Instance = SecondInstance;
61- CloseHandle( m_hMutex );
54+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
55+ CloseHandle(m_hMutex);
56+ m_hMutex = NULL;
6257 return FALSE;
6358 }
6459
@@ -129,9 +124,12 @@ CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
129124 wRevisionVersion = (WORD)((pInfo->dwProductVersionLS ) & 0xffff);
130125 }
131126
132- Translate_t *lpTranslate = NULL;
127+ struct Translate {
128+ WORD wLanguage;
129+ WORD wCodePage;
130+ } *lpTranslate = NULL;
133131 UINT cbTranslate = 0;
134- if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate) && sizeof(Translate_t) <= cbTranslate) {
132+ if (VerQueryValue(lpData, _T("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate) && sizeof(Translate) <= cbTranslate) {
135133 LPVOID lpLegalCopyright = NULL;
136134 UINT uLen = 0;
137135 CString SubBlock;
@@ -180,22 +178,15 @@ BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
180178 //}}AFX_MSG_MAP
181179 END_MESSAGE_MAP()
182180
183-// App command to run the dialog
184-void CXkeymacsApp::OnAppAbout()
185-{
186- CAboutDlg aboutDlg;
187- aboutDlg.DoModal();
188-}
189-
190181 /////////////////////////////////////////////////////////////////////////////
191182 // CXkeymacsApp message handlers
192183
193184
194185 int CXkeymacsApp::ExitInstance()
195186 {
196- if (m_Instance == FirstInstance) {
197- ReleaseMutex( m_hMutex );
198- CloseHandle( m_hMutex );
187+ if (m_hMutex) {
188+ ReleaseMutex(m_hMutex);
189+ CloseHandle(m_hMutex);
199190
200191 m_pMainWnd->DestroyWindow();
201192 delete m_pMainWnd;
--- a/xkeymacs/xkeymacs.h
+++ b/xkeymacs/xkeymacs.h
@@ -14,13 +14,6 @@
1414
1515 #include "resource.h" // main symbols
1616
17-enum Instance
18-{
19- FirstInstance,
20- SecondInstance,
21-};
22-
23-
2417 /////////////////////////////////////////////////////////////////////////////
2518 // CXkeymacsApp:
2619 // See xkeymacs.cpp for the implementation of this class
@@ -41,13 +34,11 @@ public:
4134
4235 // Implementation
4336 //{{AFX_MSG(CXkeymacsApp)
44- afx_msg void OnAppAbout();
4537 // NOTE - the ClassWizard will add and remove member functions here.
4638 // DO NOT EDIT what you see in these blocks of generated code !
4739 //}}AFX_MSG
4840 DECLARE_MESSAGE_MAP()
4941 private:
50- Instance m_Instance;
5142 HANDLE m_hMutex;
5243 };
5344
@@ -87,11 +78,6 @@ protected:
8778
8879 /////////////////////////////////////////////////////////////////////////////
8980
90-typedef struct Translate {
91- WORD wLanguage;
92- WORD wCodePage;
93-} Translate_t;
94-
9581 //{{AFX_INSERT_LOCATION}}
9682 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
9783