diff --git a/.github/workflows/CI_MS_analysis.yml b/.github/workflows/CI_MS_analysis.yml new file mode 100644 index 0000000..ba6b4ed --- /dev/null +++ b/.github/workflows/CI_MS_analysis.yml @@ -0,0 +1,24 @@ +name: CI_build + +on: [push, pull_request] + +jobs: + build: + + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + build_configuration: [Release, Debug] + build_platform: [x64, Win32, ARM64] + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + + - name: MSBuild of plugin dll + working-directory: HexEditor\projects\2003\ + run: msbuild HexEditor.vcxproj /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143" /p:RunCodeAnalysis=true diff --git a/Common/Ccpp/Common.cpp b/Common/Ccpp/Common.cpp index d161812..ca79abb 100644 --- a/Common/Ccpp/Common.cpp +++ b/Common/Ccpp/Common.cpp @@ -30,6 +30,7 @@ //#include "Buffer.h" //MODIFIED by HEXEDIT #include "NppDarkMode.h" //MODIFIED by HEXEDIT, added +/*NOT USED by HEXEDIT void printInt(int int2print) { TCHAR str[32]; @@ -113,7 +114,7 @@ generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath) return fullFilePathName; } -/*NOT USED by HEXEDIT + void writeFileContent(const TCHAR *file2write, const char *content2write) { Win32_IO_File file(file2write); @@ -186,7 +187,6 @@ generic_string getFolderName(HWND parent, const TCHAR *defaultDir) { return folderBrowser(parent, TEXT("Select a folder"), 0, defaultDir); } -NOT USED by HEXEDIT*/ void ClientRectToScreenRect(HWND hWnd, RECT* rect) @@ -681,7 +681,7 @@ generic_string pathAppend(generic_string& strDest, const generic_string& str2app return strDest; } - +NOT USED by HEXEDIT*/ COLORREF getCtrlBgColor(HWND hWnd) { COLORREF crRet = CLR_INVALID; @@ -720,7 +720,7 @@ COLORREF getCtrlBgColor(HWND hWnd) return crRet; } - +/*NOT USED by HEXEDIT generic_string stringToUpper(generic_string strToConvert) { std::transform(strToConvert.begin(), strToConvert.end(), strToConvert.begin(), @@ -950,7 +950,7 @@ bool str2Clipboard(const generic_string &str2cpy, HWND hwnd) return true; } -/*NOT USED by HEXEDIT + bool buf2Clipborad(const std::vector& buffers, bool isFullPath, HWND hwnd) { const generic_string crlf = _T("\r\n"); @@ -970,7 +970,6 @@ bool buf2Clipborad(const std::vector& buffers, bool isFullPath, HWND hw return str2Clipboard(selection, hwnd); return false; } -NOT USED by HEXEDIT*/ bool matchInList(const TCHAR *fileName, const std::vector & patterns) { @@ -1026,6 +1025,7 @@ bool allPatternsAreExclusion(const std::vector patterns) return !oneInclusionPatternFound; } +NOT USED by HEXEDIT*/ generic_string GetLastErrorAsString(DWORD errorCode) { generic_string errorMsg(_T("")); @@ -1048,6 +1048,7 @@ generic_string GetLastErrorAsString(DWORD errorCode) return errorMsg; } +/*NOT USED by HEXEDIT HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText, bool isRTL) { if (!toolID || !hDlg || !pszText) @@ -1140,7 +1141,6 @@ HWND CreateToolTipRect(int toolID, HWND hWnd, HINSTANCE hInst, const PTSTR pszTe return hwndTip; } -/*NOT USED by HEXEDIT bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check) { bool isOK = false; @@ -1272,7 +1272,6 @@ bool isCertificateValidated(const generic_string & fullFilePath, const generic_s return isOK; } -NOT USED by HEXEDIT*/ bool isAssoCommandExisting(LPCTSTR FullPathName) { @@ -1533,7 +1532,6 @@ bool removeReadOnlyFlagFromFileAttributes(const wchar_t* fileFullPath) return (::SetFileAttributes(fileFullPath, dwFileAttribs) != FALSE); } -/*NOT USED by HEXEDIT // "For file I/O, the "\\?\" prefix to a path string tells the Windows APIs to disable all string parsing // and to send the string that follows it straight to the file system..." @@ -1642,7 +1640,6 @@ bool isUnsupportedFileName(const TCHAR* szFileName) const generic_string fileName = szFileName; return isUnsupportedFileName(fileName); } -NOT USED by HEXEDIT*/ Version::Version(const generic_string& versionStr) { @@ -1698,7 +1695,6 @@ Version::Version(const generic_string& versionStr) } } -/*NOT USED by HEXEDIT void Version::setVersionFrom(const generic_string& filePath) { if (!filePath.empty() && ::PathFileExists(filePath.c_str())) @@ -1725,7 +1721,6 @@ void Version::setVersionFrom(const generic_string& filePath) delete[] buffer; } } -NOT USED by HEXEDIT*/ generic_string Version::toString() { @@ -1829,3 +1824,4 @@ bool Version::isCompatibleTo(const Version& from, const Version& to) const return false; } +NOT USED by HEXEDIT*/ diff --git a/HexEditor/src/HEXDialog.cpp b/HexEditor/src/HEXDialog.cpp index 451b087..cc72a43 100644 --- a/HexEditor/src/HEXDialog.cpp +++ b/HexEditor/src/HEXDialog.cpp @@ -4480,7 +4480,7 @@ void HexEdit::ConvertSelHEXToNpp(void) //https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp void HexEdit::getText(char* dest, size_t start, size_t end) const { - Sci_TextRange tr; + Sci_TextRange tr{}; tr.chrg.cpMin = static_cast(start); tr.chrg.cpMax = static_cast(end); tr.lpstrText = dest; diff --git a/HexEditor/src/HelpDlg/URLCtrl.cpp b/HexEditor/src/HelpDlg/URLCtrl.cpp index ca08337..f27af3e 100644 --- a/HexEditor/src/HelpDlg/URLCtrl.cpp +++ b/HexEditor/src/HelpDlg/URLCtrl.cpp @@ -208,7 +208,7 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) if (_hfUnderlined == 0) { // Get the default GUI font - LOGFONT lf; + LOGFONT lf{}; HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); // Add UNDERLINE attribute diff --git a/HexEditor/src/Hex.cpp b/HexEditor/src/Hex.cpp index 3392ed9..2f4755e 100644 --- a/HexEditor/src/Hex.cpp +++ b/HexEditor/src/Hex.cpp @@ -616,7 +616,7 @@ void CleanScintillaBuf(HWND hWnd) */ UINT ScintillaGetText(char *text, INT start, INT end) { - Sci_TextRange tr; + Sci_TextRange tr{}; tr.chrg.cpMin = start; tr.chrg.cpMax = end; tr.lpstrText = text; @@ -625,7 +625,7 @@ UINT ScintillaGetText(char *text, INT start, INT end) UINT ScintillaGetText(HWND hWnd, char *text, INT start, INT end) { - Sci_TextRange tr; + Sci_TextRange tr{}; tr.chrg.cpMin = start; tr.chrg.cpMax = end; tr.lpstrText = text; diff --git a/HexEditor/src/UserDlg/FindReplaceDialog.cpp b/HexEditor/src/UserDlg/FindReplaceDialog.cpp index bbc181e..da48c1e 100644 --- a/HexEditor/src/UserDlg/FindReplaceDialog.cpp +++ b/HexEditor/src/UserDlg/FindReplaceDialog.cpp @@ -80,8 +80,8 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM } case WM_ACTIVATE: { - UINT posBeg; - UINT posEnd; + UINT posBeg = 0; + UINT posEnd = 0; ::SendMessage(_hParentHandle, HEXM_GETSEL, (WPARAM)&posBeg, (LPARAM)&posEnd); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_IN_SEL), ((posBeg == posEnd) ? FALSE : TRUE)); @@ -187,7 +187,7 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM void FindReplaceDlg::initDialog(void) { - TCITEM item; + TCITEM item{}; TCHAR txtTab[32]; item.mask = TCIF_TEXT; @@ -689,7 +689,7 @@ void FindReplaceDlg::processAll(UINT process) } case REPLACE_ALL: { - UINT pos; + UINT pos = 0; ::SendMessage(_hParentHandle, HEXM_GETPOS, 0, (LPARAM)&pos); ::SendMessage(_hParentHandle, HEXM_SETPOS, 0, (LPARAM)pos); diff --git a/HexEditor/src/misc/ColorCombo.cpp b/HexEditor/src/misc/ColorCombo.cpp index 72d9130..883d538 100644 --- a/HexEditor/src/misc/ColorCombo.cpp +++ b/HexEditor/src/misc/ColorCombo.cpp @@ -51,7 +51,7 @@ LRESULT ColorCombo::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara case WM_LBUTTONDBLCLK: { RECT rc; - POINT pt; + POINT pt{}; ::GetWindowRect(hwnd, &rc); pt.x = rc.left; pt.y = rc.bottom;