diff --git a/examples/thermostat/linux/thermostat-delegate-impl.cpp b/examples/thermostat/linux/thermostat-delegate-impl.cpp index b648f9bcda4ce2..949ea26947cdaf 100644 --- a/examples/thermostat/linux/thermostat-delegate-impl.cpp +++ b/examples/thermostat/linux/thermostat-delegate-impl.cpp @@ -138,8 +138,7 @@ CHIP_ERROR ThermostatDelegate::GetActivePresetHandle(MutableByteSpan & activePre { if (mActivePresetHandleDataSize > 0) { - ByteSpan presetHandleSpan(mActivePresetHandleData, mActivePresetHandleDataSize); - CopySpanToMutableSpan(presetHandleSpan, activePresetHandle); + CopySpanToMutableSpan(ByteSpan(mActivePresetHandleData, mActivePresetHandleDataSize), activePresetHandle); } else { @@ -156,8 +155,8 @@ CHIP_ERROR ThermostatDelegate::SetActivePresetHandle(const DataModel::Nullable kPresetHandleSize) { ChipLogError(NotSpecified, - "Failed to set ActivePresetHandle. newActivePresetHandle size %ld is larger than preset handle size %ld", - newActivePresetHandleSize, kPresetHandleSize); + "Failed to set ActivePresetHandle. newActivePresetHandle size %u is larger than preset handle size %u", + static_cast(newActivePresetHandleSize), static_cast(kPresetHandleSize)); return CHIP_ERROR_NO_MEMORY; } memcpy(mActivePresetHandleData, newActivePresetHandle.Value().data(), newActivePresetHandleSize); @@ -183,14 +182,7 @@ CHIP_ERROR ThermostatDelegate::AppendToPendingPresetList(const PresetStruct::Typ mPendingPresets[mNextFreeIndexInPendingPresetsList].SetName(preset.name); mPendingPresets[mNextFreeIndexInPendingPresetsList].SetCoolingSetpoint(preset.coolingSetpoint); mPendingPresets[mNextFreeIndexInPendingPresetsList].SetHeatingSetpoint(preset.heatingSetpoint); - if (!preset.builtIn.IsNull()) - { - mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(preset.builtIn); - } - else - { - mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(NullOptional); - } + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(preset.builtIn); mNextFreeIndexInPendingPresetsList++; return CHIP_NO_ERROR; } diff --git a/src/app/clusters/thermostat-server/PresetStructWithOwnedMembers.cpp b/src/app/clusters/thermostat-server/PresetStructWithOwnedMembers.cpp index da122408155568..279f9fc8052451 100644 --- a/src/app/clusters/thermostat-server/PresetStructWithOwnedMembers.cpp +++ b/src/app/clusters/thermostat-server/PresetStructWithOwnedMembers.cpp @@ -62,8 +62,8 @@ CHIP_ERROR PresetStructWithOwnedMembers::SetPresetHandle(const Nullable kPresetHandleSize) { - ChipLogError(Zcl, "Failed to set Preset handle. New preset handle size (%ld) > allowed preset handle size (%ld)", - newPresetHandleSize, kPresetNameSize); + ChipLogError(Zcl, "Failed to set Preset handle. New preset handle size (%u) > allowed preset handle size (%u)", + static_cast(newPresetHandleSize), static_cast(kPresetNameSize)); return CHIP_ERROR_NO_MEMORY; } MutableByteSpan targetSpan(presetHandleData); @@ -85,8 +85,8 @@ CHIP_ERROR PresetStructWithOwnedMembers::SetName(const Optional kPresetNameSize) { - ChipLogError(Zcl, "Failed to set Preset name. New name size (%ld) > allowed preset name size (%ld)", newNameSize, - kPresetNameSize); + ChipLogError(Zcl, "Failed to set Preset name. New name size (%u) > allowed preset name size (%u)", static_cast(newNameSize), + static_cast(kPresetNameSize)); return CHIP_ERROR_NO_MEMORY; } MutableCharSpan targetSpan(presetNameData);