From ade01204c8800c6117bdc72eb476de4226adf4fa Mon Sep 17 00:00:00 2001 From: Don HO Date: Sun, 10 May 2020 05:19:08 +0200 Subject: [PATCH] Fix minor coding error & remove unused variables --- PowerEditor/src/Parameters.cpp | 2 +- PowerEditor/src/ScitillaComponent/AutoCompletion.h | 2 +- PowerEditor/src/ScitillaComponent/FunctionCallTip.h | 2 +- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 1 - PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp | 4 ---- PowerEditor/src/WinControls/Grid/BabyGrid.cpp | 1 - PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp | 2 +- PowerEditor/src/WinControls/ToolBar/ToolBar.cpp | 2 +- PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp | 4 ++-- scintilla/lexers/LexUser.cxx | 7 ++----- 10 files changed, 9 insertions(+), 18 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 6e8b9ffb..84ac90ee 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -4879,7 +4879,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) const TCHAR *bDir = element->Attribute(TEXT("useCustumDir")); if (bDir) { - _nppGUI._useDir = (lstrcmp(bDir, TEXT("yes")) == 0);; + _nppGUI._useDir = (lstrcmp(bDir, TEXT("yes")) == 0); } const TCHAR *pDir = element->Attribute(TEXT("dir")); if (pDir) diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.h b/PowerEditor/src/ScitillaComponent/AutoCompletion.h index bbaa00ce..ca88bbf4 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.h +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.h @@ -52,7 +52,7 @@ public: private: std::vector _insertedMatchedChars; - ScintillaEditView * _pEditView = nullptr;; + ScintillaEditView * _pEditView = nullptr; }; class AutoCompletion { diff --git a/PowerEditor/src/ScitillaComponent/FunctionCallTip.h b/PowerEditor/src/ScitillaComponent/FunctionCallTip.h index e2f5cfc2..377c4c17 100644 --- a/PowerEditor/src/ScitillaComponent/FunctionCallTip.h +++ b/PowerEditor/src/ScitillaComponent/FunctionCallTip.h @@ -74,7 +74,7 @@ private: void reset(); //reset all vars in case function is invalidated void cleanup(); //delete any leftovers bool isBasicWordChar(TCHAR ch) const { - return (ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z' || ch >= '0' && ch <= '9' || ch == '_'); + return ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9') || ch == '_'); }; bool isAdditionalWordChar(TCHAR ch) const { const TCHAR *addChars = _additionalWordChar.c_str(); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index c26ef8b2..9728a939 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1850,7 +1850,6 @@ void ScintillaEditView::restoreCurrentPosPostStep() if (!_positionRestoreNeeded) return; - static int32_t restoreDone = 0; Buffer * buf = MainFileManager.getBufferByID(_currentBufferID); Position & pos = buf->getPosition(this); diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index c4cda47f..1e98fa85 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -1193,10 +1193,6 @@ int DockingCont::hideToolbar(tTbData *pTbData, BOOL hideClient) if (iItemCnt != 0) { - TCITEM tcItem = {0}; - - tcItem.mask = TCIF_PARAM; - if (iItem == iItemCnt) { iItem--; diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 964d2639..3222da87 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -1329,7 +1329,6 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) HMENU SelfMenu; HINSTANCE hInst; int iDataType; - static int ASCII; SelfIndex=FindGrid(GetMenu(hWnd)); diff --git a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp index 2d663575..7542af95 100644 --- a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp +++ b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp @@ -280,7 +280,7 @@ void PluginsAdminDlg::create(int dialogID, bool isRTL, bool msgDestParent) _tab.insertAtEnd(updates); _tab.insertAtEnd(installed); - rect.bottom -= 100;; + rect.bottom -= 100; _tab.reSizeTo(rect); _tab.display(); diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index 755881f7..de6cd1e1 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -296,7 +296,7 @@ void ToolBar::reset(bool create) else { //Else set the internal imagelist with standard bitmaps - int iconDpiDynamicalSize = NppParameters::getInstance()._dpiManager.scaleX(16);; + int iconDpiDynamicalSize = NppParameters::getInstance()._dpiManager.scaleX(16); ::SendMessage(_hSelf, TB_SETBITMAPSIZE, 0, MAKELPARAM(iconDpiDynamicalSize, iconDpiDynamicalSize)); //TBADDBITMAP addbmp = {_hInst, 0}; diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index 98e98231..38981fc7 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -820,7 +820,7 @@ void WindowsDlg::doClose() nmdlg.Items = new UINT[nmdlg.nItems]; vector key; key.resize(n, 0x7fffffff); - for (int i=-1, j=0;; ++j) + for (int i=-1, j=0; ; ++j) { i = ListView_GetNextItem(_hList, i, LVNI_SELECTED); if (i == -1) break; @@ -880,7 +880,7 @@ void WindowsDlg::doSortToTabs() nmdlg.nItems = ListView_GetItemCount(_hList); nmdlg.Items = new UINT[nmdlg.nItems]; - for (int i=-1, j=0;; ++j) + for (int i=-1, j=0; ; ++j) { i = ListView_GetNextItem(_hList, i, LVNI_ALL); if (i == -1) diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index a833466a..8bedc619 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -1613,7 +1613,6 @@ static void ColouriseUserDoc(Sci_PositionU startPos, Sci_Position length, int in int nlCount = 0; int continueCommentBlock = 0; - bool startOfDelimiter = false; int decSeparator = SEPARATOR_DOT; vector lastNestedGroup; @@ -2003,8 +2002,7 @@ static void ColouriseUserDoc(Sci_PositionU startPos, Sci_Position length, int in dontMove = true; if (sc.atLineEnd) checkEOL = EOL_SKIP_CHECK; - if (lineCommentNesting & SCE_USER_MASK_NESTING_NUMBERS) - startOfDelimiter = true; + break; } } @@ -2034,8 +2032,7 @@ static void ColouriseUserDoc(Sci_PositionU startPos, Sci_Position length, int in dontMove = true; if (sc.atLineEnd) checkEOL = EOL_SKIP_CHECK; - if (commentNesting & SCE_USER_MASK_NESTING_NUMBERS) - startOfDelimiter = true; + break; } }