diff options
Diffstat (limited to 'CPP/7zip/UI')
37 files changed, 271 insertions, 277 deletions
diff --git a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp index 21549c90..e4aa4438 100755 --- a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +++ b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp @@ -118,4 +118,4 @@ HRESULT CUpdateCallbackAgent::ShowDeleteFile(const wchar_t *name) { return Callback->DeleteOperation(name); } -*/
\ No newline at end of file +*/ diff --git a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp index 93806717..f38cf874 100755 --- a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +++ b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp @@ -86,7 +86,7 @@ enum Enum kTechMode, kShareForWrite, kCaseSensitive, - kCalcCrc, + kCalcCrc }; } @@ -191,12 +191,12 @@ static const char *kSameTerminalError = "I won't write data and program's messag static void ThrowException(const char *errorMessage) { throw CArchiveCommandLineException(errorMessage); -}; +} static void ThrowUserErrorException() { ThrowException(kUserErrorMessage); -}; +} // --------------------------- diff --git a/CPP/7zip/UI/Common/Update.cpp b/CPP/7zip/UI/Common/Update.cpp index 4ed6049d..15da3a2f 100755 --- a/CPP/7zip/UI/Common/Update.cpp +++ b/CPP/7zip/UI/Common/Update.cpp @@ -82,7 +82,7 @@ public: STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize); STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition); - STDMETHOD(SetSize)(Int64 newSize); + STDMETHOD(SetSize)(UInt64 newSize); }; // static NSynchronization::CCriticalSection g_TempPathsCS; @@ -204,7 +204,7 @@ STDMETHODIMP COutMultiVolStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *n return S_OK; } -STDMETHODIMP COutMultiVolStream::SetSize(Int64 newSize) +STDMETHODIMP COutMultiVolStream::SetSize(UInt64 newSize) { if (newSize < 0) return E_INVALIDARG; @@ -905,4 +905,3 @@ HRESULT UpdateArchive( #endif return S_OK; } - diff --git a/CPP/7zip/UI/Common/UpdateAction.cpp b/CPP/7zip/UI/Common/UpdateAction.cpp index 845384fb..879a49c5 100755 --- a/CPP/7zip/UI/Common/UpdateAction.cpp +++ b/CPP/7zip/UI/Common/UpdateAction.cpp @@ -7,7 +7,7 @@ namespace NUpdateArchive { const CActionSet kAddActionSet = -{ +{{ NPairAction::kCopy, NPairAction::kCopy, NPairAction::kCompress, @@ -15,10 +15,10 @@ const CActionSet kAddActionSet = NPairAction::kCompress, NPairAction::kCompress, NPairAction::kCompress -}; +}}; const CActionSet kUpdateActionSet = -{ +{{ NPairAction::kCopy, NPairAction::kCopy, NPairAction::kCompress, @@ -26,10 +26,10 @@ const CActionSet kUpdateActionSet = NPairAction::kCompress, NPairAction::kCopy, NPairAction::kCompress -}; +}}; const CActionSet kFreshActionSet = -{ +{{ NPairAction::kCopy, NPairAction::kCopy, NPairAction::kIgnore, @@ -37,10 +37,10 @@ const CActionSet kFreshActionSet = NPairAction::kCompress, NPairAction::kCopy, NPairAction::kCompress -}; +}}; const CActionSet kSynchronizeActionSet = -{ +{{ NPairAction::kCopy, NPairAction::kIgnore, NPairAction::kCompress, @@ -48,10 +48,10 @@ const CActionSet kSynchronizeActionSet = NPairAction::kCompress, NPairAction::kCopy, NPairAction::kCompress, -}; +}}; const CActionSet kDeleteActionSet = -{ +{{ NPairAction::kCopy, NPairAction::kIgnore, NPairAction::kIgnore, @@ -59,6 +59,6 @@ const CActionSet kDeleteActionSet = NPairAction::kIgnore, NPairAction::kIgnore, NPairAction::kIgnore -}; +}}; } diff --git a/CPP/7zip/UI/Common/UpdateAction.h b/CPP/7zip/UI/Common/UpdateAction.h index 7da5ff2e..0ac1c108 100755 --- a/CPP/7zip/UI/Common/UpdateAction.h +++ b/CPP/7zip/UI/Common/UpdateAction.h @@ -19,6 +19,7 @@ namespace NUpdateArchive { kUnknowNewerFiles }; } + namespace NPairAction { enum EEnum @@ -29,6 +30,7 @@ namespace NUpdateArchive { kCompressAsAnti }; } + struct CActionSet { NPairAction::EEnum StateActions[NPairState::kNumValues]; @@ -44,14 +46,12 @@ namespace NUpdateArchive { return false; } }; + extern const CActionSet kAddActionSet; extern const CActionSet kUpdateActionSet; extern const CActionSet kFreshActionSet; extern const CActionSet kSynchronizeActionSet; extern const CActionSet kDeleteActionSet; -}; - +} #endif - - diff --git a/CPP/7zip/UI/Common/UpdateCallback.h b/CPP/7zip/UI/Common/UpdateCallback.h index 50803f52..9a20c315 100755 --- a/CPP/7zip/UI/Common/UpdateCallback.h +++ b/CPP/7zip/UI/Common/UpdateCallback.h @@ -24,8 +24,8 @@ virtual HRESULT SetOperationResult(Int32 operationResult) x; \ virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \ virtual HRESULT CryptoGetTextPassword(BSTR *password) x; \ - // virtual HRESULT ShowDeleteFile(const wchar_t *name) x; \ - // virtual HRESULT CloseProgress() { return S_OK; }; + /* virtual HRESULT ShowDeleteFile(const wchar_t *name) x; */ \ + /* virtual HRESULT CloseProgress() { return S_OK; }; */ struct IUpdateCallbackUI { diff --git a/CPP/7zip/UI/Console/BenchCon.cpp b/CPP/7zip/UI/Console/BenchCon.cpp index 96997dcb..35e868c9 100755 --- a/CPP/7zip/UI/Console/BenchCon.cpp +++ b/CPP/7zip/UI/Console/BenchCon.cpp @@ -76,7 +76,7 @@ static void PrintNumber(FILE *f, UInt64 value, int size) fprintf(f, " "); for (int len = (int)strlen(s); len < size; len++) fprintf(f, " "); - fprintf(f, "%s", s); + fputs(s, f); } static void PrintRating(FILE *f, UInt64 rating) @@ -134,7 +134,7 @@ HRESULT CBenchCallback::SetDecodeResult(const CBenchInfo &info, bool final) if (final) { UInt64 rating = GetDecompressRating(info.GlobalTime, info.GlobalFreq, info.UnpackSize, info.PackSize, info.NumIterations); - fprintf(f, kSep); + fputs(kSep, f); CBenchInfo info2 = info; info2.UnpackSize *= info2.NumIterations; info2.PackSize *= info2.NumIterations; @@ -191,14 +191,14 @@ HRESULT LzmaBenchCon( { fprintf(f, " Speed Usage R/U Rating"); if (j == 0) - fprintf(f, kSep); + fputs(kSep, f); } fprintf(f, "\n "); for (j = 0; j < 2; j++) { fprintf(f, " KB/s %% MIPS MIPS"); if (j == 0) - fprintf(f, kSep); + fputs(kSep, f); } fprintf(f, "\n\n"); for (UInt32 i = 0; i < numIterations; i++) diff --git a/CPP/7zip/UI/Far/CLSIDConst.cpp b/CPP/7zip/UI/Far/CLSIDConst.cpp deleted file mode 100755 index a6cea92e..00000000 --- a/CPP/7zip/UI/Far/CLSIDConst.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// CLSIDConst.cpp - -#include "StdAfx.h" - -#include <initguid.h> - -#include "../Agent/Agent.h" -#include "../../IPassword.h" diff --git a/CPP/7zip/UI/Far/ExtractEngine.cpp b/CPP/7zip/UI/Far/ExtractEngine.cpp index 02d14f83..b18eed59 100755 --- a/CPP/7zip/UI/Far/ExtractEngine.cpp +++ b/CPP/7zip/UI/Far/ExtractEngine.cpp @@ -57,20 +57,21 @@ STDMETHODIMP CExtractCallBackImp::AskOverwrite( Int32 *answer) { NOverwriteDialog::CFileInfo oldFileInfo, newFileInfo; - oldFileInfo.Time = *existTime; + oldFileInfo.TimeIsDefined = (existTime != 0); + if (oldFileInfo.TimeIsDefined) + oldFileInfo.Time = *existTime; oldFileInfo.SizeIsDefined = (existSize != NULL); if (oldFileInfo.SizeIsDefined) oldFileInfo.Size = *existSize; - oldFileInfo.Name = GetSystemString(existName, m_CodePage); + oldFileInfo.Name = existName; newFileInfo.TimeIsDefined = (newTime != 0); if (newFileInfo.TimeIsDefined) newFileInfo.Time = *newTime; - newFileInfo.SizeIsDefined = (newSize != NULL); if (newFileInfo.SizeIsDefined) newFileInfo.Size = *newSize; - newFileInfo.Name = GetSystemString(newName, m_CodePage); + newFileInfo.Name = newName; NOverwriteDialog::NResult::EEnum result = NOverwriteDialog::Execute(oldFileInfo, newFileInfo); diff --git a/CPP/7zip/UI/Far/Far.def b/CPP/7zip/UI/Far/Far.def index d96501e2..39f3a5e2 100755 --- a/CPP/7zip/UI/Far/Far.def +++ b/CPP/7zip/UI/Far/Far.def @@ -1,20 +1,34 @@ ; 7-ZipFar.def : Declares the module parameters for the DLL. LIBRARY "7-ZipFar" -DESCRIPTION '7-ZipFar Windows Dynamic Link Library' EXPORTS - SetStartupInfo = _SetStartupInfo@4 - OpenPlugin = _OpenPlugin@8 - OpenFilePlugin = _OpenFilePlugin@12 - ClosePlugin = _ClosePlugin@4 - GetFindData = _GetFindData@16 - FreeFindData = _FreeFindData@12 - SetDirectory = _SetDirectory@12 - GetPluginInfo = _GetPluginInfo@4 - Configure = _Configure@4 - GetOpenPluginInfo = _GetOpenPluginInfo@8 - GetFiles = _GetFiles@24 - PutFiles = _PutFiles@20 - DeleteFiles = _DeleteFiles@16 - ProcessKey = _ProcessKey@12 + SetStartupInfo + OpenPlugin + OpenFilePlugin + ClosePlugin + GetFindData + FreeFindData + SetDirectory + GetPluginInfo + Configure + GetOpenPluginInfo + GetFiles + PutFiles + DeleteFiles + ProcessKey + + ;SetStartupInfoW + ;OpenPluginW + ;OpenFilePluginW + ;ClosePluginW + ;GetFindDataW + ;FreeFindDataW + ;SetDirectoryW + ;GetPluginInfoW + ;ConfigureW + ;GetOpenPluginInfoW + ;GetFilesW + ;PutFilesW + ;DeleteFilesW + ;ProcessKeyW diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp index 0a96bc08..4609c82c 100755 --- a/CPP/7zip/UI/Far/Far.dsp +++ b/CPP/7zip/UI/Far/Far.dsp @@ -53,7 +53,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\Far\Plugins\7-Zip\7-ZipFar.dll" /opt:NOWIN98 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\Far2\Plugins\7-Zip\7-ZipFar.dll" /opt:NOWIN98 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "Far - Win32 Debug" @@ -80,7 +80,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Far\Plugins\7-Zip\7-ZipFar.dll" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Far2\Plugins\7-Zip\7-ZipFar.dll" /pdbtype:sept !ENDIF @@ -93,10 +93,6 @@ LINK32=link.exe # PROP Default_Filter "" # Begin Source File -SOURCE=.\CLSIDConst.cpp -# End Source File -# Begin Source File - SOURCE=.\Far.def # End Source File # Begin Source File diff --git a/CPP/7zip/UI/Far/FarPlugin.h b/CPP/7zip/UI/Far/FarPlugin.h index a1c9715b..1408ef21 100755 --- a/CPP/7zip/UI/Far/FarPlugin.h +++ b/CPP/7zip/UI/Far/FarPlugin.h @@ -1,18 +1,37 @@ // FarPlugin.h -#ifndef __FARPLUGIN_H -#define __FARPLUGIN_H +// #include "plugin.hpp" +const int kInfoPanelLineSize = 80; + +// #define __FAR_PLUGIN_H + +#ifdef UNDER_CE +typedef struct _CHAR_INFO { + union { + WCHAR UnicodeChar; + CHAR AsciiChar; + } Char; + WORD Attributes; +} CHAR_INFO, *PCHAR_INFO; +#endif + +#ifndef __FAR_PLUGIN_H +#define __FAR_PLUGIN_H + +#ifndef _WIN64 #if defined(__BORLANDC__) && (__BORLANDC <= 0x520) #pragma option -a1 #elif defined(__GNUC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1100)) #pragma pack(1) #else #pragma pack(push,1) +#endif +#endif + #if _MSC_VER #define _export #endif -#endif #define NM 260 @@ -41,8 +60,9 @@ struct PluginPanelItem char *Owner; char **CustomColumnData; int CustomColumnNumber; - DWORD UserData; - DWORD Reserved[3]; + DWORD_PTR UserData; + DWORD CRC32; + DWORD_PTR Reserved[2]; }; #define PPIF_PROCESSDESCR 0x80000000 @@ -58,7 +78,7 @@ enum { typedef int (WINAPI *FARAPIMENU)( - int PluginNumber, + INT_PTR PluginNumber, int X, int Y, int MaxHeight, @@ -73,7 +93,7 @@ typedef int (WINAPI *FARAPIMENU)( ); typedef int (WINAPI *FARAPIDIALOG)( - int PluginNumber, + INT_PTR PluginNumber, int X1, int Y1, int X2, @@ -92,7 +112,7 @@ enum { }; typedef int (WINAPI *FARAPIMESSAGE)( - int PluginNumber, + INT_PTR PluginNumber, unsigned int Flags, char *HelpTopic, char **Items, @@ -101,7 +121,7 @@ typedef int (WINAPI *FARAPIMESSAGE)( ); typedef char* (WINAPI *FARAPIGETMSG)( - int PluginNumber, + INT_PTR PluginNumber, int MsgId ); @@ -194,7 +214,8 @@ struct PanelInfo char CurDir[NM]; int ShortNames; int SortMode; - DWORD Reserved[2]; + DWORD Flags; + DWORD Reserved; }; @@ -222,7 +243,7 @@ typedef int (WINAPI *FARAPIGETDIRLIST)( ); typedef int (WINAPI *FARAPIGETPLUGINDIRLIST)( - int PluginNumber, + INT_PTR PluginNumber, HANDLE hPlugin, char *Dir, struct PluginPanelItem **pPanelItem, @@ -294,126 +315,11 @@ typedef int (WINAPI *FARAPIEDITORCONTROL)( void *Param ); - -enum EDITOR_EVENTS { - EE_READ,EE_SAVE,EE_REDRAW,EE_CLOSE -}; - -enum EDITOR_CONTROL_COMMANDS { - ECTL_GETSTRING,ECTL_SETSTRING,ECTL_INSERTSTRING,ECTL_DELETESTRING, - ECTL_DELETECHAR,ECTL_INSERTTEXT,ECTL_GETINFO,ECTL_SETPOSITION, - ECTL_SELECT,ECTL_REDRAW,ECTL_EDITORTOOEM,ECTL_OEMTOEDITOR, - ECTL_TABTOREAL,ECTL_REALTOTAB,ECTL_EXPANDTABS,ECTL_SETTITLE, - ECTL_READINPUT,ECTL_PROCESSINPUT,ECTL_ADDCOLOR,ECTL_GETCOLOR -}; - - -struct EditorGetString -{ - int StringNumber; - char *StringText; - char *StringEOL; - int StringLength; - int SelStart; - int SelEnd; -}; - - -struct EditorSetString -{ - int StringNumber; - char *StringText; - char *StringEOL; - int StringLength; -}; - - -enum EDITOR_OPTIONS { - EOPT_EXPANDTABS=1,EOPT_PERSISTENTBLOCKS=2,EOPT_DELREMOVESBLOCKS=4, - EOPT_AUTOINDENT=8,EOPT_SAVEFILEPOSITION=16,EOPT_AUTODETECTTABLE=32, - EOPT_CURSORBEYONDEOL=64 -}; - - -enum EDITOR_BLOCK_TYPES { - BTYPE_NONE,BTYPE_STREAM,BTYPE_COLUMN -}; - - -struct EditorInfo -{ - int EditorID; - char *FileName; - int WindowSizeX; - int WindowSizeY; - int TotalLines; - int CurLine; - int CurPos; - int CurTabPos; - int TopScreenLine; - int LeftPos; - int Overtype; - int BlockType; - int BlockStartLine; - int AnsiMode; - int TableNum; - DWORD Options; - int TabSize; - DWORD Reserved[8]; -}; - - -struct EditorSetPosition -{ - int CurLine; - int CurPos; - int CurTabPos; - int TopScreenLine; - int LeftPos; - int Overtype; -}; - - -struct EditorSelect -{ - int BlockType; - int BlockStartLine; - int BlockStartPos; - int BlockWidth; - int BlockHeight; -}; - - -struct EditorConvertText -{ - char *Text; - int TextLength; -}; - - -struct EditorConvertPos -{ - int StringNumber; - int SrcPos; - int DestPos; -}; - - -struct EditorColor -{ - int StringNumber; - int ColorItem; - int StartPos; - int EndPos; - int Color; -}; - - struct PluginStartupInfo { int StructSize; char ModuleName[NM]; - int ModuleNumber; + INT_PTR ModuleNumber; char *RootKey; FARAPIMENU Menu; FARAPIDIALOG Dialog; @@ -456,8 +362,6 @@ struct PluginInfo char *CommandPrefix; }; -const int kInfoPanelLineSize = 80; - struct InfoPanelLine { char Text[kInfoPanelLineSize]; @@ -567,6 +471,7 @@ enum OPERATION_MODES { OPM_DESCR=32 }; +#ifndef _WIN64 #if defined(__BORLANDC__) && (__BORLANDC <= 0x520) #pragma option -a. #elif defined(__GNUC__) || (defined(__WATCOMC__) && (__WATCOMC__ < 1100)) @@ -574,5 +479,41 @@ enum OPERATION_MODES { #else #pragma pack(pop) #endif +#endif + +/* +EXTERN_C_BEGIN + + void WINAPI _export ClosePluginW(HANDLE hPlugin); + int WINAPI _export CompareW(HANDLE hPlugin,const struct PluginPanelItem *Item1,const struct PluginPanelItem *Item2,unsigned int Mode); + int WINAPI _export ConfigureW(int ItemNumber); + int WINAPI _export DeleteFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); + void WINAPI _export ExitFARW(void); + void WINAPI _export FreeFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); + void WINAPI _export FreeVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); + int WINAPI _export GetFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t **DestPath,int OpMode); + int WINAPI _export GetFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,int OpMode); + int WINAPI _export GetMinFarVersionW(void); + void WINAPI _export GetOpenPluginInfoW(HANDLE hPlugin,struct OpenPluginInfo *Info); + void WINAPI _export GetPluginInfoW(struct PluginInfo *Info); + int WINAPI _export GetVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,const wchar_t *Path); + int WINAPI _export MakeDirectoryW(HANDLE hPlugin,const wchar_t **Name,int OpMode); + HANDLE WINAPI _export OpenFilePluginW(const wchar_t *Name,const unsigned char *Data,int DataSize,int OpMode); + HANDLE WINAPI _export OpenPluginW(int OpenFrom,INT_PTR Item); + int WINAPI _export ProcessDialogEventW(int Event,void *Param); + int WINAPI _export ProcessEditorEventW(int Event,void *Param); + int WINAPI _export ProcessEditorInputW(const INPUT_RECORD *Rec); + int WINAPI _export ProcessEventW(HANDLE hPlugin,int Event,void *Param); + int WINAPI _export ProcessHostFileW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); + int WINAPI _export ProcessKeyW(HANDLE hPlugin,int Key,unsigned int ControlState); + int WINAPI _export ProcessSynchroEventW(int Event,void *Param); + int WINAPI _export ProcessViewerEventW(int Event,void *Param); + int WINAPI _export PutFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t *SrcPath,int OpMode); + int WINAPI _export SetDirectoryW(HANDLE hPlugin,const wchar_t *Dir,int OpMode); + int WINAPI _export SetFindListW(HANDLE hPlugin,const struct PluginPanelItem *PanelItem,int ItemsNumber); + void WINAPI _export SetStartupInfoW(const struct PluginStartupInfo *Info); + +EXTERN_C_END +*/ #endif diff --git a/CPP/7zip/UI/Far/FarUtils.cpp b/CPP/7zip/UI/Far/FarUtils.cpp index 01de0233..b980d846 100755 --- a/CPP/7zip/UI/Far/FarUtils.cpp +++ b/CPP/7zip/UI/Far/FarUtils.cpp @@ -4,7 +4,10 @@ #include "Common/StringConvert.h" +#ifndef UNDER_CE #include "Windows/Console.h" +#endif +#include "Windows/Defs.h" #include "Windows/Error.h" #include "FarUtils.h" @@ -417,6 +420,9 @@ void PrintErrorMessage(const char *message, const wchar_t *text) bool WasEscPressed() { + #ifdef UNDER_CE + return false; + #else NConsole::CIn inConsole; HANDLE handle = ::GetStdHandle(STD_INPUT_HANDLE); if(handle == INVALID_HANDLE_VALUE) @@ -438,16 +444,16 @@ bool WasEscPressed() event.Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE) return true; } + #endif } void ShowErrorMessage(DWORD errorCode) { - CSysString message; + UString message; NError::MyFormatMessage(errorCode, message); - message.Replace(TEXT("\x0D"), TEXT("")); - message.Replace(TEXT("\x0A"), TEXT(" ")); - g_StartupInfo.ShowMessage(SystemStringToOemString(message)); - + message.Replace(L"\x0D", L""); + message.Replace(L"\x0A", L" "); + g_StartupInfo.ShowMessage(UnicodeStringToMultiByte(message, CP_OEMCP)); } void ShowLastErrorMessage() diff --git a/CPP/7zip/UI/Far/Main.cpp b/CPP/7zip/UI/Far/Main.cpp index 052f75f9..7cd7d5ee 100755 --- a/CPP/7zip/UI/Far/Main.cpp +++ b/CPP/7zip/UI/Far/Main.cpp @@ -21,8 +21,8 @@ using namespace NWindows; using namespace NFar; static const char *kCommandPrefix = "7-zip"; -static const char *kRegisrtryMainKeyName = ""; -static const char *kRegisrtryValueNameEnabled = "UsedByDefault3"; +static const TCHAR *kRegisrtryMainKeyName = TEXT(""); +static const TCHAR *kRegisrtryValueNameEnabled = TEXT("UsedByDefault3"); static const char *kHelpTopicConfig = "Config"; static bool kPluginEnabledDefault = true; @@ -30,11 +30,17 @@ HINSTANCE g_hInstance; #define NT_CHECK_FAIL_ACTION return FALSE; -BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID) +BOOL WINAPI DllMain( + #ifdef UNDER_CE + HANDLE + #else + HINSTANCE + #endif + hInstance, DWORD dwReason, LPVOID) { if (dwReason == DLL_PROCESS_ATTACH) { - g_hInstance = hInstance; + g_hInstance = (HINSTANCE)hInstance; NT_CHECK } return TRUE; @@ -45,9 +51,9 @@ static struct COptions bool Enabled; } g_Options; -static const char *kPliginNameForRegestry = "7-ZIP"; +static const TCHAR *kPliginNameForRegestry = TEXT("7-ZIP"); -EXTERN_C void WINAPI SetStartupInfo(struct PluginStartupInfo *info) +EXTERN_C void WINAPI SetStartupInfo(const PluginStartupInfo *info) { MY_TRY_BEGIN; g_StartupInfo.Init(*info, kPliginNameForRegestry); @@ -325,11 +331,9 @@ HRESULT OpenArchive(const CSysString &fileName, } */ -static HANDLE MyOpenFilePlugin(const char *name) +static HANDLE MyOpenFilePluginW(const wchar_t *name) { - UINT codePage = ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; - - UString normalizedName = GetUnicodeString(name, codePage); + UString normalizedName = name; normalizedName.Trim(); UString fullName; int fileNamePartStartIndex; @@ -344,7 +348,7 @@ static HANDLE MyOpenFilePlugin(const char *name) CMyComPtr<IInFolderArchive> archiveHandler; // CArchiverInfo archiverInfoResult; - // ::OutputDebugString("before OpenArchive\n"); + // ::OutputDebugStringA("before OpenArchive\n"); CScreenRestorer screenRestorer; { @@ -360,7 +364,7 @@ static HANDLE MyOpenFilePlugin(const char *name) fullName.Left(fileNamePartStartIndex), fullName.Mid(fileNamePartStartIndex)); - // ::OutputDebugString("before OpenArchive\n"); + // ::OutputDebugStringA("before OpenArchive\n"); archiveHandler = new CAgent; CMyComBSTR archiveType; @@ -377,7 +381,7 @@ static HANDLE MyOpenFilePlugin(const char *name) return INVALID_HANDLE_VALUE; } - // ::OutputDebugString("after OpenArchive\n"); + // ::OutputDebugStringA("after OpenArchive\n"); CPlugin *plugin = new CPlugin( fullName, @@ -393,7 +397,18 @@ static HANDLE MyOpenFilePlugin(const char *name) return (HANDLE)(plugin); } -EXTERN_C HANDLE WINAPI OpenFilePlugin(char *name, const unsigned char * /* data */, unsigned int /* dataSize */) +static HANDLE MyOpenFilePlugin(const char *name) +{ + UINT codePage = + #ifdef UNDER_CE + CP_OEMCP; + #else + ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; + #endif + return MyOpenFilePluginW(GetUnicodeString(name, codePage)); +} + +EXTERN_C HANDLE WINAPI OpenFilePlugin(char *name, const unsigned char * /* data */, int /* dataSize */) { MY_TRY_BEGIN; if (name == NULL || (!g_Options.Enabled)) @@ -405,12 +420,27 @@ EXTERN_C HANDLE WINAPI OpenFilePlugin(char *name, const unsigned char * /* data MY_TRY_END2("OpenFilePlugin", INVALID_HANDLE_VALUE); } -EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, int item) +/* +EXTERN_C HANDLE WINAPI OpenFilePluginW(const wchar_t *name,const unsigned char *Data,int DataSize,int OpMode) +{ + MY_TRY_BEGIN; + if (name == NULL || (!g_Options.Enabled)) + { + // if (!Opt.ProcessShiftF1) + return(INVALID_HANDLE_VALUE); + } + return MyOpenFilePluginW(name); + ::OutputDebugStringA("OpenFilePluginW\n"); + MY_TRY_END2("OpenFilePluginW", INVALID_HANDLE_VALUE); +} +*/ + +EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item) { MY_TRY_BEGIN; if(openFrom == OPEN_COMMANDLINE) { - CSysString fileName = (const char *)(UINT_PTR)item; + AString fileName = (const char *)item; if(fileName.IsEmpty()) return INVALID_HANDLE_VALUE; if (fileName.Length() >= 2 && @@ -482,7 +512,7 @@ EXTERN_C int WINAPI GetFiles(HANDLE plugin, struct PluginPanelItem *panelItems, MY_TRY_END2("GetFiles", NFileOperationReturnCode::kError); } -EXTERN_C int WINAPI SetDirectory(HANDLE plugin, char *dir, int opMode) +EXTERN_C int WINAPI SetDirectory(HANDLE plugin, const char *dir, int opMode) { MY_TRY_BEGIN; return(((CPlugin *)plugin)->SetDirectory(dir, opMode)); diff --git a/CPP/7zip/UI/Far/Messages.h b/CPP/7zip/UI/Far/Messages.h index 7dc2ec14..fc3723af 100755 --- a/CPP/7zip/UI/Far/Messages.h +++ b/CPP/7zip/UI/Far/Messages.h @@ -181,4 +181,4 @@ enum EEnum } -#endif
\ No newline at end of file +#endif diff --git a/CPP/7zip/UI/Far/OverwriteDialog.cpp b/CPP/7zip/UI/Far/OverwriteDialog.cpp index 6935fa10..5be6a5f9 100755 --- a/CPP/7zip/UI/Far/OverwriteDialog.cpp +++ b/CPP/7zip/UI/Far/OverwriteDialog.cpp @@ -22,8 +22,8 @@ namespace NOverwriteDialog { struct CFileInfoStrings { - CSysString Size; - CSysString Time; + AString Size; + AString Time; }; void SetFileInfoStrings(const CFileInfo &fileInfo, @@ -51,7 +51,7 @@ void SetFileInfoStrings(const CFileInfo &fileInfo, UString timeString = ConvertFileTimeToString(localFileTime); fileInfoStrings.Time = g_StartupInfo.GetMsgString(NMessageID::kOverwriteModifiedOn); fileInfoStrings.Time += " "; - fileInfoStrings.Time += GetSystemString(timeString, CP_OEMCP); + fileInfoStrings.Time += UnicodeStringToMultiByte(timeString, CP_OEMCP); } } @@ -66,7 +66,10 @@ NResult::EEnum Execute(const CFileInfo &oldFileInfo, const CFileInfo &newFileInf SetFileInfoStrings(oldFileInfo, oldFileInfoStrings); SetFileInfoStrings(newFileInfo, newFileInfoStrings); - struct CInitDialogItem anInitItems[]={ + AString oldName = UnicodeStringToMultiByte(oldFileInfo.Name, CP_OEMCP); + AString newName = UnicodeStringToMultiByte(newFileInfo.Name, CP_OEMCP); + + struct CInitDialogItem initItems[]={ { DI_DOUBLEBOX, 3, 1, kXSize - 4, kYSize - 2, false, false, 0, false, NMessageID::kOverwriteTitle, NULL, NULL }, { DI_TEXT, 5, 2, 0, 0, false, false, 0, false, NMessageID::kOverwriteMessage1, NULL, NULL }, @@ -74,13 +77,13 @@ NResult::EEnum Execute(const CFileInfo &oldFileInfo, const CFileInfo &newFileInf { DI_TEXT, 5, 4, 0, 0, false, false, 0, false, NMessageID::kOverwriteMessageWouldYouLike, NULL, NULL }, - { DI_TEXT, 7, 6, 0, 0, false, false, 0, false, -1, oldFileInfo.Name, NULL }, + { DI_TEXT, 7, 6, 0, 0, false, false, 0, false, -1, oldName, NULL }, { DI_TEXT, 7, 7, 0, 0, false, false, 0, false, -1, oldFileInfoStrings.Size, NULL }, { DI_TEXT, 7, 8, 0, 0, false, false, 0, false, -1, oldFileInfoStrings.Time, NULL }, { DI_TEXT, 5, 10, 0, 0, false, false, 0, false, NMessageID::kOverwriteMessageWithtTisOne, NULL, NULL }, - { DI_TEXT, 7, 12, 0, 0, false, false, 0, false, -1, newFileInfo.Name, NULL }, + { DI_TEXT, 7, 12, 0, 0, false, false, 0, false, -1, newName, NULL }, { DI_TEXT, 7, 13, 0, 0, false, false, 0, false, -1, newFileInfoStrings.Size, NULL }, { DI_TEXT, 7, 14, 0, 0, false, false, 0, false, -1, newFileInfoStrings.Time, NULL }, @@ -94,9 +97,9 @@ NResult::EEnum Execute(const CFileInfo &oldFileInfo, const CFileInfo &newFileInf { DI_BUTTON, 0, kYSize - 3, 0, 0, false, false, DIF_CENTERGROUP, false, NMessageID::kOverwriteCancel, NULL, NULL } }; - const int kNumDialogItems = sizeof(anInitItems) / sizeof(anInitItems[0]); + const int kNumDialogItems = sizeof(initItems) / sizeof(initItems[0]); FarDialogItem aDialogItems[kNumDialogItems]; - g_StartupInfo.InitDialogItems(anInitItems, aDialogItems, kNumDialogItems); + g_StartupInfo.InitDialogItems(initItems, aDialogItems, kNumDialogItems); int anAskCode = g_StartupInfo.ShowDialog(kXSize, kYSize, NULL, aDialogItems, kNumDialogItems); const int kButtonStartPos = kNumDialogItems - 6; diff --git a/CPP/7zip/UI/Far/OverwriteDialog.h b/CPP/7zip/UI/Far/OverwriteDialog.h index 4715e53f..a0842e78 100755 --- a/CPP/7zip/UI/Far/OverwriteDialog.h +++ b/CPP/7zip/UI/Far/OverwriteDialog.h @@ -4,6 +4,7 @@ #define OVERWRITEDIALOG_H #include "Common/MyString.h" +#include "Common/Types.h" namespace NOverwriteDialog { @@ -11,10 +12,11 @@ struct CFileInfo { bool SizeIsDefined; bool TimeIsDefined; - UINT64 Size; + UInt64 Size; FILETIME Time; - CSysString Name; + UString Name; }; + namespace NResult { enum EEnum @@ -24,10 +26,11 @@ namespace NResult kNo, kNoToAll, kAutoRename, - kCancel, + kCancel }; } -NResult::EEnum Execute(const CFileInfo &anOldFileInfo, const CFileInfo &aNewFileInfo); + +NResult::EEnum Execute(const CFileInfo &oldFileInfo, const CFileInfo &newFileInfo); } diff --git a/CPP/7zip/UI/Far/Plugin.cpp b/CPP/7zip/UI/Far/Plugin.cpp index bc70278b..97627517 100755 --- a/CPP/7zip/UI/Far/Plugin.cpp +++ b/CPP/7zip/UI/Far/Plugin.cpp @@ -72,7 +72,7 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UInt32 itemIndex) if (prop.vt != VT_BSTR) throw 272340; - CSysString oemString = UnicodeStringToMultiByte(prop.bstrVal, CP_OEMCP); + AString oemString = UnicodeStringToMultiByte(prop.bstrVal, CP_OEMCP); if (oemString == "..") oemString = kDotsReplaceString; @@ -133,9 +133,9 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UInt32 itemIndex) panelItem.CustomColumnData = NULL; panelItem.CustomColumnNumber = 0; + panelItem.CRC32 = 0; panelItem.Reserved[0] = 0; panelItem.Reserved[1] = 0; - panelItem.Reserved[2] = 0; } int CPlugin::GetFindData(PluginPanelItem **panelItems, int *itemsNumber, int opMode) @@ -466,7 +466,7 @@ static AString PropToString(const NCOM::CPropVariant &prop, PROPID propID) AString s; if (prop.vt == VT_BSTR) - s = GetSystemString(prop.bstrVal, CP_OEMCP); + s = UnicodeStringToMultiByte(prop.bstrVal, CP_OEMCP); else if (prop.vt == VT_BOOL) { int messageID = VARIANT_BOOLToBool(prop.boolVal) ? @@ -733,7 +733,7 @@ HRESULT CPlugin::ShowAttributesWindow() if (strcmp(pluginPanelItem.FindData.cFileName, "..") == 0 && NFile::NFind::NAttributes::IsDir(pluginPanelItem.FindData.dwFileAttributes)) return S_FALSE; - int itemIndex = pluginPanelItem.UserData; + int itemIndex = (int)pluginPanelItem.UserData; CObjectVector<CArchiveItemProperty> properties; UInt32 numProps; @@ -781,7 +781,7 @@ HRESULT CPlugin::ShowAttributesWindow() NCOM::CPropVariant prop; RINOK(_folder->GetProperty(itemIndex, property.ID, &prop)); - CSysString s = PropToString(prop, property.ID); + AString s = PropToString(prop, property.ID); values.Add(s); { diff --git a/CPP/7zip/UI/Far/PluginDelete.cpp b/CPP/7zip/UI/Far/PluginDelete.cpp index 7d6f0314..182fbfb0 100755 --- a/CPP/7zip/UI/Far/PluginDelete.cpp +++ b/CPP/7zip/UI/Far/PluginDelete.cpp @@ -82,8 +82,8 @@ int CPlugin::DeleteFiles(PluginPanelItem *panelItems, int numItems, int opMode) CRecordVector<UINT32> indices; indices.Reserve(numItems); int i; - for(i = 0; i < numItems; i++) - indices.Add(panelItems[i].UserData); + for (i = 0; i < numItems; i++) + indices.Add((UINT32)panelItems[i].UserData); //////////////////////////// // Save _folder; @@ -93,7 +93,7 @@ int CPlugin::DeleteFiles(PluginPanelItem *panelItems, int numItems, int opMode) CMyComPtr<IOutFolderArchive> outArchive; HRESULT result = m_ArchiveHandler.QueryInterface(IID_IOutFolderArchive, &outArchive); - if(result != S_OK) + if (result != S_OK) { g_StartupInfo.ShowMessage(NMessageID::kUpdateNotSupportedForThisArchive); return FALSE; @@ -151,11 +151,11 @@ int CPlugin::DeleteFiles(PluginPanelItem *panelItems, int numItems, int opMode) { CMyComPtr<IFolderFolder> newFolder; _folder->BindToFolder(pathVector[i], &newFolder); - if(!newFolder ) + if (!newFolder) break; _folder = newFolder; } GetCurrentDir(); - return(TRUE); + return TRUE; } diff --git a/CPP/7zip/UI/Far/PluginRead.cpp b/CPP/7zip/UI/Far/PluginRead.cpp index 45f575fb..965030ea 100755 --- a/CPP/7zip/UI/Far/PluginRead.cpp +++ b/CPP/7zip/UI/Far/PluginRead.cpp @@ -76,23 +76,25 @@ HRESULT CPlugin::ExtractFiles( } NFileOperationReturnCode::EEnum CPlugin::GetFiles(struct PluginPanelItem *panelItems, - int itemsNumber, int move, char *_aDestPath, int opMode) + int itemsNumber, int move, char *destPath, int opMode) { return GetFilesReal(panelItems, itemsNumber, move, - _aDestPath, opMode, (opMode & OPM_SILENT) == 0); + destPath, opMode, (opMode & OPM_SILENT) == 0); } NFileOperationReturnCode::EEnum CPlugin::GetFilesReal(struct PluginPanelItem *panelItems, - int itemsNumber, int move, const char *_aDestPath, int opMode, bool showBox) + int itemsNumber, int move, const char *destPathLoc, int opMode, bool showBox) { - if(move != 0) + if (move != 0) { g_StartupInfo.ShowMessage(NMessageID::kMoveIsNotSupported); return NFileOperationReturnCode::kError; } - CSysString destPath = _aDestPath; - NFile::NName::NormalizeDirPathPrefix(destPath); + AString destPath = destPathLoc; + UString destPathU = GetUnicodeString(destPath, CP_OEMCP); + NFile::NName::NormalizeDirPathPrefix(destPathU); + destPath = UnicodeStringToMultiByte(destPathU, CP_OEMCP); bool extractSelectedFiles = true; @@ -185,17 +187,22 @@ NFileOperationReturnCode::EEnum CPlugin::GetFilesReal(struct PluginPanelItem *pa if (askCode != kOkButtonIndex) return NFileOperationReturnCode::kInterruptedByUser; destPath = dialogItems[kPathIndex].Data; - destPath.Trim(); - if (destPath.IsEmpty()) + destPathU = GetUnicodeString(destPath, CP_OEMCP); + destPathU.Trim(); + if (destPathU.IsEmpty()) { - if(!NFile::NDirectory::MyGetCurrentDirectory(destPath)) + #ifdef UNDER_CE + destPathU = L"\\"; + #else + if (!NFile::NDirectory::MyGetCurrentDirectory(destPathU)) throw 318016; - NFile::NName::NormalizeDirPathPrefix(destPath); + NFile::NName::NormalizeDirPathPrefix(destPathU); + #endif break; } else { - if(destPath[destPath.Length() - 1] == kDirDelimiter) + if (destPathU.Back() == kDirDelimiter) break; } g_StartupInfo.ShowMessage("You must specify directory path"); @@ -244,7 +251,7 @@ NFileOperationReturnCode::EEnum CPlugin::GetFilesReal(struct PluginPanelItem *pa passwordIsDefined = !password.IsEmpty(); } - NFile::NDirectory::CreateComplexDirectory(destPath); + NFile::NDirectory::CreateComplexDirectory(destPathU); /* vector<int> realIndices; @@ -254,11 +261,11 @@ NFileOperationReturnCode::EEnum CPlugin::GetFilesReal(struct PluginPanelItem *pa CRecordVector<UINT32> indices; indices.Reserve(itemsNumber); for (int i = 0; i < itemsNumber; i++) - indices.Add(panelItems[i].UserData); + indices.Add((UINT32)panelItems[i].UserData); HRESULT result = ExtractFiles(decompressAllItems, &indices.Front(), itemsNumber, !showBox, extractionInfo.PathMode, extractionInfo.OverwriteMode, - MultiByteToUnicodeString(destPath, CP_OEMCP), + destPathU, passwordIsDefined, password); // HRESULT result = ExtractFiles(decompressAllItems, realIndices, !showBox, // extractionInfo, destPath, passwordIsDefined, password); @@ -270,9 +277,9 @@ NFileOperationReturnCode::EEnum CPlugin::GetFilesReal(struct PluginPanelItem *pa return NFileOperationReturnCode::kError; } - // if(move != 0) + // if (move != 0) // { - // if(DeleteFiles(panelItems, itemsNumber, opMode) == FALSE) + // if (DeleteFiles(panelItems, itemsNumber, opMode) == FALSE) // return NFileOperationReturnCode::kError; // } return NFileOperationReturnCode::kSuccess; diff --git a/CPP/7zip/UI/Far/PluginWrite.cpp b/CPP/7zip/UI/Far/PluginWrite.cpp index 48b7d98e..ca515c42 100755 --- a/CPP/7zip/UI/Far/PluginWrite.cpp +++ b/CPP/7zip/UI/Far/PluginWrite.cpp @@ -412,16 +412,17 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) for(i = 0; i < pluginPanelItems.Size(); i++) { const PluginPanelItem &panelItem = pluginPanelItems[i]; - CSysString fullName; + UString fullName; if (strcmp(panelItem.FindData.cFileName, "..") == 0 && NFind::NAttributes::IsDir(panelItem.FindData.dwFileAttributes)) return E_FAIL; if (strcmp(panelItem.FindData.cFileName, ".") == 0 && NFind::NAttributes::IsDir(panelItem.FindData.dwFileAttributes)) return E_FAIL; - if (!MyGetFullPathName(panelItem.FindData.cFileName, fullName)) + UString fileNameUnicode = MultiByteToUnicodeString(panelItem.FindData.cFileName, CP_OEMCP); + if (!MyGetFullPathName(fileNameUnicode, fullName)) return E_FAIL; - fileNames.Add(MultiByteToUnicodeString(fullName, CP_OEMCP)); + fileNames.Add(fullName); } NCompression::CInfo compressionInfo; @@ -496,7 +497,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex]; char updateAddToArchiveString[512]; - const AString s = GetSystemString(arcInfo.Name, CP_OEMCP); + const AString s = UnicodeStringToMultiByte(arcInfo.Name, CP_OEMCP); sprintf(updateAddToArchiveString, g_StartupInfo.GetMsgString(NMessageID::kUpdateAddToArchive), (const char *)s); @@ -777,4 +778,3 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) return S_OK; } - diff --git a/CPP/7zip/UI/Far/makefile b/CPP/7zip/UI/Far/makefile index 076818e4..0d6f8d68 100755 --- a/CPP/7zip/UI/Far/makefile +++ b/CPP/7zip/UI/Far/makefile @@ -1,11 +1,13 @@ PROG = 7-ZipFar.dll DEF_FILE = Far.def CFLAGS = $(CFLAGS) -I ../../../ \ - -DWIN_LONG_PATH \ -DEXTERNAL_CODECS +!IFNDEF UNDER_CE +CFLAGS = $(CFLAGS) -DWIN_LONG_PATH +!ENDIF + FAR_OBJS = \ - $O\CLSIDConst.obj \ $O\ExtractEngine.obj \ $O\FarUtils.obj \ $O\Main.obj \ diff --git a/CPP/7zip/UI/FileManager/AppState.h b/CPP/7zip/UI/FileManager/AppState.h index 4f8b7bbe..374cf04f 100755 --- a/CPP/7zip/UI/FileManager/AppState.h +++ b/CPP/7zip/UI/FileManager/AppState.h @@ -111,5 +111,4 @@ struct CAppState } }; - -#endif
\ No newline at end of file +#endif diff --git a/CPP/7zip/UI/FileManager/FM.cpp b/CPP/7zip/UI/FileManager/FM.cpp index 639a9b23..f3b48704 100755 --- a/CPP/7zip/UI/FileManager/FM.cpp +++ b/CPP/7zip/UI/FileManager/FM.cpp @@ -384,7 +384,7 @@ static const int kNumSwitches = 1; namespace NKey { enum Enum { - kOpenArachive = 0, + kOpenArachive = 0 }; } diff --git a/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp index 25aec359..08f15c18 100755 --- a/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp +++ b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp @@ -163,4 +163,4 @@ HRESULT OpenFileFolderPlugin( return t.Result; } return S_FALSE; -}
\ No newline at end of file +} diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp index 34f77861..27aa7a54 100755 --- a/CPP/7zip/UI/FileManager/Panel.cpp +++ b/CPP/7zip/UI/FileManager/Panel.cpp @@ -920,7 +920,7 @@ HRESULT CThreadTest::ProcessVirt() OkMessage = s; } return S_OK; -}; +} /* static void AddSizePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s) diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index 8dcc60d5..29c99bfd 100755 --- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -440,7 +440,7 @@ HRESULT CThreadCopyFrom::ProcessVirt() fileNames.Add(Name); fileNamePointers.Add(fileNames[0]); return FolderOperations->CopyFrom(PathPrefix, &fileNamePointers.Front(), fileNamePointers.Size(), UpdateCallback); -}; +} HRESULT CPanel::OnOpenItemChanged(const UString &folderPath, const UString &itemName, bool usePassword, const UString &password) diff --git a/CPP/7zip/UI/FileManager/PanelItems.cpp b/CPP/7zip/UI/FileManager/PanelItems.cpp index 05b540b6..90d61b86 100755 --- a/CPP/7zip/UI/FileManager/PanelItems.cpp +++ b/CPP/7zip/UI/FileManager/PanelItems.cpp @@ -166,7 +166,7 @@ void CPanel::InsertColumn(int index) column.fmt = GetColumnAlign(prop.ID, prop.Type); column.iOrder = prop.Order; column.iSubItem = index; - column.pszText = (wchar_t *)(const wchar_t *)prop.Name; + column.pszText = const_cast<wchar_t *>((const wchar_t *)prop.Name); _listView.InsertColumn(index, &column); } @@ -337,7 +337,7 @@ HRESULT CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool int subItem = 0; item.iSubItem = subItem++; item.lParam = kParentIndex; - item.pszText = (wchar_t *)(const wchar_t *)itemName; + item.pszText = const_cast<wchar_t *>((const wchar_t *)itemName); UInt32 attrib = FILE_ATTRIBUTE_DIRECTORY; item.iImage = _extToIconMap.GetIconIndex(attrib, itemName); if (item.iImage < 0) @@ -391,10 +391,10 @@ HRESULT CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool pos = posNew; while (itemName[++pos] == ' '); } - item.pszText = (wchar_t *)(const wchar_t *)correctedName; + item.pszText = const_cast<wchar_t *>((const wchar_t *)correctedName); } else - item.pszText = (wchar_t *)(const wchar_t *)itemName; + item.pszText = const_cast<wchar_t *>((const wchar_t *)itemName); NCOM::CPropVariant prop; RINOK(_folder->GetProperty(i, kpidAttrib, &prop)); diff --git a/CPP/7zip/UI/FileManager/PanelOperations.cpp b/CPP/7zip/UI/FileManager/PanelOperations.cpp index 579208d2..0c6d3122 100755 --- a/CPP/7zip/UI/FileManager/PanelOperations.cpp +++ b/CPP/7zip/UI/FileManager/PanelOperations.cpp @@ -50,7 +50,7 @@ public: HRESULT Result; - CThreadFolderOperations(EFolderOpType opType): OpType(opType), Result(E_FAIL) {}; + CThreadFolderOperations(EFolderOpType opType): OpType(opType), Result(E_FAIL) {} HRESULT DoOperation(CPanel &panel, const UString &progressTitle, const UString &titleError); }; @@ -72,7 +72,7 @@ HRESULT CThreadFolderOperations::ProcessVirt() Result = E_FAIL; } return Result; -}; +} HRESULT CThreadFolderOperations::DoOperation(CPanel &panel, const UString &progressTitle, const UString &titleError) diff --git a/CPP/7zip/UI/FileManager/ProgressDialog2.cpp b/CPP/7zip/UI/FileManager/ProgressDialog2.cpp index 313b6181..3d878a61 100755 --- a/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.cpp @@ -941,7 +941,7 @@ void CProgressDialog::ProcessWasFinished() PostMessage(kCloseMessage); else _needClose = true; -}; +} HRESULT CProgressThreadVirt::Create(const UString &title, HWND parentWindow) diff --git a/CPP/7zip/UI/FileManager/RootFolder.cpp b/CPP/7zip/UI/FileManager/RootFolder.cpp index 1f4886d2..0715a8be 100755 --- a/CPP/7zip/UI/FileManager/RootFolder.cpp +++ b/CPP/7zip/UI/FileManager/RootFolder.cpp @@ -72,7 +72,7 @@ void CRootFolder::Init() _names[ROOT_INDEX_VOLUMES] = kVolPrefix; _iconIndices[ROOT_INDEX_VOLUMES] = GetIconIndexForCSIDL(CSIDL_DRIVES); #endif -}; +} STDMETHODIMP CRootFolder::LoadItems() { diff --git a/CPP/7zip/UI/GUI/CompressDialog.cpp b/CPP/7zip/UI/GUI/CompressDialog.cpp index 25c20c29..ea9d9c2c 100755 --- a/CPP/7zip/UI/GUI/CompressDialog.cpp +++ b/CPP/7zip/UI/GUI/CompressDialog.cpp @@ -115,7 +115,7 @@ enum EMethodID kBZip2, kDeflate, kDeflate64, - kPPMdZip, + kPPMdZip }; static const LPCWSTR kMethodsNames[] = @@ -244,7 +244,7 @@ static bool IsMethodSupportedBySfx(int methodID) if (methodID == g_7zSfxMethods[i]) return true; return false; -}; +} static UInt64 GetMaxRamSizeForProgram() { diff --git a/CPP/7zip/UI/GUI/CompressDialog.h b/CPP/7zip/UI/GUI/CompressDialog.h index 19c75875..86f7b173 100755 --- a/CPP/7zip/UI/GUI/CompressDialog.h +++ b/CPP/7zip/UI/GUI/CompressDialog.h @@ -22,7 +22,7 @@ namespace NCompressDialog kAdd, kUpdate, kFresh, - kSynchronize, + kSynchronize }; } struct CInfo diff --git a/CPP/7zip/UI/GUI/ExtractGUI.cpp b/CPP/7zip/UI/GUI/ExtractGUI.cpp index 54ffd51c..a976833c 100755 --- a/CPP/7zip/UI/GUI/ExtractGUI.cpp +++ b/CPP/7zip/UI/GUI/ExtractGUI.cpp @@ -106,7 +106,7 @@ HRESULT CThreadExtracting::ProcessVirt() } #endif return res; -}; +} HRESULT ExtractGUI( CCodecs *codecs, diff --git a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp index 862c96a1..8ec01867 100755 --- a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +++ b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp @@ -172,7 +172,7 @@ HRESULT CUpdateCallbackGUI::CloseProgress() { ProgressDialog->MyClose(); return S_OK; -}; +} */ diff --git a/CPP/7zip/UI/GUI/UpdateGUI.cpp b/CPP/7zip/UI/GUI/UpdateGUI.cpp index ed6cae54..7ee74fc8 100755 --- a/CPP/7zip/UI/GUI/UpdateGUI.cpp +++ b/CPP/7zip/UI/GUI/UpdateGUI.cpp @@ -57,7 +57,7 @@ HRESULT CThreadUpdating::ProcessVirt() if (ei.SystemError != S_OK && ei.SystemError != E_FAIL && ei.SystemError != E_ABORT) return ei.SystemError; return res; -}; +} static void AddProp(CObjectVector<CProperty> &properties, const UString &name, const UString &value) { diff --git a/CPP/7zip/UI/makefile b/CPP/7zip/UI/makefile index d6de40a8..1b0cdbe1 100755 --- a/CPP/7zip/UI/makefile +++ b/CPP/7zip/UI/makefile @@ -2,6 +2,7 @@ DIRS = \ Client7z\~ \ Console\~ \ Explorer\~ \ + Far\~ \ FileManager\~ \ GUI\~ \ |