diff --git a/adapter/uhdf2/hdi/src/hdi_support.cpp b/adapter/uhdf2/hdi/src/hdi_support.cpp index 2938711b8c1ae62fb81c05ee06d466bc32343082..febe1f6198d243302245355530b1e4aec5ee5162 100644 --- a/adapter/uhdf2/hdi/src/hdi_support.cpp +++ b/adapter/uhdf2/hdi/src/hdi_support.cpp @@ -40,7 +40,7 @@ constexpr size_t INTERFACE_MATCH_RESIZE = 4; constexpr size_t INTERFACE_VERSION_MAJOR_INDEX = 1; constexpr size_t INTERFACE_VERSION_MINOR_INDEX = 2; constexpr size_t INTERFACE_NAME_INDEX = 3; -static const std::regex reInfDesc("[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)*\\." +static const std::regex REINFDESC("[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)*\\." "[V|v]([0-9]+)_([0-9]+)\\." "([a-zA-Z_][a-zA-Z0-9_]*)"); using HdiImplInstanceFunc = void *(*)(void); @@ -99,7 +99,7 @@ static int32_t ParseInterface( const std::string &desc, std::string &interface, std::string &libName, const char *serviceName) { std::smatch result; - if (!std::regex_match(desc, result, reInfDesc)) { + if (!std::regex_match(desc, result, REINFDESC)) { return HDF_FAILURE; } diff --git a/framework/support/platform/test/unittest/common/hdf_hdmi_test.cpp b/framework/support/platform/test/unittest/common/hdf_hdmi_test.cpp index 5c421554f3e10e97ae5ee468411b5caa88287ed4..e13eefb53152a94c0a76507472408bd37d9143e3 100644 --- a/framework/support/platform/test/unittest/common/hdf_hdmi_test.cpp +++ b/framework/support/platform/test/unittest/common/hdf_hdmi_test.cpp @@ -103,12 +103,12 @@ static void HdmiUserSetAttrCaseTest(DevHandle handle) } } +constexpr uint32_t HDMI_EDID_DATA_LENGTH = 128; static void HdmiUserTest(void) { DevHandle handle = nullptr; int32_t ret; enum HdmiDeepColor color = HDMI_DEEP_COLOR_24BITS; - constexpr uint32_t HDMI_EDID_DATA_LENGTH = 128; uint8_t data[HDMI_EDID_DATA_LENGTH] = {0}; struct HdmiHpdCallbackInfo callback; diff --git a/framework/test/unittest/platform/virtual/adc_virtual.c b/framework/test/unittest/platform/virtual/adc_virtual.c index 4edde12e1c49b3809330605f1ccde5f2b631ed31..42695841ed7ab8f7f38480adc11cbda386599a0c 100644 --- a/framework/test/unittest/platform/virtual/adc_virtual.c +++ b/framework/test/unittest/platform/virtual/adc_virtual.c @@ -6,7 +6,7 @@ * See the LICENSE file in the root of this repository for complete details. */ -#include +#include #include "adc/adc_core.h" #include "device_resource_if.h" #include "hdf_device_desc.h" diff --git a/framework/tools/hc-gen/src/macro_gen.cpp b/framework/tools/hc-gen/src/macro_gen.cpp index fc6de4a775dcd66a354ff7a72d1c743ce2358c5d..4ce4eeb4e94fa90c84f54be4da09d8d0ff5dabf0 100644 --- a/framework/tools/hc-gen/src/macro_gen.cpp +++ b/framework/tools/hc-gen/src/macro_gen.cpp @@ -119,13 +119,13 @@ bool MacroGen::GenArray( const std::string &arrName, uint32_t &arrSize, uint32_t type, const std::shared_ptr &node) { static uint32_t index = 0; - const uint32_t ELEMENT_PER_LINE = 8; + constexpr uint32_t elementPerLine = 8; if (index == 0) { ofs_ << "#define " << arrName << "_data {"; } - if (index % ELEMENT_PER_LINE == 0) { + if (index % elementPerLine == 0) { ofs_ << " \\\n" << TAB; } @@ -141,7 +141,7 @@ bool MacroGen::GenArray( arrSize = 0; ofs_ << " \\\n}\n"; } else { - if (index % ELEMENT_PER_LINE == 0) { + if (index % elementPerLine == 0) { ofs_ << ","; } else { ofs_ << ", "; diff --git a/framework/tools/hc-gen/src/text_gen.cpp b/framework/tools/hc-gen/src/text_gen.cpp index 9b11e4800280631f2242c7897d7d94ae19061d5f..6ac78346ab59110f6afbb3c60a91894c175178b2 100644 --- a/framework/tools/hc-gen/src/text_gen.cpp +++ b/framework/tools/hc-gen/src/text_gen.cpp @@ -566,14 +566,14 @@ bool TextGen::PrintArrayImplInSubClass(const std::shared_ptr &object, bool TextGen::HcsPrintArrayContent(const std::shared_ptr &object, uint32_t indent) { - constexpr uint32_t ELEMENT_PER_LINE = 16; + constexpr uint32_t elementPerLine = 16; auto element = object->Child(); uint32_t elementCount = 0; while (element != nullptr) { if (!PrintBaseTypeValue(element)) { return false; } - if (elementCount++ >= ELEMENT_PER_LINE) { + if (elementCount++ >= elementPerLine) { ofs_ << "\n" << Indent(indent); } element = element->Next();