[clang-tidy] use auto when casting

Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-04-02 16:04:04 -07:00
committed by Fabian Homborg
parent b42445e675
commit 220f0a132d
26 changed files with 71 additions and 73 deletions

View File

@@ -336,12 +336,12 @@ static int fish_parse_opt(int argc, char **argv, fish_cmd_opts_t *opts) {
auto cats = get_flog_categories();
// Compute width of longest name.
int name_width = 0;
for (const auto *cat : cats) {
for (auto cat : cats) {
name_width = std::max(name_width, static_cast<int>(wcslen(cat->name)));
}
// A little extra space.
name_width += 2;
for (const auto *cat : cats) {
for (auto cat : cats) {
// Negating the name width left-justifies.
printf("%*ls %ls\n", -name_width, cat->name, _(cat->description));
}