Merge remote-tracking branch 'origin/topic/timw/clang-tidy'

* origin/topic/timw/clang-tidy:
  Don't specify 0u for initial value of loops changed to size_t
  Use .empty() instead of checking size against zero
  Use properly-sized loop variables or convert to ranged-for (bugprone-too-small-loop-variable)

Merge changes one type over to ptrdiff_t
This commit is contained in:
Johanna Amann 2020-07-30 17:47:44 +00:00
commit 01fa5611ef
24 changed files with 105 additions and 103 deletions

View file

@ -179,7 +179,7 @@ zeek::Options zeek::parse_cmdline(int argc, char** argv)
rval.run_unit_tests = true;
for ( auto i = 0; i < std::distance(first, separator); ++i )
for ( ptrdiff_t i = 0; i < std::distance(first, separator); ++i )
rval.doctest_args.emplace_back(argv[i]);
}
else
@ -250,7 +250,7 @@ zeek::Options zeek::parse_cmdline(int argc, char** argv)
// getopt may permute the array, so need yet another array
auto zargs = std::make_unique<char*[]>(zeek_args.size());
for ( auto i = 0u; i < zeek_args.size(); ++i )
for ( size_t i = 0; i < zeek_args.size(); ++i )
zargs[i] = zeek_args[i].data();
while ( (op = getopt_long(zeek_args.size(), zargs.get(), opts, long_opts, &long_optsind)) != EOF )