From 1428630ccb3d0e947209fe42bcecbaaceb8eea25 Mon Sep 17 00:00:00 2001 From: Jerry-ESP <107675966+Jerry-ESP@users.noreply.github.com> Date: Tue, 28 Mar 2023 22:34:40 +0800 Subject: [PATCH] fix compile error for -Wconversion added from PR #25373 (#25822) --- src/platform/ESP32/ESP32DeviceInfoProvider.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/platform/ESP32/ESP32DeviceInfoProvider.cpp b/src/platform/ESP32/ESP32DeviceInfoProvider.cpp index 783568b24d38a6..74f588f8e274ca 100644 --- a/src/platform/ESP32/ESP32DeviceInfoProvider.cpp +++ b/src/platform/ESP32/ESP32DeviceInfoProvider.cpp @@ -71,13 +71,15 @@ bool ESP32DeviceInfoProvider::FixedLabelIteratorImpl::Next(FixedLabelType & outp memset(mFixedLabelNameBuf, 0, sizeof(mFixedLabelNameBuf)); memset(mFixedLabelValueBuf, 0, sizeof(mFixedLabelValueBuf)); - VerifyOrReturnValue(ESP32Config::KeyAllocator::FixedLabelKey(keyBuf, sizeof(keyBuf), mEndpoint, mIndex) == CHIP_NO_ERROR, - false); + VerifyOrReturnValue( + ESP32Config::KeyAllocator::FixedLabelKey(keyBuf, sizeof(keyBuf), mEndpoint, static_cast(mIndex)) == CHIP_NO_ERROR, + false); ESP32Config::Key keyKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); VerifyOrReturnValue( ESP32Config::ReadConfigValueStr(keyKey, mFixedLabelNameBuf, sizeof(mFixedLabelNameBuf), keyOutLen) == CHIP_NO_ERROR, false); - VerifyOrReturnValue(ESP32Config::KeyAllocator::FixedLabelValue(keyBuf, sizeof(keyBuf), mEndpoint, mIndex) == CHIP_NO_ERROR, + VerifyOrReturnValue(ESP32Config::KeyAllocator::FixedLabelValue(keyBuf, sizeof(keyBuf), mEndpoint, + static_cast(mIndex)) == CHIP_NO_ERROR, false); ESP32Config::Key valueKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); VerifyOrReturnValue(ESP32Config::ReadConfigValueStr(valueKey, mFixedLabelValueBuf, sizeof(mFixedLabelValueBuf), valueOutLen) == @@ -210,7 +212,8 @@ bool ESP32DeviceInfoProvider::SupportedLocalesIteratorImpl::Next(CharSpan & outp size_t keyOutLen = 0; memset(mLocaleBuf, 0, sizeof(mLocaleBuf)); - VerifyOrReturnValue(ESP32Config::KeyAllocator::Locale(keyBuf, sizeof(keyBuf), mIndex) == CHIP_NO_ERROR, false); + VerifyOrReturnValue(ESP32Config::KeyAllocator::Locale(keyBuf, sizeof(keyBuf), static_cast(mIndex)) == CHIP_NO_ERROR, + false); ESP32Config::Key keyKey(ESP32Config::kConfigNamespace_ChipFactory, keyBuf); VerifyOrReturnValue(ESP32Config::ReadConfigValueStr(keyKey, mLocaleBuf, sizeof(mLocaleBuf), keyOutLen) == CHIP_NO_ERROR, false);