FileLocation fileloc[3];
String strDesc[3];
const String sUntitled[] = { _("Untitled left"), paths.GetSize() < 3 ? _("Untitled right") : _("untitled middle"), _("Untitled right") };
- for (int i = 0; i < paths.size(); ++i)
+ for (size_t i = 0; i < paths.size(); ++i)
{
if (!pdi[0]->diffcode.exists(i) &&
std::count(pdi, pdi + paths.size(), pdi[0]) == static_cast<ptrdiff_t>(paths.size()))
{
if (m_nDirs < 3)
{
- assert(col>=0 && col<std::size(f_cols));
+ assert(col>=0 && col<static_cast<int>(std::size(f_cols)));
return strutils::format(_T("WDirHdr_%s"), f_cols[col].regName);
}
else
{
- assert(col>=0 && col<std::size(f_cols3));
+ assert(col>=0 && col<static_cast<int>(std::size(f_cols3)));
return strutils::format(_T("WDirHdr_%s"), f_cols3[col].regName);
}
}
{
if (m_nDirs < 3)
{
- assert(col>=0 && col<std::size(f_cols));
+ assert(col>=0 && col<static_cast<int>(std::size(f_cols)));
return f_cols[col].physicalIndex;
}
else
{
- assert(col>=0 && col<std::size(f_cols3));
+ assert(col>=0 && col<static_cast<int>(std::size(f_cols3)));
return f_cols3[col].physicalIndex;
}
}
{
if (m_nDirs < 3)
{
- if (col < 0 || col >= std::size(f_cols))
+ if (col < 0 || col >= static_cast<int>(std::size(f_cols)))
{
assert(false); // fix caller, should not ask for nonexistent columns
return nullptr;
}
else
{
- if (col < 0 || col >= std::size(f_cols3))
+ if (col < 0 || col >= static_cast<int>(std::size(f_cols3)))
{
assert(false); // fix caller, should not ask for nonexistent columns
return nullptr;
int nDirs = m_nDirs;
if (nDirs < 3)
{
- if (col < 0 || col >= std::size(f_cols))
+ if (col < 0 || col >= static_cast<int>(std::size(f_cols)))
{
assert(false); // fix caller, should not ask for nonexistent columns
return false;
*/
String CEditorFilePathBar::GetText(int pane) const
{
- ASSERT (pane >= 0 && pane < std::size(m_Edit));
+ ASSERT (pane >= 0 && pane < static_cast<int>(std::size(m_Edit)));
// Check for `nullptr` since window may be closing..
if (m_hWnd == nullptr)
*/
void CEditorFilePathBar::SetText(int pane, const String& sString)
{
- ASSERT (pane >= 0 && pane < std::size(m_Edit));
+ ASSERT (pane >= 0 && pane < static_cast<int>(std::size(m_Edit)));
// Check for `nullptr` since window may be closing..
if (m_hWnd == nullptr)
*/
void CEditorFilePathBar::SetActive(int pane, bool bActive)
{
- ASSERT (pane >= 0 && pane < std::size(m_Edit));
+ ASSERT (pane >= 0 && pane < static_cast<int>(std::size(m_Edit)));
// Check for `nullptr` since window may be closing..
if (m_hWnd == nullptr)
*/
HMENU CMainFrame::NewMenu(int view, int ID)
{
- int menu_view, index;
+ int menu_view;
if (m_pMenus[view] == nullptr)
{
m_pMenus[view].reset(new BCMenu());
}
// Load bitmaps to menuitems
- for (index = 0; index < std::size(m_MenuIcons); index ++)
+ for (auto& menu_icon: m_MenuIcons)
{
- if (menu_view == (m_MenuIcons[index].menusToApply & menu_view))
+ if (menu_view == (menu_icon.menusToApply & menu_view))
{
- m_pMenus[view]->ModifyODMenu(nullptr, m_MenuIcons[index].menuitemID, m_MenuIcons[index].iconResID);
+ m_pMenus[view]->ModifyODMenu(nullptr, menu_icon.menuitemID, menu_icon.iconResID);
}
}
for (auto& projItem : project.Items())
{
projItem.GetPaths(tFiles, bRecursive);
- for (int i = 0; i < tFiles.size(); ++i)
+ for (size_t i = 0; i < tFiles.size(); ++i)
{
if (!paths::IsPathAbsolute(tFiles[i]))
tFiles[i] = paths::ConcatPath(paths::GetParentPath(sProject), tFiles[i]);
LoadComboboxStates();
bool bDoUpdateData = true;
- for (int index = 0; index < std::size(m_strPath); index++)
+ for (auto& strPath: m_strPath)
{
- if (!m_strPath[index].empty())
+ if (!strPath.empty())
bDoUpdateData = false;
}
UpdateData(bDoUpdateData);
UpdateData(TRUE);
TrimPaths();
- int index;
int nFiles = 0;
- for (index = 0; index < std::size(m_strPath); index++)
+ for (auto& strPath: m_strPath)
{
- if (index == 2 && m_strPath[index].empty())
+ if (nFiles == 2 && strPath.empty())
break;
m_files.SetSize(nFiles + 1);
- m_files[nFiles] = m_strPath[index];
+ m_files[nFiles] = strPath;
m_dwFlags[nFiles] &= ~FFILEOPEN_READONLY;
- m_dwFlags[nFiles] |= m_bReadOnly[index] ? FFILEOPEN_READONLY : 0;
+ m_dwFlags[nFiles] |= m_bReadOnly[nFiles] ? FFILEOPEN_READONLY : 0;
nFiles++;
}
// If left path is a project-file, load it
return;
}
- for (index = 0; index < nFiles; index++)
+ for (int index = 0; index < nFiles; index++)
{
// If user has edited path by hand, expand environment variables
bool bExpand = false;
paths::PATH_EXISTENCE pathsType;
UpdateData(TRUE);
- int index;
int nFiles = 0;
- for (index = 0; index < std::size(m_strPath); index++)
+ for (auto& strPath: m_strPath)
{
- if (index == 2 && m_strPath[index].empty())
+ if (nFiles == 2 && strPath.empty())
break;
m_files.SetSize(nFiles + 1);
- m_files[nFiles] = m_strPath[index];
+ m_files[nFiles] = strPath;
nFiles++;
}
pathsType = paths::GetPairComparability(m_files);
*/
void COpenView::TrimPaths()
{
- for (int index = 0; index < std::size(m_strPath); index++)
- m_strPath[index] = strutils::trim_ws(m_strPath[index]);
+ for (auto& strPath: m_strPath)
+ strPath = strutils::trim_ws(strPath);
}
/**