mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-07 05:54:40 +02:00
Code enhancement: remove some MSVS analysis warning (Part 5)
This commit is contained in:
parent
ab5d29b6fe
commit
36da61dc35
@ -443,7 +443,7 @@ void Gripper::doTabReordering(POINT pt)
|
|||||||
auto iSel = ::SendMessage(_hTab, TCM_GETCURSEL, 0, 0);
|
auto iSel = ::SendMessage(_hTab, TCM_GETCURSEL, 0, 0);
|
||||||
::SendMessage(_hTab, TCM_DELETEITEM, iSel, 0);
|
::SendMessage(_hTab, TCM_DELETEITEM, iSel, 0);
|
||||||
}
|
}
|
||||||
else if (_hTab == hTabOld)
|
else if (_hTab && _hTab == hTabOld)
|
||||||
{
|
{
|
||||||
// delete item on switch between tabs
|
// delete item on switch between tabs
|
||||||
::SendMessage(_hTab, TCM_DELETEITEM, iItemOld, 0);
|
::SendMessage(_hTab, TCM_DELETEITEM, iItemOld, 0);
|
||||||
|
@ -127,10 +127,10 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam,
|
|||||||
|
|
||||||
bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned char endRange, intptr_t startPos, bool direction, bool wrap)
|
bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned char endRange, intptr_t startPos, bool direction, bool wrap)
|
||||||
{
|
{
|
||||||
size_t totalSize = (*_ppEditView)->getCurrentDocLen();
|
int64_t totalSize = (*_ppEditView)->getCurrentDocLen();
|
||||||
if (startPos == -1)
|
if (startPos == -1)
|
||||||
startPos = direction == dirDown ? 0 : totalSize - 1;
|
startPos = direction == dirDown ? 0 : totalSize - 1;
|
||||||
if (static_cast<size_t>(startPos) > totalSize)
|
if (startPos > totalSize)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char *content = new char[totalSize + 1];
|
char *content = new char[totalSize + 1];
|
||||||
@ -139,8 +139,8 @@ bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned cha
|
|||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
size_t found = 0;
|
size_t found = 0;
|
||||||
|
|
||||||
for (intptr_t i = startPos - (direction == dirUp ? 1 : 0);
|
for (int64_t i = startPos - (direction == dirDown ? 0 : 1);
|
||||||
(direction == dirDown) ? i < static_cast<long long>(totalSize) : i >= 0 ;
|
(direction == dirDown) ? i < totalSize : i >= 0 ;
|
||||||
(direction == dirDown) ? (++i) : (--i))
|
(direction == dirDown) ? (++i) : (--i))
|
||||||
{
|
{
|
||||||
if (static_cast<unsigned char>(content[i]) >= beginRange && static_cast<unsigned char>(content[i]) <= endRange)
|
if (static_cast<unsigned char>(content[i]) >= beginRange && static_cast<unsigned char>(content[i]) <= endRange)
|
||||||
@ -155,7 +155,7 @@ bool FindCharsInRangeDlg::findCharInRange(unsigned char beginRange, unsigned cha
|
|||||||
{
|
{
|
||||||
if (wrap)
|
if (wrap)
|
||||||
{
|
{
|
||||||
for (size_t i = (direction == dirUp ? totalSize - 1 : 0);
|
for (int64_t i = (direction == dirDown ? 0: totalSize - 1);
|
||||||
(direction == dirDown) ? i < totalSize : i >= 0 ;
|
(direction == dirDown) ? i < totalSize : i >= 0 ;
|
||||||
(direction == dirDown) ? (++i) : (--i))
|
(direction == dirDown) ? (++i) : (--i))
|
||||||
{
|
{
|
||||||
|
@ -82,6 +82,9 @@ void CReadDirectoryChanges::AddDirectory( LPCTSTR szDirectory, BOOL bWatchSubtre
|
|||||||
if (!m_hThread)
|
if (!m_hThread)
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
|
if (!m_hThread)
|
||||||
|
return;
|
||||||
|
|
||||||
CReadChangesRequest* pRequest = new CReadChangesRequest(m_pServer, szDirectory, bWatchSubtree, dwNotifyFilter, dwBufferSize);
|
CReadChangesRequest* pRequest = new CReadChangesRequest(m_pServer, szDirectory, bWatchSubtree, dwNotifyFilter, dwBufferSize);
|
||||||
QueueUserAPC(CReadChangesServer::AddDirectoryProc, m_hThread, (ULONG_PTR)pRequest);
|
QueueUserAPC(CReadChangesServer::AddDirectoryProc, m_hThread, (ULONG_PTR)pRequest);
|
||||||
}
|
}
|
||||||
|
@ -943,7 +943,10 @@ void WindowsDlg::doCount()
|
|||||||
|
|
||||||
void WindowsDlg::doSort()
|
void WindowsDlg::doSort()
|
||||||
{
|
{
|
||||||
size_t count = (_pTab != NULL) ? _pTab->nbItem() : 0;
|
if (_pTab == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
size_t count = _pTab->nbItem();
|
||||||
std::vector<UINT> items(count);
|
std::vector<UINT> items(count);
|
||||||
auto currrentTabIndex = _pTab->getCurrentTabIndex();
|
auto currrentTabIndex = _pTab->getCurrentTabIndex();
|
||||||
NMWINDLG nmdlg = {};
|
NMWINDLG nmdlg = {};
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
<Rule Id="C26433" Action="Hidden" />
|
<Rule Id="C26433" Action="Hidden" />
|
||||||
<Rule Id="C26434" Action="Hidden" />
|
<Rule Id="C26434" Action="Hidden" />
|
||||||
<Rule Id="C26435" Action="Warning" />
|
<Rule Id="C26435" Action="Warning" />
|
||||||
<Rule Id="C26436" Action="Warning" />
|
<Rule Id="C26436" Action="Hidden" /> <!-- The type 'symbol' with a virtual function needs either public virtual or protected non-virtual destructor -->
|
||||||
<Rule Id="C26437" Action="Warning" />
|
<Rule Id="C26437" Action="Warning" />
|
||||||
<Rule Id="C26438" Action="Error" /> <!-- Avoid goto -->
|
<Rule Id="C26438" Action="Error" /> <!-- Avoid goto -->
|
||||||
<Rule Id="C26439" Action="Warning" />
|
<Rule Id="C26439" Action="Warning" />
|
||||||
@ -71,7 +71,7 @@
|
|||||||
<Rule Id="C26473" Action="Warning" />
|
<Rule Id="C26473" Action="Warning" />
|
||||||
<Rule Id="C26474" Action="Hidden" /> <!-- Don't cast between pointer types when the conversion could be implicit. -->
|
<Rule Id="C26474" Action="Hidden" /> <!-- Don't cast between pointer types when the conversion could be implicit. -->
|
||||||
<Rule Id="C26475" Action="Hidden" /> <!-- Do not use function style C-casts. -->
|
<Rule Id="C26475" Action="Hidden" /> <!-- Do not use function style C-casts. -->
|
||||||
<Rule Id="C26476" Action="Warning" />
|
<Rule Id="C26476" Action="Hidden" /> <!-- Expression/symbol 'name' uses a naked union 'union' with multiple type pointers: Use variant instead -->
|
||||||
<Rule Id="C26477" Action="Hidden" /> <!-- Use 'nullptr' rather than 0 or NULL -->
|
<Rule Id="C26477" Action="Hidden" /> <!-- Use 'nullptr' rather than 0 or NULL -->
|
||||||
<Rule Id="C26478" Action="Warning" />
|
<Rule Id="C26478" Action="Warning" />
|
||||||
<Rule Id="C26479" Action="Warning" />
|
<Rule Id="C26479" Action="Warning" />
|
||||||
@ -205,7 +205,7 @@
|
|||||||
<Rule Id="C33011" Action="Warning" />
|
<Rule Id="C33011" Action="Warning" />
|
||||||
<Rule Id="C33020" Action="Warning" />
|
<Rule Id="C33020" Action="Warning" />
|
||||||
<Rule Id="C6001" Action="Warning" />
|
<Rule Id="C6001" Action="Warning" />
|
||||||
<Rule Id="C6011" Action="Warning" />
|
<Rule Id="C6011" Action="Error" /> <!-- Dereferencing NULL pointer 'pointer-name'. -->
|
||||||
<Rule Id="C6029" Action="Warning" />
|
<Rule Id="C6029" Action="Warning" />
|
||||||
<Rule Id="C6031" Action="None" />
|
<Rule Id="C6031" Action="None" />
|
||||||
<Rule Id="C6053" Action="Warning" />
|
<Rule Id="C6053" Action="Warning" />
|
||||||
@ -255,7 +255,7 @@
|
|||||||
<Rule Id="C6284" Action="Warning" />
|
<Rule Id="C6284" Action="Warning" />
|
||||||
<Rule Id="C6285" Action="Warning" />
|
<Rule Id="C6285" Action="Warning" />
|
||||||
<Rule Id="C6286" Action="Warning" />
|
<Rule Id="C6286" Action="Warning" />
|
||||||
<Rule Id="C6287" Action="Warning" />
|
<Rule Id="C6287" Action="Hidden" /> <!-- Redundant code: the left and right subexpressions are identical -->
|
||||||
<Rule Id="C6288" Action="Warning" />
|
<Rule Id="C6288" Action="Warning" />
|
||||||
<Rule Id="C6289" Action="Warning" />
|
<Rule Id="C6289" Action="Warning" />
|
||||||
<Rule Id="C6290" Action="Warning" />
|
<Rule Id="C6290" Action="Warning" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user