From 1bf20905021d7d00e997557ed9f9b3a9748a83c3 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Tue, 30 Jan 2018 15:17:13 +0100 Subject: [PATCH 1/2] + cleanup: issues from CppChecker --- src/Edit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Edit.c b/src/Edit.c index c9565afc3..f6f21f817 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -3221,13 +3221,11 @@ void EditStripFirstCharacter(HWND hwnd) IgnoreNotifyChangeEvent(); EditEnterTargetTransaction(); - int chCnt = 0; for (int iLine = iLineStart; iLine <= iLineEnd; ++iLine) { const int iPos = SciCall_PositionFromLine(iLine); if (iPos < SciCall_GetLineEndPosition(iLine)) { SendMessage(hwnd, SCI_SETTARGETRANGE, (WPARAM)iPos, (LPARAM)SciCall_PositionAfter(iPos)); SendMessage(hwnd, SCI_REPLACETARGET, 0, (LPARAM)""); - ++chCnt; } } @@ -3370,10 +3368,9 @@ void EditCompressSpaces(HWND hwnd) bIsLineEnd = (iSelEndPos == SciCall_GetLineEndPosition(iLineEnd)); } - int remWSuntilCaretPos = 0; - if (pszIn && pszOut) { char* co = (char*)pszOut; + int remWSuntilCaretPos = 0; for (int i = 0; i < cch; ++i) { if (pszIn[i] == ' ' || pszIn[i] == '\t') { if (pszIn[i] == '\t') { bModified = TRUE; } From be9c17d19ed9dd99b572caa60986c7b948e14cee Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Wed, 31 Jan 2018 10:48:53 +0100 Subject: [PATCH 2/2] + opt: project compiler optimizations (experimental) --- src/Edit.c | 2 -- src/Notepad3.vcxproj | 26 ++++++++++++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/Edit.c b/src/Edit.c index f6f21f817..084554b50 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -5591,8 +5591,6 @@ int EditReplaceAllInRange(HWND hwnd, LPCEDITFINDREPLACE lpefr, BOOL bShowInfo, i { posPair.beg = start; posPair.end = end; - - utarray_push_back(ReplPosUTArray, &posPair); start = end; diff --git a/src/Notepad3.vcxproj b/src/Notepad3.vcxproj index a5edf2131..3b39f6681 100644 --- a/src/Notepad3.vcxproj +++ b/src/Notepad3.vcxproj @@ -106,7 +106,11 @@ Level4 false true - + true + StreamingSIMDExtensions2 + Fast + stdcpp17 + true msimg32.lib;comctl32.lib;imm32.lib;shlwapi.lib;scintilla.lib;%(AdditionalDependencies) @@ -156,9 +160,11 @@ MultiThreadedDebug Level4 false - - true + true + Fast + stdcpp17 + true msimg32.lib;comctl32.lib;imm32.lib;shlwapi.lib;scintilla.lib;%(AdditionalDependencies) @@ -200,13 +206,17 @@ ..\scintilla\include;..\scintilla\lexlib;..\scintilla\src;%(AdditionalIncludeDirectories) true - MaxSpeed + Full WIN32;STATIC_BUILD;SCI_LEXER;NDEBUG;%(PreprocessorDefinitions) MultiThreaded Level4 None - true + true + StreamingSIMDExtensions2 + Fast + stdcpp17 + true msimg32.lib;comctl32.lib;imm32.lib;shlwapi.lib;scintilla.lib;%(AdditionalDependencies) @@ -251,12 +261,16 @@ ..\scintilla\include;..\scintilla\lexlib;..\scintilla\src;%(AdditionalIncludeDirectories) true - MaxSpeed + Full _WIN64;STATIC_BUILD;SCI_LEXER;NDEBUG;%(PreprocessorDefinitions) MultiThreaded Level4 None true + true + Fast + stdcpp17 + true msimg32.lib;comctl32.lib;imm32.lib;shlwapi.lib;scintilla.lib;%(AdditionalDependencies)