Fix some clang-tidy issues

This commit is contained in:
Marcus Holland-Moritz 2021-03-06 14:39:57 +01:00
parent 1f20b02b68
commit db181acba7
3 changed files with 5 additions and 5 deletions

View File

@ -40,7 +40,7 @@ bool stream_is_fancy_terminal(std::ostream& os) {
return false; return false;
} }
auto term = ::getenv("TERM"); auto term = ::getenv("TERM");
return term && term[0] && ::strcmp(term, "dumb"); return term && term[0] != '\0' && ::strcmp(term, "dumb") != 0;
} }
char const* terminal_color(termcolor color) { char const* terminal_color(termcolor color) {

View File

@ -63,15 +63,15 @@ size_t parse_size_with_unit(const std::string& str) {
case 't': case 't':
case 'T': case 'T':
size <<= 10; size <<= 10;
// fallthrough [[fallthrough]];
case 'g': case 'g':
case 'G': case 'G':
size <<= 10; size <<= 10;
// fallthrough [[fallthrough]];
case 'm': case 'm':
case 'M': case 'M':
size <<= 10; size <<= 10;
// fallthrough [[fallthrough]];
case 'k': case 'k':
case 'K': case 'K':
size <<= 10; size <<= 10;

View File

@ -239,7 +239,7 @@ class load_adaptive_policy {
load_adaptive_policy(size_t workers) load_adaptive_policy(size_t workers)
: sem_(workers) : sem_(workers)
, max_throttled_(workers - 1) {} , max_throttled_(static_cast<int>(workers) - 1) {}
void start_task() { sem_.acquire(); } void start_task() { sem_.acquire(); }