diff --git a/PowerEditor/gcc/makefile b/PowerEditor/gcc/makefile index 52b85d53..0b8acd03 100644 --- a/PowerEditor/gcc/makefile +++ b/PowerEditor/gcc/makefile @@ -21,10 +21,15 @@ SCI_DIR = ../../scintilla/include GCC_DIR = . GCCINCLUDE_DIR = $(GCC_DIR)/include +#json: +JSON_DIR = $(NPP_DIR)/json + #MISC: MISC_DIR = $(NPP_DIR)/MISC COMMON_DIR = $(MISC_DIR)/Common EXCEPTION_DIR = $(MISC_DIR)/Exception + MD5_DIR = $(MISC_DIR)/md5 + SHA2_DIR = $(MISC_DIR)/sha2 PLUGINS_DIR = $(MISC_DIR)/PluginsManager PROCESS_DIR = $(MISC_DIR)/Process REGEXT_DIR = $(MISC_DIR)/RegExt @@ -54,6 +59,7 @@ WIN_DIR = $(NPP_DIR)/WinControls GRID_DIR = $(WIN_DIR)/Grid IMLIST_DIR = $(WIN_DIR)/ImageListSet OPENSAVE_DIR = $(WIN_DIR)/OpenSaveFileDialog + PLUGADMIN_DIR = $(WIN_DIR)/PluginsAdmin PREFERENCE_DIR = $(WIN_DIR)/Preference PRJPANEL_DIR = $(WIN_DIR)/ProjectPanel READDIR_DIR = $(WIN_DIR)/ReadDirectoryChanges @@ -80,6 +86,8 @@ SRC_GCCINCLUDE = $(wildcard $(GCCINCLUDE_DIR)/*.cpp) SRC_MISC = $(wildcard $(MISC_DIR)/*.cpp) SRC_COMMON = $(wildcard $(COMMON_DIR)/*.cpp) SRC_EXCEPTION = $(wildcard $(EXCEPTION_DIR)/*.cpp) + SRC_MD5 = $(wildcard $(MD5_DIR)/*.cpp) + SRC_SHA2 = $(wildcard $(SHA2_DIR)/*.cpp) SRC_PLUGINS = $(wildcard $(PLUGINS_DIR)/*.cpp) SRC_PROCESS = $(wildcard $(PROCESS_DIR)/*.cpp) SRC_REGEXT = $(wildcard $(REGEXT_DIR)/*.cpp) @@ -109,6 +117,7 @@ SRC_WIN = $(wildcard $(WIN_DIR)/*.cpp) SRC_GRID = $(wildcard $(GRID_DIR)/*.cpp) SRC_IMLIST = $(wildcard $(IMLIST_DIR)/*.cpp) SRC_OPENSAVE = $(wildcard $(OPENSAVE_DIR)/*.cpp) + SRC_PLUGADMIN = $(wildcard $(PLUGADMIN_DIR)/*.cpp) SRC_PREFERENCE = $(wildcard $(PREFERENCE_DIR)/*.cpp) SRC_PRJPANEL = $(wildcard $(PRJPANEL_DIR)/*.cpp) SRC_READDIR = $(wildcard $(READDIR_DIR)/*.cpp) @@ -133,6 +142,8 @@ OBJ_GCCINCLUDE = $(patsubst %.cpp,%.o,$(SRC_GCCINCLUDE)) OBJ_MISC = $(patsubst %.cpp,%.o,$(SRC_MISC)) OBJ_COMMON = $(patsubst %.cpp,%.o,$(SRC_COMMON)) OBJ_EXCEPTION = $(patsubst %.cpp,%.o,$(SRC_EXCEPTION)) + OBJ_MD5 = $(patsubst %.cpp,%.o,$(SRC_MD5)) + OBJ_SHA2 = $(patsubst %.cpp,%.o,$(SRC_SHA2)) OBJ_PLUGINS = $(patsubst %.cpp,%.o,$(SRC_PLUGINS)) OBJ_PROCESS = $(patsubst %.cpp,%.o,$(SRC_PROCESS)) OBJ_REGEXT = $(patsubst %.cpp,%.o,$(SRC_REGEXT)) @@ -162,6 +173,7 @@ OBJ_WIN = $(patsubst %.cpp,%.o,$(SRC_WIN)) OBJ_GRID = $(patsubst %.cpp,%.o,$(SRC_GRID)) OBJ_IMLIST = $(patsubst %.cpp,%.o,$(SRC_IMLIST)) OBJ_OPENSAVE = $(patsubst %.cpp,%.o,$(SRC_OPENSAVE)) + OBJ_PLUGADMIN = $(patsubst %.cpp,%.o,$(SRC_PLUGADMIN)) OBJ_PREFERENCE = $(patsubst %.cpp,%.o,$(SRC_PREFERENCE)) OBJ_PRJPANEL = $(patsubst %.cpp,%.o,$(SRC_PRJPANEL)) OBJ_READDIR = $(patsubst %.cpp,%.o,$(SRC_READDIR)) @@ -179,25 +191,25 @@ OBJ_WIN = $(patsubst %.cpp,%.o,$(SRC_WIN)) OBJ_WINDOWSDLG = $(patsubst %.cpp,%.o,$(SRC_WINDOWSDLG)) # Collections -DIRS_WIN = $(WIN_DIR) $(ABOUT_DIR) $(ANSICHAR_DIR) $(CLIPBOARD_DIR) $(CONTEXT_DIR) $(COLOUR_DIR) $(DOCKING_DIR) $(DOCMAP_DIR) $(FBROWSER_DIR) $(FINDCHARS_DIR) $(FUNCLIST_DIR) $(GRID_DIR) $(IMLIST_DIR) $(OPENSAVE_DIR) $(PREFERENCE_DIR) $(PRJPANEL_DIR) $(READDIR_DIR) $(SHORTCUT_DIR) $(SPLITTER_DIR) $(STATICDLG_DIR) $(RUNDLG_DIR) $(STATUSBAR_DIR) $(TABBAR_DIR) $(TASKLIST_DIR) $(TOOLBAR_DIR) $(TOOLTIP_DIR) $(TRAYICON_DIR) $(VERTFILE_DIR) $(WINDOWSDLG_DIR) +DIRS_WIN = $(WIN_DIR) $(ABOUT_DIR) $(ANSICHAR_DIR) $(CLIPBOARD_DIR) $(CONTEXT_DIR) $(COLOUR_DIR) $(DOCKING_DIR) $(DOCMAP_DIR) $(FBROWSER_DIR) $(FINDCHARS_DIR) $(FUNCLIST_DIR) $(GRID_DIR) $(IMLIST_DIR) $(OPENSAVE_DIR) $(PLUGADMIN_DIR) $(PREFERENCE_DIR) $(PRJPANEL_DIR) $(READDIR_DIR) $(SHORTCUT_DIR) $(SPLITTER_DIR) $(STATICDLG_DIR) $(RUNDLG_DIR) $(STATUSBAR_DIR) $(TABBAR_DIR) $(TASKLIST_DIR) $(TOOLBAR_DIR) $(TOOLTIP_DIR) $(TRAYICON_DIR) $(VERTFILE_DIR) $(WINDOWSDLG_DIR) DIRS_UCHARDET = $(UCHARDET_DIR) DIRS_TIXML = $(TIXML_DIR) $(TIXMLA_DIR) DIRS_SCINT = $(SCINT_DIR) -DIRS_MISC = $(MISC_DIR) $(COMMON_DIR) $(EXCEPTION_DIR) $(PLUGINS_DIR) $(PROCESS_DIR) $(REGEXT_DIR) -DIRS = $(NPP_DIR) $(DIRS_WIN) $(DIRS_UCHARDET) $(DIRS_TIXML) $(DIRS_SCINT) $(DIRS_MISC) $(SCI_DIR) +DIRS_MISC = $(MISC_DIR) $(COMMON_DIR) $(EXCEPTION_DIR) $(MD5_DIR) $(SHA2_DIR) $(PLUGINS_DIR) $(PROCESS_DIR) $(REGEXT_DIR) +DIRS = $(NPP_DIR) $(DIRS_WIN) $(DIRS_UCHARDET) $(DIRS_TIXML) $(DIRS_SCINT) $(DIRS_MISC) $(JSON_DIR) $(SCI_DIR) -SRCS_WIN = $(SRC_WIN) $(SRC_ABOUT) $(SRC_ANSICHAR) $(SRC_CLIPBOARD) $(SRC_CONTEXT) $(SRC_COLOUR) $(SRC_DOCKING) $(SRC_DOCMAP) $(SRC_FBROWSER) $(SRC_FINDCHARS) $(SRC_FUNCLIST) $(SRC_GRID) $(SRC_IMLIST) $(SRC_OPENSAVE) $(SRC_PREFERENCE) $(SRC_PRJPANEL) $(SRC_READDIR) $(SRC_SHORTCUT) $(SRC_SPLITTER) $(SRC_STATICDLG) $(SRC_RUNDLG) $(SRC_STATUSBAR) $(SRC_TABBAR) $(SRC_TASKLIST) $(SRC_TOOLBAR) $(SRC_TOOLTIP) $(SRC_TRAYICON) $(SRC_VERTFILE) $(SRC_WINDOWSDLG) +SRCS_WIN = $(SRC_WIN) $(SRC_ABOUT) $(SRC_ANSICHAR) $(SRC_CLIPBOARD) $(SRC_CONTEXT) $(SRC_COLOUR) $(SRC_DOCKING) $(SRC_DOCMAP) $(SRC_FBROWSER) $(SRC_FINDCHARS) $(SRC_FUNCLIST) $(SRC_GRID) $(SRC_IMLIST) $(SRC_OPENSAVE) $(SRC_PLUGADMIN) $(SRC_PREFERENCE) $(SRC_PRJPANEL) $(SRC_READDIR) $(SRC_SHORTCUT) $(SRC_SPLITTER) $(SRC_STATICDLG) $(SRC_RUNDLG) $(SRC_STATUSBAR) $(SRC_TABBAR) $(SRC_TASKLIST) $(SRC_TOOLBAR) $(SRC_TOOLTIP) $(SRC_TRAYICON) $(SRC_VERTFILE) $(SRC_WINDOWSDLG) SRCS_UCHARDET = $(SRC_UCHARDET) SRCS_TIXML = $(SRC_TIXML) $(SRC_TIXMLA) SRCS_SCINT = $(SRC_SCINT) -SRCS_MISC = $(SRC_MISC) $(SRC_COMMON) $(SRC_EXCEPTION) $(SRC_PLUGINS) $(SRC_PROCESS) $(SRC_REGEXT) +SRCS_MISC = $(SRC_MISC) $(SRC_COMMON) $(SRC_EXCEPTION) $(SRC_MD5) $(SRC_SHA2) $(SRC_PLUGINS) $(SRC_PROCESS) $(SRC_REGEXT) SRCS = $(SRC_NPP) $(SRCS_WIN) $(SRCS_UCHARDET) $(SRCS_TIXML) $(SRCS_SCINT) $(SRCS_MISC) $(SRC_GCCINCLUDE) -OBJS_WIN = $(OBJ_WIN) $(OBJ_ABOUT) $(OBJ_ANSICHAR) $(OBJ_CLIPBOARD) $(OBJ_CONTEXT) $(OBJ_COLOUR) $(OBJ_DOCKING) $(OBJ_DOCMAP) $(OBJ_FBROWSER) $(OBJ_FINDCHARS) $(OBJ_FUNCLIST) $(OBJ_GRID) $(OBJ_IMLIST) $(OBJ_OPENSAVE) $(OBJ_PREFERENCE) $(OBJ_PRJPANEL) $(OBJ_READDIR) $(OBJ_SHORTCUT) $(OBJ_SPLITTER) $(OBJ_STATICDLG) $(OBJ_RUNDLG) $(OBJ_STATUSBAR) $(OBJ_TABBAR) $(OBJ_TASKLIST) $(OBJ_TOOLBAR) $(OBJ_TOOLTIP) $(OBJ_TRAYICON) $(OBJ_VERTFILE) $(OBJ_WINDOWSDLG) +OBJS_WIN = $(OBJ_WIN) $(OBJ_ABOUT) $(OBJ_ANSICHAR) $(OBJ_CLIPBOARD) $(OBJ_CONTEXT) $(OBJ_COLOUR) $(OBJ_DOCKING) $(OBJ_DOCMAP) $(OBJ_FBROWSER) $(OBJ_FINDCHARS) $(OBJ_FUNCLIST) $(OBJ_GRID) $(OBJ_IMLIST) $(OBJ_OPENSAVE) $(OBJ_PLUGADMIN) $(OBJ_PREFERENCE) $(OBJ_PRJPANEL) $(OBJ_READDIR) $(OBJ_SHORTCUT) $(OBJ_SPLITTER) $(OBJ_STATICDLG) $(OBJ_RUNDLG) $(OBJ_STATUSBAR) $(OBJ_TABBAR) $(OBJ_TASKLIST) $(OBJ_TOOLBAR) $(OBJ_TOOLTIP) $(OBJ_TRAYICON) $(OBJ_VERTFILE) $(OBJ_WINDOWSDLG) OBJS_UCHARDET = $(OBJ_UCHARDET) OBJS_TIXML = $(OBJ_TIXML) $(OBJ_TIXMLA) OBJS_SCINT = $(OBJ_SCINT) -OBJS_MISC = $(OBJ_MISC) $(OBJ_COMMON) $(OBJ_EXCEPTION) $(OBJ_PLUGINS) $(OBJ_PROCESS) $(OBJ_REGEXT) +OBJS_MISC = $(OBJ_MISC) $(OBJ_COMMON) $(OBJ_EXCEPTION) $(OBJ_MD5) $(OBJ_SHA2) $(OBJ_PLUGINS) $(OBJ_PROCESS) $(OBJ_REGEXT) OBJS = $(OBJ_NPP) $(OBJS_WIN) $(OBJS_UCHARDET) $(OBJS_TIXML) $(OBJS_SCINT) $(OBJS_MISC) $(OBJ_GCCINCLUDE) # Main resource file @@ -205,7 +217,7 @@ SRC_RES = ./resources.rc OBJ_RES = $(patsubst %.rc,%.res,$(SRC_RES)) # XML config files -SRC_XMLCFG = $(addprefix $(NPP_DIR)/,config.model.xml langs.model.xml stylers.model.xml shortcuts.xml functionList.xml contextMenu.xml) +SRC_XMLCFG = $(addprefix $(NPP_DIR)/,langs.model.xml stylers.model.xml shortcuts.xml functionList.xml contextMenu.xml) DST_XMLCFG = $(subst $(NPP_DIR),../bin,$(SRC_XMLCFG)) DEPS = $(patsubst %.o,%.d,$(OBJS)) @@ -235,10 +247,10 @@ UNICODE = -DUNICODE -D_UNICODE CXX = $(CROSS_COMPILE)g++ #CXXFLAGS = -O2 $(INCLUDESPECIAL) -CXXFLAGS = $(INCLUDESPECIAL) -DTIXML_USE_STL -DTIXMLA_USE_STL $(UNICODE) -std=c++14 -fpermissive +CXXFLAGS = $(INCLUDESPECIAL) -DTIXML_USE_STL -DTIXMLA_USE_STL $(UNICODE) -std=c++17 -fpermissive INCLUDES = $(patsubst %,-I%,$(DIRS)) -I./include -LDFLAGS = -Wl,--subsystem,windows -LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi -ldbghelp +LDFLAGS = -Wl,--subsystem,windows -municode -mwindows +LIBS = -lcomdlg32 -lcomctl32 -lgdi32 -lole32 -loleacc -lshell32 -lshlwapi -ldbghelp -lversion -lcrypt32 -lsensapi -lwintrust RC = $(CROSS_COMPILE)windres @@ -254,7 +266,8 @@ all: NotepadPP xmlcfg NotepadPP: $(EXEC) $(EXEC): $(OBJS) $(OBJ_RES) - $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@ + $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@_dynamic + $(CXX) $(LDFLAGS) $^ $(LIBS) -static -o $@ %.o: %.cpp $(CXX) $(CXXFLAGS) $(INCLUDES) -MMD -c $< -o $@ diff --git a/PowerEditor/gcc/resources.rc b/PowerEditor/gcc/resources.rc index e683f91b..27812193 100644 --- a/PowerEditor/gcc/resources.rc +++ b/PowerEditor/gcc/resources.rc @@ -5,6 +5,7 @@ #include "../src/ScitillaComponent/columnEditor.rc" #include "../src/ScitillaComponent/FindReplaceDlg.rc" #include "../src/ScitillaComponent/UserDefineDialog.rc" +#include "../src/MISC/md5/md5Dlgs.rc" #include "../src/MISC/RegExt/regExtDlg.rc" #include "../src/WinControls/AnsiCharPanel/ansiCharPanel.rc" #include "../src/WinControls/ClipboardHistory/clipboardHistoryPanel.rc" @@ -12,10 +13,12 @@ #include "../src/WinControls/ColourPicker/WordStyleDlg.rc" #include "../src/WinControls/DockingWnd/DockingGUIWidget.rc" #include "../src/WinControls/DocumentMap/documentMap.rc" +#include "../src/WinControls/DocumentMap/documentSnapshot.rc" #include "../src/WinControls/FileBrowser/fileBrowser.rc" #include "../src/WinControls/FindCharsInRange/findCharsInRange.rc" #include "../src/WinControls/FunctionList/functionListPanel.rc" #include "../src/WinControls/Grid/ShortcutMapper.rc" +#include "../src/WinControls/PluginsAdmin/pluginsAdmin.rc" #include "../src/WinControls/Preference/preference.rc" #include "../src/WinControls/ProjectPanel/ProjectPanel.rc" #include "../src/WinControls/shortcut/RunMacroDlg.rc" diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index a22acaaf..a5c85127 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include "StaticDialog.h" @@ -1017,7 +1018,7 @@ HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText) } // Create the tooltip. g_hInst is the global instance handle. - HWND hwndTip = CreateWindowEx(NULL, TOOLTIPS_CLASS, NULL, + HWND hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_ALWAYSTIP | TTS_BALLOON, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index 41418f98..9be1b977 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -112,8 +112,12 @@ static WORD getBinaryArchitectureType(const TCHAR *filePath) return machine_type; } -#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 -#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 +#ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR + #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100 +#endif +#ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR + #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000 +#endif int PluginsManager::loadPlugin(const TCHAR *pluginFilePath) { diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index d032fd92..ddb9ccb1 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -235,7 +235,7 @@ BEGIN MENUITEM "Explorer", IDM_FILE_OPEN_FOLDER MENUITEM "cmd", IDM_FILE_OPEN_CMD END - MENUITEM "Open in Default Viewer" IDM_FILE_OPEN_DEFAULT_VIEWER + MENUITEM "Open in Default Viewer", IDM_FILE_OPEN_DEFAULT_VIEWER MENUITEM "Open Folder as Workspace...", IDM_FILE_OPENFOLDERASWORSPACE MENUITEM "Re&load from Disk", IDM_FILE_RELOAD MENUITEM "&Save", IDM_FILE_SAVE diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 4e57b642..a70d84d8 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -462,7 +462,7 @@ void Notepad_plus::command(int id) if (nppGui._searchEngineChoice == nppGui.se_custom) { url = nppGui._searchEngineCustom; - remove_if(url.begin(), url.end(), isspace); + remove_if(url.begin(), url.end(), _istspace); auto httpPos = url.find(TEXT("http://")); auto httpsPos = url.find(TEXT("https://")); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index baeae31f..c8dda99e 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -682,7 +682,7 @@ protected: const char * getCompleteKeywordList(std::basic_string & kwl, LangType langType, int keywordIndex); void setKeywords(LangType langType, const char *keywords, int index); void setLexer(int lexerID, LangType langType, int whichList); - inline void makeStyle(LangType langType, const TCHAR **keywordArray = NULL); + void makeStyle(LangType langType, const TCHAR **keywordArray = NULL); void setStyle(Style styleToSet); //NOT by reference (style edited) void setSpecialStyle(const Style & styleToSet); //by reference void setSpecialIndicator(const Style & styleToSet) { diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp index 8d6874db..ea939647 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp @@ -1555,8 +1555,10 @@ bool StringDlg::isAllowed(const generic_string & txt) { for (auto ch : txt) { + #ifndef __MINGW32__ if (std::find(_restrictedChars.cbegin(), _restrictedChars.cend(), ch) != _restrictedChars.cend()) return false; + #endif } return true; } diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index 142790cb..40a42cf8 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -295,7 +295,7 @@ bool FunctionListPanel::serialize(const generic_string & outputFilename) } } - std::ofstream file(fname2write); + std::ofstream file(wmc.wchar2char(fname2write.c_str(), CP_ACP)); file << j; return true; diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 5d79f34c..830dbf6e 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -1313,7 +1313,7 @@ int FindLongestLine(HDC hdc,TCHAR* text,SIZE* size) { longest=size->cx; } - p = generic_strtok('\0', TEXT("\n")); + p = generic_strtok(TEXT('\0'), TEXT("\n")); } return longest; } diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index e31308a6..00a44453 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1486,7 +1486,7 @@ INT_PTR CALLBACK RecentFilesHistoryDlg::run_dlgProc(UINT message, WPARAM wParam, ::SetDlgItemInt(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC, length, FALSE); _customLenVal.init(_hInst, _hSelf); - _customLenVal.create(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), NULL); + _customLenVal.create(::GetDlgItem(_hSelf, IDC_CUSTOMIZELENGTHVAL_STATIC), nullptr); // // To avoid the white control background to be displayed in dialog diff --git a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp index 11f1ef39..7855c2a0 100644 --- a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp +++ b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.cpp @@ -27,6 +27,7 @@ // See ReadMe.txt for overview information. #include +#include #include "ReadDirectoryChanges.h" #include "ReadDirectoryChangesPrivate.h" @@ -61,7 +62,7 @@ CReadChangesRequest::CReadChangesRequest(CReadChangesServer* pServer, LPCTSTR sz CReadChangesRequest::~CReadChangesRequest() { // RequestTermination() must have been called successfully. - _ASSERTE(m_hDirectory == NULL); + assert(m_hDirectory == NULL); } @@ -124,7 +125,7 @@ VOID CALLBACK CReadChangesRequest::NotificationCompletion( // Can't use sizeof(FILE_NOTIFY_INFORMATION) because // the structure is padded to 16 bytes. - _ASSERTE((dwNumberOfBytesTransfered == 0) || + assert((dwNumberOfBytesTransfered == 0) || (dwNumberOfBytesTransfered >= offsetof(FILE_NOTIFY_INFORMATION, FileName) + sizeof(WCHAR))); pBlock->BackupBuffer(dwNumberOfBytesTransfered); diff --git a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.h b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.h index f5998238..4a79ccd0 100644 --- a/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.h +++ b/PowerEditor/src/WinControls/ReadDirectoryChanges/ReadDirectoryChangesPrivate.h @@ -117,14 +117,14 @@ public: } // Called by QueueUserAPC to start orderly shutdown. - static void CALLBACK TerminateProc(__in ULONG_PTR arg) + static void CALLBACK TerminateProc( ULONG_PTR arg) { CReadChangesServer* pServer = reinterpret_cast(arg); pServer->RequestTermination(); } // Called by QueueUserAPC to add another directory. - static void CALLBACK AddDirectoryProc(__in ULONG_PTR arg) + static void CALLBACK AddDirectoryProc( ULONG_PTR arg) { CReadChangesRequest* pRequest = reinterpret_cast(arg); pRequest->m_pServer->AddDirectory(pRequest); diff --git a/appveyor.yml b/appveyor.yml index 0eb8d135..729204a9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,31 +1,44 @@ -version: 7.6.{build} +version: 7.8.{build} image: Visual Studio 2017 -platform: - - x64 - - Win32 + +environment: + matrix: + - platform: Win32 + archi: x86 + platform_input: Win32 + + - platform: x64 + archi: amd64 + platform_input: x64 + + - platform: mingw-w64_810_X64 + platform_input: mingw configuration: - Unicode Release - Unicode Debug install: - - if "%platform%"=="x64" set archi=amd64 - - if "%platform%"=="x64" set platform_input=x64 - - - if "%platform%"=="Win32" set archi=x86 - - if "%platform%"=="Win32" set platform_input=Win32 - - - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi% + - if "%Platform%"=="mingw-w64_810_X64" set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH:C:\Program Files\Git\usr\bin;=% + - if "%archi%" NEQ "" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %archi% build_script: + - ps: | + Write-Output "Configuration: $env:CONFIGURATION" + Write-Output "Platform: $env:PLATFORM" + - cd "%APPVEYOR_BUILD_FOLDER%"\scintilla\win32 - if "%configuration%"=="Unicode Debug" set scintilla_debug=DEBUG=1 - if "%configuration%"=="Unicode Release" set scintilla_debug= - - nmake SUPPORT_XP=1 %scintilla_debug% -f scintilla.mak + - if "%archi%" NEQ "" nmake SUPPORT_XP=1 %scintilla_debug% -f scintilla.mak + - if "%Platform%"=="mingw-w64_810_X64" mingw32-make -j%NUMBER_OF_PROCESSORS% + - cd "%APPVEYOR_BUILD_FOLDER%"\PowerEditor\visual.net\ - - msbuild notepadPlus.vcxproj /p:configuration="%configuration%" /p:platform="%platform_input%" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - if "%archi%" NEQ "" msbuild notepadPlus.vcxproj /p:configuration="%configuration%" /p:platform="%platform_input%" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + - if "%Platform%"=="mingw-w64_810_X64" cd c:\projects\notepad-plus-plus\PowerEditor\gcc\ & mingw32-make -j%NUMBER_OF_PROCESSORS% + after_build: - cd "%APPVEYOR_BUILD_FOLDER%" @@ -48,4 +61,9 @@ after_build: Push-AppveyorArtifact "PowerEditor\visual.net\Unicode Debug\Notepad++.exe" -FileName "$nppFileName" } + if ($env:PLATFORM_INPUT -eq "mingw") { + Push-AppveyorArtifact "PowerEditor\bin\NotepadPP.exe" -FileName "$nppFileName" + Push-AppveyorArtifact "PowerEditor\bin\NotepadPP.exe_dynamic" -FileName "$nppFileName_dynamic" + } + Push-AppveyorArtifact "scintilla\bin\SciLexer.dll" -FileName "SciLexer.$env:PLATFORM.$env:CONFIGURATION.dll" diff --git a/scintilla/lexers/LexSearchResult.cxx b/scintilla/lexers/LexSearchResult.cxx index 8eb4143c..15ecaa5d 100644 --- a/scintilla/lexers/LexSearchResult.cxx +++ b/scintilla/lexers/LexSearchResult.cxx @@ -110,7 +110,7 @@ static void ColouriseSearchResultDoc(Sci_PositionU startPos, Sci_Position length return; SearchResultMarkings* pMarkings = NULL; - sscanf(addrMarkingsStruct, "%p", &pMarkings); + sscanf(addrMarkingsStruct, "%p", (void**)&pMarkings); for (size_t i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index 5233257d..a833466a 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -694,7 +694,7 @@ static inline void SubGroup(const char * s, vvstring & vec, bool group=false) delete [] temp; } -static inline void GenerateVector(vvstring & vec, const char * s, char * prefix, size_t minLength) +static inline void GenerateVector(vvstring & vec, const char * s, const char * prefix, size_t minLength) { size_t length = strlen(s); char * temp = new char[length]; @@ -757,7 +757,7 @@ static inline void StringToVector(char * original, vector & tokenVector, string temp = ""; char * pch = original; - while (*pch != NULL) + while (*pch != '\0') { if (*pch != ' ') temp += *pch; //