From 51fe3d7dcffd8a705c82a09a9c81866bd18fbbf2 Mon Sep 17 00:00:00 2001 From: libenyao Date: Tue, 28 Feb 2023 16:57:48 +0800 Subject: [PATCH] add util part 2 and mofify warns Signed-off-by: libenyao --- util/CommandParser.cpp | 6 +++--- util/CommandParser.h | 2 +- util/JsonReader.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util/CommandParser.cpp b/util/CommandParser.cpp index a27d23e..1670f53 100644 --- a/util/CommandParser.cpp +++ b/util/CommandParser.cpp @@ -23,7 +23,7 @@ #include "TraceTool.h" using namespace std; -CommandParser* CommandParser::instance = nullptr; +CommandParser* CommandParser::example = nullptr; CommandParser::CommandParser() : isSendJSHeap(true), orignalResolutionWidth(0), @@ -532,8 +532,8 @@ bool CommandParser::IsCardValid() return false; } - std::string deviceType = GetDeviceType(); - auto iter = find(cardDisplayDevices.begin(), cardDisplayDevices.end(), deviceType); + std::string devicetype = GetDeviceType(); + auto iter = find(cardDisplayDevices.begin(), cardDisplayDevices.end(), devicetype); if (iter != cardDisplayDevices.end() && card == "true") { isCardDisplay = true; } diff --git a/util/CommandParser.h b/util/CommandParser.h index 96b5eed..db644d2 100644 --- a/util/CommandParser.h +++ b/util/CommandParser.h @@ -63,7 +63,7 @@ private: std::map> argsMap; std::map regsArgsCountMap; std::map regsHelpMap; - static CommandParser* instance; + static CommandParser* example; const std::vector supportedDevices = { "liteWearable", "smartVision", diff --git a/util/JsonReader.cpp b/util/JsonReader.cpp index 70dc9a5..f8b728a 100644 --- a/util/JsonReader.cpp +++ b/util/JsonReader.cpp @@ -47,7 +47,7 @@ Json::Value JsonReader::ParseJsonData(const string jsonStr) ELOG("JsonReader: CharReader get null."); return val; } - string message; + string message; // NOLINT if (!reader->parse(jsonStr.data(), jsonStr.data() + jsonStr.size(), &val, &message)) { ELOG("JsonReader: Failed to parse the json data, errors: %s", message.c_str()); }