Skip to content

Commit

Permalink
Split out CHIPErrror into a separate source set. (#29494)
Browse files Browse the repository at this point in the history
* Split out CHIPErrror into a separate source set.

CHIPError.cpp uses ErrorStr.h, so ErrorStr gets moved into the same source set.

ErrorStr.cpp did not actually use CodeUtils.h for anything except including
ErrorStr.h.

The random whitespace changes are because we changed our clang-format version
but then did not restyle the tree.

* Address review comment.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Dec 18, 2023
1 parent da92396 commit de722df
Show file tree
Hide file tree
Showing 115 changed files with 161 additions and 148 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/ameba/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <core/ErrorStr.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <platform/Ameba/FactoryDataProvider.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

using namespace ::chip;
using namespace ::chip::Credentials;
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/af.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <core/ErrorStr.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

using namespace ::chip;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <app/util/af.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <app/util/attribute-storage.h>
#include <assert.h>
#include <lib/core/CHIPError.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/ErrorStr.h>
#include <lib/support/ZclString.h>
#include <platform/CHIPDeviceLayer.h>

Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/asr/subdevice/SubDeviceManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <app/util/attribute-storage.h>
#include <assert.h>
#include <lib/core/CHIPError.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/ErrorStr.h>
#include <lib/support/ZclString.h>
#include <platform/CHIPDeviceLayer.h>

Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/asr/subdevice/subdevice_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <app/util/attribute-storage.h>
#include <assert.h>
#include <lib/core/CHIPError.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/ErrorStr.h>
#include <lib/support/ZclString.h>
#include <platform/CHIPDeviceLayer.h>

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/ameba/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <core/ErrorStr.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

using namespace ::chip;

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <app/util/af.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/FactoryDataProvider.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
Expand Down
4 changes: 2 additions & 2 deletions examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "AppEvent.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>

#include <DeviceInfoProviderImpl.h>
#include <app/server/OnboardingCodesUtil.h>
Expand Down Expand Up @@ -425,7 +425,7 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)

void AppTask::KBD_Callback(uint8_t events)
{
eventMask = eventMask | (uint32_t)(1 << events);
eventMask = eventMask | (uint32_t) (1 << events);

HandleKeyboard();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/ameba/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <core/ErrorStr.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <platform/Ameba/FactoryDataProvider.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

using namespace ::chip;
using namespace ::chip::Credentials;
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/af.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/ameba/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

#include "CHIPDeviceManager.h"
#include <app/util/basic-types.h>
#include <core/ErrorStr.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <platform/Ameba/FactoryDataProvider.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

#include "Globals.h"
#include "LEDWidget.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/af.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/beken/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Beken/BekenConfig.h>
#include <platform/Beken/NetworkCommissioningDriver.h>
#include <setup_payload/ManualSetupPayloadGenerator.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
#include <app/server/Server.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <system/SystemClock.h>

#ifdef CONFIG_CHIP_WIFI
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "AppEvent.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>

#include <app/server/OnboardingCodesUtil.h>
#include <credentials/DeviceAttestationCredsProvider.h>
Expand Down Expand Up @@ -427,7 +427,7 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)

void AppTask::KBD_Callback(uint8_t events)
{
eventMask = eventMask | (uint32_t)(1 << events);
eventMask = eventMask | (uint32_t) (1 << events);
}

void AppTask::HandleKeyboard(void)
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include <app/server/Server.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <system/SystemClock.h>

#ifdef CONFIG_CHIP_WIFI
Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "AppEvent.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>

#include <DeviceInfoProviderImpl.h>
#include <app/server/OnboardingCodesUtil.h>
Expand Down Expand Up @@ -323,7 +323,7 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)

void AppTask::KBD_Callback(uint8_t events)
{
eventMask = eventMask | (uint32_t)(1 << events);
eventMask = eventMask | (uint32_t) (1 << events);

HandleKeyboard();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <core/ErrorStr.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <platform/Ameba/FactoryDataProvider.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

using namespace ::chip;
using namespace ::chip::Credentials;
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-requestor-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <app/server/Server.h>
#include <app/util/af.h>

#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/persistent-storage/KeyValueStorageTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <cstring>
#include <string>

#include <lib/core/ErrorStr.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/KeyValueStoreManager.h>

Expand Down
2 changes: 1 addition & 1 deletion examples/persistent-storage/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "nvs_flash.h"
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>
#include <platform/KeyValueStoreManager.h>

const char * TAG = "persistent-storage";
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/asr/CHIPDeviceManager.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <app/util/config.h>
#include <core/ErrorStr.h>
#include <support/CHIPMem.h>
#include <support/CodeUtils.h>
#include <support/ErrorStr.h>

#ifdef EMBER_AF_PLUGIN_IDENTIFY_SERVER
#include <app/clusters/identify-server/identify-server.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/beken/common/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <setup_payload/SetupPayload.h>

using namespace ::chip;
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/esp32/common/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include "CHIPDeviceManager.h"
#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <setup_payload/SetupPayload.h>

#include "esp_log.h"
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/nrfconnect/util/test/TestInetCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
#include <string.h>
#include <sys/types.h>

#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/ErrorStr.h>
#include <lib/support/ScopedBuffer.h>

#if CHIP_SYSTEM_CONFIG_USE_SOCKETS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <setup_payload/SetupPayload.h>

using namespace ::chip;
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/cc13x4_26x4/main/CHIPDeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

#include <app/ConcreteAttributePath.h>
#include <app/util/basic-types.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <setup_payload/SetupPayload.h>

using namespace ::chip;
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <app/util/attribute-storage.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <system/SystemClock.h>

#if CONFIG_CHIP_OTA_REQUESTOR
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-controller-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <app/util/attribute-storage.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/ErrorStr.h>
#include <system/SystemClock.h>

#if CONFIG_CHIP_OTA_REQUESTOR
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "AppTask.h"
#include <app/server/Server.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>

#include "FreeRTOS.h"

Expand Down
2 changes: 1 addition & 1 deletion examples/shell/cc13x4_26x4/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "AppTask.h"
#include <app/server/Server.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>

#include "FreeRTOS.h"

Expand Down
4 changes: 2 additions & 2 deletions examples/shell/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "AppTask.h"
#include "AppEvent.h"
#include <app/server/Server.h>
#include <lib/support/ErrorStr.h>
#include <lib/core/ErrorStr.h>

#include <app/server/OnboardingCodesUtil.h>
#include <credentials/DeviceAttestationCredsProvider.h>
Expand Down Expand Up @@ -246,7 +246,7 @@ void AppTask::ButtonEventHandler(uint8_t pin_no, uint8_t button_action)

void AppTask::KBD_Callback(uint8_t events)
{
eventMask = eventMask | (uint32_t)(1 << events);
eventMask = eventMask | (uint32_t) (1 << events);

HandleKeyboard();
}
Expand Down
Loading

0 comments on commit de722df

Please sign in to comment.