Skip to content

Commit

Permalink
- added MS analysis
Browse files Browse the repository at this point in the history
- added inits
  • Loading branch information
chcg committed Sep 16, 2023
1 parent cd657df commit 94032da
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/CI_MS_analysis.yml
Original file line number Diff line number Diff line change
@@ -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
20 changes: 8 additions & 12 deletions Common/Ccpp/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -950,7 +950,7 @@ bool str2Clipboard(const generic_string &str2cpy, HWND hwnd)
return true;
}
/*NOT USED by HEXEDIT
bool buf2Clipborad(const std::vector<Buffer*>& buffers, bool isFullPath, HWND hwnd)
{
const generic_string crlf = _T("\r\n");
Expand All @@ -970,7 +970,6 @@ bool buf2Clipborad(const std::vector<Buffer*>& buffers, bool isFullPath, HWND hw
return str2Clipboard(selection, hwnd);
return false;
}
NOT USED by HEXEDIT*/
bool matchInList(const TCHAR *fileName, const std::vector<generic_string> & patterns)
{
Expand Down Expand Up @@ -1026,6 +1025,7 @@ bool allPatternsAreExclusion(const std::vector<generic_string> patterns)
return !oneInclusionPatternFound;
}
NOT USED by HEXEDIT*/
generic_string GetLastErrorAsString(DWORD errorCode)
{
generic_string errorMsg(_T(""));
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1272,7 +1272,6 @@ bool isCertificateValidated(const generic_string & fullFilePath, const generic_s
return isOK;
}
NOT USED by HEXEDIT*/
bool isAssoCommandExisting(LPCTSTR FullPathName)
{
Expand Down Expand Up @@ -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..."
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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()))
Expand All @@ -1725,7 +1721,6 @@ void Version::setVersionFrom(const generic_string& filePath)
delete[] buffer;
}
}
NOT USED by HEXEDIT*/
generic_string Version::toString()
{
Expand Down Expand Up @@ -1829,3 +1824,4 @@ bool Version::isCompatibleTo(const Version& from, const Version& to) const
return false;
}
NOT USED by HEXEDIT*/
2 changes: 1 addition & 1 deletion HexEditor/src/HEXDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Sci_PositionCR>(start);
tr.chrg.cpMax = static_cast<Sci_PositionCR>(end);
tr.lpstrText = dest;
Expand Down
2 changes: 1 addition & 1 deletion HexEditor/src/HelpDlg/URLCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions HexEditor/src/Hex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions HexEditor/src/UserDlg/FindReplaceDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion HexEditor/src/misc/ColorCombo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 94032da

Please sign in to comment.