Skip to content

Commit 38d6a48

Browse files
Restyle C(++) code after upgrade to clang-format 16 (project-chip#29496)
This is a follow-up to project-chip#29447 and should really have been done as part of that PR.
1 parent 9dee693 commit 38d6a48

File tree

331 files changed

+1821
-1785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+1821
-1785
lines changed

examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class AirQualitySensorManager
1616
{
1717
public:
1818
// Delete copy constructor and assignment operator.
19-
AirQualitySensorManager(const AirQualitySensorManager &) = delete;
20-
AirQualitySensorManager(const AirQualitySensorManager &&) = delete;
19+
AirQualitySensorManager(const AirQualitySensorManager &) = delete;
20+
AirQualitySensorManager(const AirQualitySensorManager &&) = delete;
2121
AirQualitySensorManager & operator=(const AirQualitySensorManager &) = delete;
2222

2323
static void InitInstance(EndpointId aEndpointId = 1)

examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class DishwasherModeDelegate : public ModeBase::Delegate
4141
using ModeTagStructType = detail::Structs::ModeTagStruct::Type;
4242
ModeTagStructType modeTagsNormal[1] = { { .value = to_underlying(ModeTag::kNormal) } };
4343
ModeTagStructType modeTagsHeavy[2] = { { .value = to_underlying(ModeBase::ModeTag::kMax) },
44-
{ .value = to_underlying(ModeTag::kHeavy) } };
44+
{ .value = to_underlying(ModeTag::kHeavy) } };
4545
ModeTagStructType modeTagsLight[3] = { { .value = to_underlying(ModeTag::kLight) },
46-
{ .value = to_underlying(ModeBase::ModeTag::kNight) },
47-
{ .value = to_underlying(ModeBase::ModeTag::kQuiet) } };
46+
{ .value = to_underlying(ModeBase::ModeTag::kNight) },
47+
{ .value = to_underlying(ModeBase::ModeTag::kQuiet) } };
4848

4949
const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = {
5050
detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Normal"),

examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LaundryWasherModeDelegate : public ModeBase::Delegate
4545
{ .value = to_underlying(ModeBase::ModeTag::kNight) },
4646
{ .value = to_underlying(ModeBase::ModeTag::kQuiet) } };
4747
ModeTagStructType modeTagsHeavy[2] = { { .value = to_underlying(ModeBase::ModeTag::kMax) },
48-
{ .value = to_underlying(ModeTag::kHeavy) } };
48+
{ .value = to_underlying(ModeTag::kHeavy) } };
4949
ModeTagStructType modeTagsWhites[1] = { { .value = to_underlying(ModeTag::kWhites) } };
5050

5151
const detail::Structs::ModeOptionStruct::Type kModeOptions[4] = {

examples/all-clusters-app/ameba/main/include/CHIPDeviceManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class CHIPDeviceManagerCallbacks
8585
class DLL_EXPORT CHIPDeviceManager
8686
{
8787
public:
88-
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89-
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
88+
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89+
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
9090
CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete;
9191

9292
static CHIPDeviceManager & GetInstance()

examples/all-clusters-app/nxp/mw320/include/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6868
/* Memory allocation related definitions. */
6969
#define configSUPPORT_STATIC_ALLOCATION 0
7070
#define configSUPPORT_DYNAMIC_ALLOCATION 1
71-
#define configTOTAL_HEAP_SIZE ((size_t)(60 * 1024))
71+
#define configTOTAL_HEAP_SIZE ((size_t) (60 * 1024))
7272
#define configAPPLICATION_ALLOCATED_HEAP 0
7373

7474
/* Hook function related definitions. */

examples/all-clusters-app/openiotsdk/freertos-config/FreeRTOSConfig.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ extern uint32_t SystemCoreClock;
4040
// <o>Minimal stack size [words] <0-65535>
4141
// <i> Stack for idle task and default task stack in words.
4242
// <i> Default: 4kB
43-
#define configMINIMAL_STACK_SIZE ((uint16_t)(4 * 1024))
43+
#define configMINIMAL_STACK_SIZE ((uint16_t) (4 * 1024))
4444

4545
// <o>Total heap size [bytes] <0-0xFFFFFFFF>
4646
// <i> Heap memory size in bytes.
4747
// <i> Default: 32kB
48-
#define configTOTAL_HEAP_SIZE ((size_t)(32 * 1024))
48+
#define configTOTAL_HEAP_SIZE ((size_t) (32 * 1024))
4949

5050
// <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
5151
// <i> Kernel tick rate in Hz.

examples/all-clusters-minimal-app/ameba/main/include/CHIPDeviceManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class CHIPDeviceManagerCallbacks
8585
class DLL_EXPORT CHIPDeviceManager
8686
{
8787
public:
88-
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89-
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
88+
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89+
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
9090
CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete;
9191

9292
static CHIPDeviceManager & GetInstance()

examples/chef/ameba/main/include/CHIPDeviceManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class CHIPDeviceManagerCallbacks
8585
class DLL_EXPORT CHIPDeviceManager
8686
{
8787
public:
88-
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89-
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
88+
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89+
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
9090
CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete;
9191

9292
static CHIPDeviceManager & GetInstance()

examples/chip-tool/commands/common/Command.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool Command::InitArguments(int argc, char ** argv)
6161
}
6262
}
6363

64-
VerifyOrExit((size_t)(argc) >= mandatoryArgsCount && (argvExtraArgsCount == 0 || (argvExtraArgsCount && optionalArgsCount)),
64+
VerifyOrExit((size_t) (argc) >= mandatoryArgsCount && (argvExtraArgsCount == 0 || (argvExtraArgsCount && optionalArgsCount)),
6565
ChipLogError(chipTool, "InitArgs: Wrong arguments number: %d instead of %u", argc,
6666
static_cast<unsigned int>(mandatoryArgsCount)));
6767

examples/chip-tool/commands/pairing/PairingCommand.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndexWithCode(NodeId remoteId, uin
259259
{
260260
auto commissioningParams = GetCommissioningParameters();
261261
err = CurrentCommissioner().PairDevice(remoteId, mOnboardingPayload, commissioningParams,
262-
DiscoveryType::kDiscoveryNetworkOnly, MakeOptional(resolutionData));
262+
DiscoveryType::kDiscoveryNetworkOnly, MakeOptional(resolutionData));
263263
}
264264
return err;
265265
#else

examples/chip-tool/commands/pairing/PairingCommand.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ class PairingCommand : public CHIPCommand,
5757
CredentialIssuerCommands * credIssuerCmds,
5858
chip::Dnssd::DiscoveryFilterType filterType = chip::Dnssd::DiscoveryFilterType::kNone) :
5959
CHIPCommand(commandName, credIssuerCmds),
60-
mPairingMode(mode), mNetworkType(networkType),
61-
mFilterType(filterType), mRemoteAddr{ IPAddress::Any, chip::Inet::InterfaceId::Null() }, mComplex_TimeZones(&mTimeZoneList),
60+
mPairingMode(mode), mNetworkType(networkType), mFilterType(filterType),
61+
mRemoteAddr{ IPAddress::Any, chip::Inet::InterfaceId::Null() }, mComplex_TimeZones(&mTimeZoneList),
6262
mComplex_DSTOffsets(&mDSTOffsetList), mCurrentFabricRemoveCallback(OnCurrentFabricRemove, this)
6363
{
6464
AddArgument("node-id", 0, UINT64_MAX, &mNodeId);

examples/chip-tool/include/CHIPProjectAppConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define CHIP_CONFIG_EVENT_LOGGING_NUM_EXTERNAL_CALLBACKS 2
2929

3030
// Uncomment this for a large Tunnel MTU.
31-
//#define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)
31+
// #define CHIP_CONFIG_TUNNEL_INTERFACE_MTU (9000)
3232

3333
// Enable support functions for parsing command-line arguments
3434
#define CHIP_CONFIG_ENABLE_ARG_PARSER 1

examples/common/imgui_ui/ui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void UiInit(SDL_GLContext * gl_context, SDL_Window ** window)
6161
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
6262
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
6363
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
64-
SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
64+
SDL_WindowFlags window_flags = (SDL_WindowFlags) (SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
6565
*window = SDL_CreateWindow("Light UI", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, window_flags);
6666
*gl_context = SDL_GL_CreateContext(*window);
6767
SDL_GL_MakeCurrent(*window, *gl_context);

examples/common/imgui_ui/windows/light.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,10 @@ void Light::Render()
155155
ImGui::Text("Color Control:");
156156
ImGui::Indent();
157157
const char * mode = // based on ColorMode attribute: spec 3.2.7.9
158-
(mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION)
159-
? "Hue/Saturation"
160-
: (mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_X_AND_CURRENT_Y)
161-
? "X/Y"
162-
: (mColorMode == EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE) ? "Temperature/Mireds" : "UNKNOWN";
158+
(mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION) ? "Hue/Saturation"
159+
: (mColorMode == EMBER_ZCL_COLOR_MODE_CURRENT_X_AND_CURRENT_Y) ? "X/Y"
160+
: (mColorMode == EMBER_ZCL_COLOR_MODE_COLOR_TEMPERATURE) ? "Temperature/Mireds"
161+
: "UNKNOWN";
163162

164163
ImGui::Text("Mode: %s", mode);
165164

examples/common/screen-framework/Display.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ esp_err_t InitDisplay()
118118
TFT_setRotation(LANDSCAPE);
119119
TFT_resetclipwin();
120120

121-
DisplayWidth = (uint16_t)(1 + tft_dispWin.x2 - tft_dispWin.x1);
122-
DisplayHeight = (uint16_t)(1 + tft_dispWin.y2 - tft_dispWin.y1);
121+
DisplayWidth = (uint16_t) (1 + tft_dispWin.x2 - tft_dispWin.x1);
122+
DisplayHeight = (uint16_t) (1 + tft_dispWin.y2 - tft_dispWin.y1);
123123

124124
ESP_LOGI(TAG, "Display initialized (height %u, width %u)", DisplayHeight, DisplayWidth);
125125

examples/contact-sensor-app/nxp/k32w/k32w0/include/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
/* Memory allocation related definitions. */
8585
#define configSUPPORT_STATIC_ALLOCATION 0
8686
#define configSUPPORT_DYNAMIC_ALLOCATION 1
87-
#define configTOTAL_HEAP_SIZE ((size_t)(gTotalHeapSize_c))
87+
#define configTOTAL_HEAP_SIZE ((size_t) (gTotalHeapSize_c))
8888
#define configAPPLICATION_ALLOCATED_HEAP 1
8989

9090
/* Hook function related definitions. */

examples/darwin-framework-tool/commands/common/MTRLogging.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#if DEBUG
2525
#define MTR_LOG_DEBUG(format, ...) os_log(OS_LOG_DEFAULT, format, ##__VA_ARGS__)
2626
#define MTR_LOG_ERROR(format, ...) os_log(OS_LOG_DEFAULT, format, ##__VA_ARGS__)
27-
#define MTR_LOG_METHOD_ENTRY() \
27+
#define MTR_LOG_METHOD_ENTRY() \
2828
({ os_log(OS_LOG_DEFAULT, "[<%@: %p> %@]", NSStringFromClass([self class]), self, NSStringFromSelector(_cmd)); })
2929

3030
#else

examples/darwin-framework-tool/commands/tests/TestCommandBridge.h

+15-8
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class TestCommandBridge : public CHIPCommandBridge,
111111
CHIP_ERROR WaitForMs(
112112
const char * _Nullable identity, const chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type & value)
113113
{
114-
dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(value.ms * NSEC_PER_MSEC));
114+
dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t) (value.ms * NSEC_PER_MSEC));
115115
dispatch_after(delayTime, mCallbackQueue, ^(void) {
116116
NextTest();
117117
});
@@ -310,7 +310,8 @@ class TestCommandBridge : public CHIPCommandBridge,
310310
return ConstraintsChecker::CheckConstraintIsHexString(itemName, value, expectHexString);
311311
}
312312

313-
template <typename T> bool CheckConstraintContains(const char * _Nonnull itemName, const NSArray * _Nonnull current, T expected)
313+
template <typename T>
314+
bool CheckConstraintContains(const char * _Nonnull itemName, const NSArray * _Nonnull current, T expected)
314315
{
315316
for (id currentElement in current) {
316317
if ([currentElement isEqualToNumber:@(expected)]) {
@@ -322,7 +323,8 @@ class TestCommandBridge : public CHIPCommandBridge,
322323
return false;
323324
}
324325

325-
template <typename T> bool CheckConstraintExcludes(const char * _Nonnull itemName, const NSArray * _Nonnull current, T expected)
326+
template <typename T>
327+
bool CheckConstraintExcludes(const char * _Nonnull itemName, const NSArray * _Nonnull current, T expected)
326328
{
327329
for (id currentElement in current) {
328330
if ([currentElement isEqualToNumber:@(expected)]) {
@@ -388,7 +390,8 @@ class TestCommandBridge : public CHIPCommandBridge,
388390
return CheckConstraintNotValue(itemName, current, @(expected));
389391
}
390392

391-
template <typename T> bool CheckConstraintNotValue(const char * _Nonnull itemName, NSError * _Nullable current, T expected)
393+
template <typename T>
394+
bool CheckConstraintNotValue(const char * _Nonnull itemName, NSError * _Nullable current, T expected)
392395
{
393396
NSNumber * currentValue = @(MTRErrorToCHIPErrorCode(current).AsInteger());
394397
return CheckConstraintNotValue(itemName, currentValue, @(expected));
@@ -540,25 +543,29 @@ class TestCommandBridge : public CHIPCommandBridge,
540543
return CheckValue(itemName, currentValue, expected);
541544
}
542545

543-
template <typename T> bool CheckValue(const char * _Nonnull itemName, NSNumber * _Nonnull current, T expected)
546+
template <typename T>
547+
bool CheckValue(const char * _Nonnull itemName, NSNumber * _Nonnull current, T expected)
544548
{
545549
return CheckValue(itemName, current, @(expected));
546550
}
547551

548-
template <typename T> bool CheckValue(const char * _Nonnull itemName, id _Nonnull current, T expected)
552+
template <typename T>
553+
bool CheckValue(const char * _Nonnull itemName, id _Nonnull current, T expected)
549554
{
550555
NSNumber * currentValue = current;
551556
return CheckValue(itemName, currentValue, @(expected));
552557
}
553558

554-
template <typename T> bool CheckValue(const char * _Nonnull itemName, NSError * _Nullable current, T expected)
559+
template <typename T>
560+
bool CheckValue(const char * _Nonnull itemName, NSError * _Nullable current, T expected)
555561
{
556562

557563
NSNumber * currentValue = @(current.code);
558564
return CheckValue(itemName, currentValue, @(expected));
559565
}
560566

561-
template <typename T, typename U> bool CheckValue(const char * _Nonnull itemName, T current, U expected)
567+
template <typename T, typename U>
568+
bool CheckValue(const char * _Nonnull itemName, T current, U expected)
562569
{
563570

564571
return ValueChecker::CheckValue(itemName, current, expected);

examples/light-switch-app/ameba/main/include/CHIPDeviceManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class CHIPDeviceManagerCallbacks
8585
class DLL_EXPORT CHIPDeviceManager
8686
{
8787
public:
88-
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89-
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
88+
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
89+
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
9090
CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete;
9191

9292
static CHIPDeviceManager & GetInstance()

examples/light-switch-app/infineon/cyw30739/src/LightSwitch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void LightSwitch::DimmerChangeBrightness(uint16_t kValue)
8282
// add to brightness vluse to change brightness after call dimmer change.
8383
sBrightness = kValue;
8484
data->Value =
85-
(uint8_t)(sBrightness > CHIP_DEVICE_CONFIG_BRIGHTNESS_MAXIMUM ? CHIP_DEVICE_CONFIG_BRIGHTNESS_MAXIMUM : sBrightness);
85+
(uint8_t) (sBrightness > CHIP_DEVICE_CONFIG_BRIGHTNESS_MAXIMUM ? CHIP_DEVICE_CONFIG_BRIGHTNESS_MAXIMUM : sBrightness);
8686
data->IsGroup = BindingHandler::GetInstance().IsGroupBound();
8787
DeviceLayer::PlatformMgr().ScheduleWork(BindingHandler::SwitchWorkerHandler, reinterpret_cast<intptr_t>(data));
8888
}

examples/lighting-app/ameba/main/include/CHIPDeviceManager.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class CHIPDeviceManagerCallbacks
8484
class DLL_EXPORT CHIPDeviceManager
8585
{
8686
public:
87-
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
88-
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
87+
CHIPDeviceManager(const CHIPDeviceManager &) = delete;
88+
CHIPDeviceManager(const CHIPDeviceManager &&) = delete;
8989
CHIPDeviceManager & operator=(const CHIPDeviceManager &) = delete;
9090

9191
static CHIPDeviceManager & GetInstance()

examples/lighting-app/genio/src/ColorFormat.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ RgbColor_t XYToRgb(uint8_t Level, uint16_t currentX, uint16_t currentY)
126126
b = clamp(b, 0, 1);
127127

128128
// these rgb values are in the range of 0 to 1, convert to limit of HW specific LED
129-
rgb.r = (uint8_t)(r * 255);
130-
rgb.g = (uint8_t)(g * 255);
131-
rgb.b = (uint8_t)(b * 255);
129+
rgb.r = (uint8_t) (r * 255);
130+
rgb.g = (uint8_t) (g * 255);
131+
rgb.b = (uint8_t) (b * 255);
132132

133133
return rgb;
134134
}

examples/lighting-app/genio/src/DimmableLEDWidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ static hal_pwm_channel_t convert_gpio_to_pwm_channel(hal_gpio_pin_t gpio)
3434
hal_pwm_channel_t ret = HAL_PWM_MAX;
3535
if (gpio >= HAL_GPIO_29 && gpio <= HAL_GPIO_40)
3636
{
37-
ret = (hal_pwm_channel_t)(gpio - HAL_GPIO_29);
37+
ret = (hal_pwm_channel_t) (gpio - HAL_GPIO_29);
3838
}
3939
else if (gpio >= HAL_GPIO_45 && gpio <= HAL_GPIO_52)
4040
{
41-
ret = (hal_pwm_channel_t)(gpio - HAL_GPIO_45);
41+
ret = (hal_pwm_channel_t) (gpio - HAL_GPIO_45);
4242
}
4343
else
4444
{

examples/lighting-app/genio/src/ZclCallbacks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
9999
*/
100100
if (attributeId == ColorControl::Attributes::EnhancedCurrentHue::Id)
101101
{
102-
hsv.h = (uint8_t)(((*reinterpret_cast<uint16_t *>(value)) & 0xFF00) >> 8);
103-
hsv.s = (uint8_t)((*reinterpret_cast<uint16_t *>(value)) & 0xFF);
102+
hsv.h = (uint8_t) (((*reinterpret_cast<uint16_t *>(value)) & 0xFF00) >> 8);
103+
hsv.s = (uint8_t) ((*reinterpret_cast<uint16_t *>(value)) & 0xFF);
104104
}
105105
else if (attributeId == ColorControl::Attributes::CurrentHue::Id)
106106
{

examples/lighting-app/lighting-common/src/ColorFormat.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ RgbColor_t XYToRgb(uint8_t Level, uint16_t currentX, uint16_t currentY)
122122
b = clamp(b, 0, 1);
123123

124124
// these rgb values are in the range of 0 to 1, convert to limit of HW specific LED
125-
rgb.r = (uint8_t)(r * 255);
126-
rgb.g = (uint8_t)(g * 255);
127-
rgb.b = (uint8_t)(b * 255);
125+
rgb.r = (uint8_t) (r * 255);
126+
rgb.g = (uint8_t) (g * 255);
127+
rgb.b = (uint8_t) (b * 255);
128128

129129
return rgb;
130130
}

examples/lighting-app/nxp/k32w/k32w0/include/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
/* Memory allocation related definitions. */
7474
#define configSUPPORT_STATIC_ALLOCATION 0
7575
#define configSUPPORT_DYNAMIC_ALLOCATION 1
76-
#define configTOTAL_HEAP_SIZE ((size_t)(gTotalHeapSize_c))
76+
#define configTOTAL_HEAP_SIZE ((size_t) (gTotalHeapSize_c))
7777
#define configAPPLICATION_ALLOCATED_HEAP 1
7878

7979
/* Hook function related definitions. */

examples/lighting-app/qpg/src/ZclCallbacks.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
106106
if (attributeId == ColorControl::Attributes::EnhancedCurrentHue::Id)
107107
{
108108
// We only support 8-bit hue. Assuming hue is linear, normalize 16-bit to 8-bit.
109-
hsv.h = (uint8_t)((*reinterpret_cast<uint16_t *>(value)) >> 8);
109+
hsv.h = (uint8_t) ((*reinterpret_cast<uint16_t *>(value)) >> 8);
110110
// get saturation from cluster value storage
111111
EmberAfStatus status = ColorControl::Attributes::CurrentSaturation::Get(endpoint, &hsv.s);
112112
assert(status == EMBER_ZCL_STATUS_SUCCESS);

examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ standard names. */
171171

172172
/* USER CODE BEGIN Defines */
173173
/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
174-
//#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */
174+
// #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */
175175
#define configGENERATE_RUN_TIME_STATS 1
176176

177177
#if (configGENERATE_RUN_TIME_STATS == 1)

examples/lighting-app/telink/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void AppTask::UpdateClusterState(void)
175175
bool isTurnedOn =
176176
sAppTask.mPwmRgbRedLed.IsTurnedOn() || sAppTask.mPwmRgbGreenLed.IsTurnedOn() || sAppTask.mPwmRgbBlueLed.IsTurnedOn();
177177
#else
178-
bool isTurnedOn = sAppTask.mPwmRgbBlueLed.IsTurnedOn();
178+
bool isTurnedOn = sAppTask.mPwmRgbBlueLed.IsTurnedOn();
179179
#endif
180180
// write the new on/off value
181181
EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn);

examples/lighting-app/telink/src/ZclCallbacks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
9191
{
9292
if (attributeId == ColorControl::Attributes::EnhancedCurrentHue::Id)
9393
{
94-
hsv.h = (uint8_t)(((*reinterpret_cast<uint16_t *>(value)) & 0xFF00) >> 8);
95-
hsv.s = (uint8_t)((*reinterpret_cast<uint16_t *>(value)) & 0xFF);
94+
hsv.h = (uint8_t) (((*reinterpret_cast<uint16_t *>(value)) & 0xFF00) >> 8);
95+
hsv.s = (uint8_t) ((*reinterpret_cast<uint16_t *>(value)) & 0xFF);
9696
}
9797
else if (attributeId == ColorControl::Attributes::CurrentHue::Id)
9898
{

0 commit comments

Comments
 (0)