diff options
author | Brad King <brad.king@kitware.com> | 2017-09-18 18:11:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-19 13:32:25 (GMT) |
commit | 706b37b7f597f449cc3d02bd50123c4e7277eadb (patch) | |
tree | bbb9c41b56c4205e8c28578f8b13ee6aa4ad0825 /Source/CursesDialog | |
parent | 4547d9a83030f8ae7e636cef16a261c65e6feb40 (diff) | |
download | CMake-706b37b7f597f449cc3d02bd50123c4e7277eadb.zip CMake-706b37b7f597f449cc3d02bd50123c4e7277eadb.tar.gz CMake-706b37b7f597f449cc3d02bd50123c4e7277eadb.tar.bz2 |
Enable clang-tidy modernize-loop-convert lint
Fix remaining diagnostics by this lint and remove it from our list of
disabled lints.
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.cxx | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesOptionsWidget.cxx | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesStringWidget.cxx | 4 |
3 files changed, 5 insertions, 9 deletions
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx index 8596281..e7ed097 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx @@ -72,9 +72,8 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( this->Entry = ow; std::vector<std::string> options; cmSystemTools::ExpandListArgument(stringsProp, options); - for (std::vector<std::string>::iterator si = options.begin(); - si != options.end(); ++si) { - ow->AddOption(*si); + for (auto const& opt : options) { + ow->AddOption(opt); } ow->SetOption(value); } else { diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx index d26a98f..a8c4933 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.cxx +++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx @@ -75,9 +75,8 @@ void cmCursesOptionsWidget::SetOption(const std::string& value) this->CurrentOption = 0; // default to 0 index this->SetValue(value); int index = 0; - for (std::vector<std::string>::iterator i = this->Options.begin(); - i != this->Options.end(); ++i) { - if (*i == value) { + for (auto const& opt : this->Options) { + if (opt == value) { this->CurrentOption = index; } index++; diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx index 8cb9c1f..5e2a329 100644 --- a/Source/CursesDialog/cmCursesStringWidget.cxx +++ b/Source/CursesDialog/cmCursesStringWidget.cxx @@ -188,9 +188,7 @@ bool cmCursesStringWidget::PrintKeys() char fmt_s[] = "%s"; char firstLine[512]; // Clean the toolbar - for (int i = 0; i < 512; i++) { - firstLine[i] = ' '; - } + memset(firstLine, ' ', sizeof(firstLine)); firstLine[511] = '\0'; curses_move(y - 4, 0); printw(fmt_s, firstLine); |