clang-tidy fixes again (#1087)
* [clang-tidy] Do not use else after return
Found with readability-else-after-return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* [clang-tidy] Convert several loops to be range based
Found with modernize-loop-convert
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* [clang-tidy] Replace deprecated C headers
Found with modernize-deprecated-headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* [clang-tidy] Use auto where applicable
Found with modernize-use-auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
* .clang-tidy: Add these checks
diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp
index f6b1a4d..cdf6bff 100644
--- a/src/jsontestrunner/main.cpp
+++ b/src/jsontestrunner/main.cpp
@@ -57,10 +57,10 @@
if (!file)
return "";
fseek(file, 0, SEEK_END);
- long const size = ftell(file);
- const auto usize = static_cast<size_t>(size);
+ auto const size = ftell(file);
+ auto const usize = static_cast<size_t>(size);
fseek(file, 0, SEEK_SET);
- char* buffer = new char[size + 1];
+ auto buffer = new char[size + 1];
buffer[size] = 0;
Json::String text;
if (fread(buffer, 1, usize, file) == usize)