Skip to content

Commit

Permalink
Followup on post-merge comments on #30393 (#30421)
Browse files Browse the repository at this point in the history
* Use _span

* Remove comment

* Fix alignment

* restyle

* Remove extra bracket

* Fix init

---------

Co-authored-by: Andrei Litvin <andreilitvin@google.com>
  • Loading branch information
andy31415 and andreilitvin authored Nov 12, 2023
1 parent f06d952 commit be5a949
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ using namespace chip::app::Clusters::TemperatureControl;
using chip::Protocols::InteractionModel::Status;

// TODO: Configure your options for each endpoint
CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan::fromCharString("Hot"),
CharSpan::fromCharString("Warm"),
CharSpan::fromCharString("Cold") };
CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { "Hot"_span, "Warm"_span, "Cold"_span };

const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints
[EMBER_AF_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = {
Expand Down
1 change: 0 additions & 1 deletion src/app/clusters/scenes-server/SceneTableImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ struct SceneTableData : public SceneTableEntry, PersistentData<kPersistentSceneB

CHIP_ERROR Serialize(TLV::TLVWriter & writer) const override
{
// TODO: if we have mNameLength, should this bin ByteSpan instead?
CharSpan nameSpan(mStorageData.mName, mStorageData.mNameLength);
TLV::TLVType container;
ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, container));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ void TimeSynchronizationServer::InitTimeZone()
for (auto & tzStore : mTimeZoneObj.timeZoneList)
{
memset(tzStore.name, 0, sizeof(tzStore.name));
tzStore.timeZone = { .offset = 0, .validAt = 0, .name = MakeOptional(CharSpan(tzStore.name, 0)) };
tzStore.timeZone = { .offset = 0, .validAt = 0, .name = chip::NullOptional };
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/CHIPError.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ using CHIP_ERROR = ::chip::ChipError;
* Invalid UTF8 string (contains some characters that are invalid)
*
*/
#define CHIP_ERROR_INVALID_UTF8 CHIP_CORE_ERROR(0x12)
#define CHIP_ERROR_INVALID_UTF8 CHIP_CORE_ERROR(0x12)

/**
* @def CHIP_ERROR_INTEGRITY_CHECK_FAILED
Expand Down

0 comments on commit be5a949

Please sign in to comment.