From 797ebf7e86e497c38b09e0e81e1eb52aa6756bd4 Mon Sep 17 00:00:00 2001 From: bwx1095090 Date: Wed, 14 Dec 2022 10:47:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BD=E6=95=B0=E8=BF=87=E5=A4=A7CodeCheck?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bwx1095090 --- .../platform/os_wrapper/feature/interfaces/type_converter.h | 6 ++++++ .../platform/os_wrapper/feature/source/norm_processor.cpp | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/common/platform/os_wrapper/feature/interfaces/type_converter.h b/services/common/platform/os_wrapper/feature/interfaces/type_converter.h index f611485..758633e 100644 --- a/services/common/platform/os_wrapper/feature/interfaces/type_converter.h +++ b/services/common/platform/os_wrapper/feature/interfaces/type_converter.h @@ -52,6 +52,12 @@ namespace Feature { struct TypeConverterConfig : FeatureProcessorConfig { /** Number of data records supported by a single conversion. The maximum is {@link MAX_SAMPLE_SIZE}. */ size_t size; + TypeConverterConfig() = default; + TypeConverterConfig(DataType dt, size_t sz) + { + dataType = dt; + size = sz; + } }; /** diff --git a/services/common/platform/os_wrapper/feature/source/norm_processor.cpp b/services/common/platform/os_wrapper/feature/source/norm_processor.cpp index f4879c2..d47bdde 100644 --- a/services/common/platform/os_wrapper/feature/source/norm_processor.cpp +++ b/services/common/platform/os_wrapper/feature/source/norm_processor.cpp @@ -130,9 +130,7 @@ int32_t NormProcessor::Init(const FeatureProcessorConfig *config) HILOGE("[NormProcessor]The inputSize cannot be divided by numChannels"); return RETCODE_FAILURE; } - TypeConverterConfig convertConfig; - convertConfig.dataType = FLOAT; - convertConfig.size = config_.inputSize; + TypeConverterConfig convertConfig = {FLOAT, (config_.inputSize)}; converter_ = std::unique_ptr(new (std::nothrow) TypeConverter()); if (converter_ == nullptr) { HILOGE("[NormProcessor]Fail to create typeConverter"); -- Gitee