Run Clang-tidy with modernize-use-auto (#1077)

* Run clang-tidy modify with modernize-use-auto
* Use using instead of typedef
This commit is contained in:
Chen
2019-12-04 09:08:45 +08:00
committed by GitHub
parent a0bd9adfef
commit 2983f5a89a
14 changed files with 62 additions and 61 deletions

View File

@@ -45,7 +45,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
Json::Value root;
const char* data_str = reinterpret_cast<const char*>(data);
const auto data_str = reinterpret_cast<const char*>(data);
try {
reader->parse(data_str, data_str + size, &root, nullptr);
} catch (Json::Exception const&) {

View File

@@ -42,7 +42,7 @@ public:
/// Must be a POD to allow inline initialisation without stepping
/// into the debugger.
struct PredicateContext {
typedef unsigned int Id;
using Id = unsigned int;
Id id_;
const char* file_;
unsigned int line_;
@@ -102,7 +102,7 @@ private:
static Json::String indentText(const Json::String& text,
const Json::String& indent);
typedef std::deque<Failure> Failures;
using Failures = std::deque<Failure>;
Failures failures_;
Json::String name_;
PredicateContext rootPredicateNode_;
@@ -129,7 +129,7 @@ private:
};
/// Function pointer type for TestCase factory
typedef TestCase* (*TestCaseFactory)();
using TestCaseFactory = TestCase* (*)();
class Runner {
public:
@@ -168,7 +168,7 @@ private:
static void preventDialogOnCrash();
private:
typedef std::deque<TestCaseFactory> Factories;
using Factories = std::deque<TestCaseFactory>;
Factories tests_;
};