diff options
author | Oliver Schneider <oliver@assarbad.net> | 2016-01-11 23:42:09 +0300 |
---|---|---|
committer | Oliver Schneider <oliver@assarbad.net> | 2016-01-11 23:42:09 +0300 |
commit | aae4db317425c7a4da0ab9fe45636de627148a6c (patch) | |
tree | ec8a5e7e2771d5db5bbb6336aaca8cd07fb2ebf1 /windirstat | |
parent | 45ac944c4fc612f9009a47e91e88c53aa80b92ca (diff) |
Using stdafx.h everywhere
Renaming variables that were shadowed by those from the nesting scope
Diffstat (limited to 'windirstat')
-rw-r--r-- | windirstat/Controls/ownerdrawnlistcontrol.cpp | 6 | ||||
-rw-r--r-- | windirstat/Controls/treemap.cpp | 14 | ||||
-rw-r--r-- | windirstat/ModalShellApi.cpp | 25 | ||||
-rw-r--r-- | windirstat/ModalShellApi.h | 3 | ||||
-rw-r--r-- | windirstat/dirstatdoc.cpp | 14 | ||||
-rw-r--r-- | windirstat/dirstatdoc.h | 1 | ||||
-rw-r--r-- | windirstat/layout.cpp | 6 | ||||
-rw-r--r-- | windirstat/mountpoints.cpp | 8 |
8 files changed, 20 insertions, 57 deletions
diff --git a/windirstat/Controls/ownerdrawnlistcontrol.cpp b/windirstat/Controls/ownerdrawnlistcontrol.cpp index 656e864..a3f1a00 100644 --- a/windirstat/Controls/ownerdrawnlistcontrol.cpp +++ b/windirstat/Controls/ownerdrawnlistcontrol.cpp @@ -714,14 +714,14 @@ BOOL COwnerDrawnListControl::OnEraseBkgnd(CDC* pDC) fill.bottom = top + GetRowHeight() - gridWidth; int left = 0; - for(int i = 0; i < vertical.GetSize(); i++) + for(int j = 0; j < vertical.GetSize(); j++) { fill.left = left; - fill.right = vertical[i] - gridWidth; + fill.right = vertical[j] - gridWidth; pDC->FillSolidRect(fill, bgcolor); - left = vertical[i]; + left = vertical[j]; } fill.left = left; fill.right = rcClient.right; diff --git a/windirstat/Controls/treemap.cpp b/windirstat/Controls/treemap.cpp index 9183e06..ab32ea1 100644 --- a/windirstat/Controls/treemap.cpp +++ b/windirstat/Controls/treemap.cpp @@ -100,23 +100,23 @@ void CColorSpace::NormalizeColor(int& red, int& green, int& blue) void CColorSpace::DistributeFirst(int& first, int& second, int& third) { - int h = (first - 255) / 2; + const int h = (first - 255) / 2; first = 255; second += h; third += h; if(second > 255) { - int h = second - 255; + const int j = second - 255; second = 255; - third += h; + third += j; WEAK_ASSERT(third <= 255); } else if(third > 255) { - int h = third - 255; + const int j = third - 255; third = 255; - second += h; + second += j; WEAK_ASSERT(second <= 255); } } @@ -830,9 +830,9 @@ double CTreemap::KDirStat_CalcutateNextRow(Item *parent, const int nextChild, do // Rectangle(childSize) = childWidth * virtualRowHeight // Rectangle(childSize) = childSize / mySize * width - double childWidth = childSize / mySize * width / virtualRowHeight; + double childWidth_ = childSize / mySize * width / virtualRowHeight; - if(childWidth / virtualRowHeight < _minProportion) + if(childWidth_ / virtualRowHeight < _minProportion) { WEAK_ASSERT(i > nextChild); // because width >= 1 and _minProportion < 1. // For the first child we have: diff --git a/windirstat/ModalShellApi.cpp b/windirstat/ModalShellApi.cpp index 4abbfa7..6daa9b8 100644 --- a/windirstat/ModalShellApi.cpp +++ b/windirstat/ModalShellApi.cpp @@ -34,8 +34,7 @@ namespace { enum { - EMPTY_RECYCLE_BIN, - DELETE_FILE + DELETE_FILE = 1 }; } @@ -44,13 +43,6 @@ CModalShellApi::CModalShellApi() { } -void CModalShellApi::EmptyRecycleBin() -{ - m_operation = EMPTY_RECYCLE_BIN; - - DoModal(); -} - void CModalShellApi::DeleteFile(LPCTSTR fileName, bool toRecycleBin) { m_operation = DELETE_FILE; @@ -64,12 +56,6 @@ void CModalShellApi::DoOperation() { switch (m_operation) { - case EMPTY_RECYCLE_BIN: - { - DoEmptyRecycleBin(); - } - break; - case DELETE_FILE: { DoDeleteFile(); @@ -78,15 +64,6 @@ void CModalShellApi::DoOperation() } } -void CModalShellApi::DoEmptyRecycleBin() -{ - HRESULT hr = ::SHEmptyRecycleBin(*AfxGetMainWnd(), NULL, 0); - if(FAILED(hr)) - { - AfxMessageBox(MdGetWinErrorText(hr)); - } -} - void CModalShellApi::DoDeleteFile() { int len = m_fileName.GetLength(); diff --git a/windirstat/ModalShellApi.h b/windirstat/ModalShellApi.h index 92da426..3753c91 100644 --- a/windirstat/ModalShellApi.h +++ b/windirstat/ModalShellApi.h @@ -40,14 +40,11 @@ class CModalShellApi : public CModalApiShuttle public: CModalShellApi(); - bool IsRecycleBinApiSupported(); - void EmptyRecycleBin(); void DeleteFile(LPCTSTR fileName, bool toRecycleBin); protected: virtual void DoOperation(); - void DoEmptyRecycleBin(); void DoDeleteFile(); int m_operation; // Enum specifying the desired operation diff --git a/windirstat/dirstatdoc.cpp b/windirstat/dirstatdoc.cpp index dee3ede..d06571a 100644 --- a/windirstat/dirstatdoc.cpp +++ b/windirstat/dirstatdoc.cpp @@ -156,9 +156,9 @@ void CDirstatDoc::DecodeSelection(CString s, CString& folder, CStringArray& driv if(sa.GetSize() > 1) { - for(int i = 0; i < sa.GetSize(); i++) + for(int j = 0; j < sa.GetSize(); j++) { - CString d = sa[i]; + CString d = sa[j]; ASSERT(2 == d.GetLength()); ASSERT(wds::chrColon == d[1]); @@ -1138,7 +1138,6 @@ BEGIN_MESSAGE_MAP(CDirstatDoc, CDocument) ON_COMMAND(ID_REFRESHALL, OnRefreshall) ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateEditCopy) ON_COMMAND(ID_EDIT_COPY, OnEditCopy) - ON_COMMAND(ID_CLEANUP_EMPTYRECYCLEBIN, OnCleanupEmptyrecyclebin) ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWFREESPACE, OnUpdateViewShowfreespace) ON_COMMAND(ID_VIEW_SHOWFREESPACE, OnViewShowfreespace) ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWUNKNOWN, OnUpdateViewShowunknown) @@ -1227,15 +1226,6 @@ void CDirstatDoc::OnEditCopy() AfxMessageBox(paths); } -void CDirstatDoc::OnCleanupEmptyrecyclebin() -{ - CModalShellApi msa; - msa.EmptyRecycleBin(); - - RefreshRecyclers(); - UpdateAllViews(NULL); -} - void CDirstatDoc::OnUpdateViewShowfreespace(CCmdUI *pCmdUI) { pCmdUI->SetCheck(m_showFreeSpace); diff --git a/windirstat/dirstatdoc.h b/windirstat/dirstatdoc.h index 9352473..cab593f 100644 --- a/windirstat/dirstatdoc.h +++ b/windirstat/dirstatdoc.h @@ -193,7 +193,6 @@ protected: afx_msg void OnRefreshall(); afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI); afx_msg void OnEditCopy(); - afx_msg void OnCleanupEmptyrecyclebin(); afx_msg void OnUpdateViewShowfreespace(CCmdUI *pCmdUI); afx_msg void OnViewShowfreespace(); afx_msg void OnUpdateViewShowunknown(CCmdUI *pCmdUI); diff --git a/windirstat/layout.cpp b/windirstat/layout.cpp index cd9ea89..e4f9c38 100644 --- a/windirstat/layout.cpp +++ b/windirstat/layout.cpp @@ -104,9 +104,9 @@ void CLayout::OnDestroy() void CLayout::OnSize() { - CRect rc; - m_dialog->GetWindowRect(rc); - CSize newDialogSize = rc.Size(); + CRect wrc; + m_dialog->GetWindowRect(wrc); + CSize newDialogSize = wrc.Size(); CSize diff = newDialogSize - m_originalDialogSize; diff --git a/windirstat/mountpoints.cpp b/windirstat/mountpoints.cpp index 33023eb..64a074d 100644 --- a/windirstat/mountpoints.cpp +++ b/windirstat/mountpoints.cpp @@ -161,9 +161,9 @@ void CReparsePoints::GetAllMountPoints() uniquePath += point; TCHAR mountedVolume[_MAX_PATH]; - BOOL b = ::GetVolumeNameForVolumeMountPoint(uniquePath, mountedVolume, countof(mountedVolume)); + const BOOL bGotMountPoints = ::GetVolumeNameForVolumeMountPoint(uniquePath, mountedVolume, countof(mountedVolume)); - if(!b) + if(!bGotMountPoints) { VTRACE(_T("GetVolumeNameForVolumeMountPoint(%s) failed (%d)."), uniquePath.GetBuffer(), ::GetLastError()); continue; @@ -190,9 +190,9 @@ void CReparsePoints::GetAllMountPoints() POSITION pos = m_volume.GetStartPosition(); while(pos != NULL) { - CString volume; + CString lvolume; PointVolumeArray *pva = NULL; - m_volume.GetNextAssoc(pos, volume, pva); + m_volume.GetNextAssoc(pos, lvolume, pva); pva->AssertValid(); } #endif |