diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-26 19:41:12 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-07-30 22:33:07 (GMT) |
commit | 084aa40ecb4ce50029db61b19b7ed614d59d0a0d (patch) | |
tree | f7823c19f05bbb0dc1a58db30e55f7e041a053a8 | |
parent | f5056d28c56155ca1ba137bff30255f42a74f70a (diff) | |
download | CMake-084aa40ecb4ce50029db61b19b7ed614d59d0a0d.zip CMake-084aa40ecb4ce50029db61b19b7ed614d59d0a0d.tar.gz CMake-084aa40ecb4ce50029db61b19b7ed614d59d0a0d.tar.bz2 |
clang-tidy: fix `modernize-loop-convert` lints
-rw-r--r-- | Source/CPack/cmCPackDragNDropGenerator.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx index 768bfbe..aa63ff7 100644 --- a/Source/CPack/cmCPackDragNDropGenerator.cxx +++ b/Source/CPack/cmCPackDragNDropGenerator.cxx @@ -574,16 +574,18 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir, header_data.push_back(0); header_data.push_back(languages.size()); + // NOLINTNEXTLINE(modernize-loop-convert): `HAVE_CoreServices` needs `i` for (cmList::size_type i = 0; i < languages.size(); ++i) { + auto const& language = languages[i]; CFStringRef language_cfstring = CFStringCreateWithCString( - nullptr, languages[i].c_str(), kCFStringEncodingUTF8); + nullptr, language.c_str(), kCFStringEncodingUTF8); CFStringRef iso_language = CFLocaleCreateCanonicalLanguageIdentifierFromString( nullptr, language_cfstring); if (!iso_language) { cmCPackLogger(cmCPackLog::LOG_ERROR, - languages[i] << " is not a recognized language" - << std::endl); + language << " is not a recognized language" + << std::endl); } char iso_language_cstr[65]; CFStringGetCString(iso_language, iso_language_cstr, |