From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/fs/virtfs/fsdir.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/fs/virtfs/fsdir.cpp') diff --git a/src/fs/virtfs/fsdir.cpp b/src/fs/virtfs/fsdir.cpp index c3b0d3c66..bc73771e7 100644 --- a/src/fs/virtfs/fsdir.cpp +++ b/src/fs/virtfs/fsdir.cpp @@ -198,9 +198,9 @@ namespace FsDir dirName; const struct dirent *next_file = nullptr; DIR *const dir = opendir(path.c_str()); - if (dir) + if (dir != nullptr) { - while ((next_file = readdir(dir))) + while ((next_file = readdir(dir)) != nullptr) { const std::string file = next_file->d_name; if (file == "." || file == "..") @@ -457,7 +457,7 @@ namespace FsDir } const int64_t len = static_cast(statbuf.st_size); #endif // USE_FILE_FOPEN - return pos < 0 || len < 0 || pos >= len; + return static_cast(pos < 0 || len < 0 || pos >= len); } const char *loadFile(FsEntry *restrict const entry, @@ -531,9 +531,9 @@ namespace FsDir dirName; const struct dirent *next_file = nullptr; DIR *const dir = opendir(path.c_str()); - if (dir) + if (dir != nullptr) { - while ((next_file = readdir(dir))) + while ((next_file = readdir(dir)) != nullptr) { struct stat statbuf; const std::string file = next_file->d_name; @@ -581,9 +581,9 @@ namespace FsDir dirName; const struct dirent *next_file = nullptr; DIR *const dir = opendir(path.c_str()); - if (dir) + if (dir != nullptr) { - while ((next_file = readdir(dir))) + while ((next_file = readdir(dir)) != nullptr) { struct stat statbuf; const std::string file = next_file->d_name; @@ -631,9 +631,9 @@ namespace FsDir dirName; const struct dirent *next_file = nullptr; DIR *const dir = opendir(path.c_str()); - if (dir) + if (dir != nullptr) { - while ((next_file = readdir(dir))) + while ((next_file = readdir(dir)) != nullptr) { struct stat statbuf; const std::string file = next_file->d_name; -- cgit v1.2.3-70-g09d2