From f408bf63bed9e4b249161d4b26c282c9af38b0e0 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Fri, 20 Nov 2020 12:36:07 -0800 Subject: [PATCH] [Darwin] Cleanup unused imports and forward declare where possible (#3893) --- src/darwin/Framework/CHIP/CHIP.h | 1 + src/darwin/Framework/CHIP/CHIPDeviceController.h | 6 +++--- src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h | 1 - .../Framework/CHIP/CHIPDevicePairingDelegateBridge.mm | 1 + src/darwin/Framework/CHIP/CHIPDeviceStatusDelegate.h | 1 - src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.h | 4 ++-- src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm | 1 + src/darwin/Framework/CHIP/CHIPOnOff.h | 5 +++-- src/darwin/Framework/CHIP/CHIPOnOff.mm | 1 + src/darwin/Framework/CHIP/CHIPPersistentStorageDelegate.h | 1 - src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.h | 5 ++--- src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm | 1 + src/darwin/Framework/CHIP/CHIPSetupPayload.h | 1 - src/darwin/Framework/CHIP/CHIPSetupPayload.mm | 1 + .../Framework/CHIPTests/CHIPSetupPayloadParserTests.m | 1 + 15 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/darwin/Framework/CHIP/CHIP.h b/src/darwin/Framework/CHIP/CHIP.h index 12974f9eafa25b..be8dbe756a05c5 100644 --- a/src/darwin/Framework/CHIP/CHIP.h +++ b/src/darwin/Framework/CHIP/CHIP.h @@ -17,6 +17,7 @@ // pull together CHIP headers #import +#import #import #import #import diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.h b/src/darwin/Framework/CHIP/CHIPDeviceController.h index ae29675872a8ec..04a2ee585f4d8d 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.h +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.h @@ -18,11 +18,11 @@ #ifndef CHIP_DEVICE_CONTROLLER_H #define CHIP_DEVICE_CONTROLLER_H -#import "CHIPDevice.h" -#import "CHIPDeviceStatusDelegate.h" -#import "CHIPError.h" +#import #import +@class CHIPDevice; + NS_ASSUME_NONNULL_BEGIN typedef void (^ControllerOnConnectedBlock)(void); diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h index 0bf9e90dcac493..e0f06d1e63c354 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegate.h @@ -15,7 +15,6 @@ * limitations under the License. */ -#import "CHIPError.h" #import NS_ASSUME_NONNULL_BEGIN diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm index fccf571ba52b98..c44c8896729e82 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm @@ -16,6 +16,7 @@ */ #import "CHIPDevicePairingDelegateBridge.h" +#import "CHIPError.h" #import CHIPDevicePairingDelegateBridge::CHIPDevicePairingDelegateBridge(void) diff --git a/src/darwin/Framework/CHIP/CHIPDeviceStatusDelegate.h b/src/darwin/Framework/CHIP/CHIPDeviceStatusDelegate.h index 6e92388641409e..efa618bc807253 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceStatusDelegate.h +++ b/src/darwin/Framework/CHIP/CHIPDeviceStatusDelegate.h @@ -15,7 +15,6 @@ * limitations under the License. */ -#import "CHIPError.h" #import NS_ASSUME_NONNULL_BEGIN diff --git a/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.h b/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.h index 64554ff34a8674..028d6b8604407e 100644 --- a/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.h +++ b/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.h @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// module header -#import "CHIPSetupPayload.h" #import +@class CHIPSetupPayload; + NS_ASSUME_NONNULL_BEGIN @interface CHIPManualSetupPayloadParser : NSObject diff --git a/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm b/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm index 1ac7523a2f9843..7a0977225efa51 100644 --- a/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm +++ b/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm @@ -18,6 +18,7 @@ #import "CHIPError.h" #import "CHIPLogging.h" +#import "CHIPSetupPayload.h" #import #import diff --git a/src/darwin/Framework/CHIP/CHIPOnOff.h b/src/darwin/Framework/CHIP/CHIPOnOff.h index 5e2ccd95de4cfc..352a133877f97f 100644 --- a/src/darwin/Framework/CHIP/CHIPOnOff.h +++ b/src/darwin/Framework/CHIP/CHIPOnOff.h @@ -18,10 +18,11 @@ #ifndef CHIP_ONOFF_H #define CHIP_ONOFF_H -#import "CHIPDevice.h" -#import "CHIPDeviceCallback.h" +#import #import +@class CHIPDevice; + NS_ASSUME_NONNULL_BEGIN @interface CHIPOnOff : NSObject diff --git a/src/darwin/Framework/CHIP/CHIPOnOff.mm b/src/darwin/Framework/CHIP/CHIPOnOff.mm index 4fd7e252780717..82db62f5741f93 100644 --- a/src/darwin/Framework/CHIP/CHIPOnOff.mm +++ b/src/darwin/Framework/CHIP/CHIPOnOff.mm @@ -18,6 +18,7 @@ #import #import "CHIPCallbackBridge.h" +#import "CHIPDevice.h" #import "CHIPDevice_Internal.h" #import "CHIPOnOff.h" diff --git a/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegate.h b/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegate.h index 7b46d21b3d9b70..32bf391a49b885 100644 --- a/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegate.h +++ b/src/darwin/Framework/CHIP/CHIPPersistentStorageDelegate.h @@ -15,7 +15,6 @@ * limitations under the License. */ -#import "CHIPError.h" #import NS_ASSUME_NONNULL_BEGIN diff --git a/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.h b/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.h index 6e4af44150c2fb..8bd4161c52a659 100644 --- a/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.h +++ b/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.h @@ -15,11 +15,10 @@ * limitations under the License. */ -// module header -#import "CHIPSetupPayload.h" - #import +@class CHIPSetupPayload; + NS_ASSUME_NONNULL_BEGIN @interface CHIPQRCodeSetupPayloadParser : NSObject diff --git a/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm b/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm index 5a36f5a082adb5..252dc4eb887837 100644 --- a/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm +++ b/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm @@ -18,6 +18,7 @@ #import "CHIPQRCodeSetupPayloadParser.h" #import "CHIPError.h" #import "CHIPLogging.h" +#import "CHIPSetupPayload.h" #import #import diff --git a/src/darwin/Framework/CHIP/CHIPSetupPayload.h b/src/darwin/Framework/CHIP/CHIPSetupPayload.h index ad04e2a161bb17..2d59f3706e0b46 100644 --- a/src/darwin/Framework/CHIP/CHIPSetupPayload.h +++ b/src/darwin/Framework/CHIP/CHIPSetupPayload.h @@ -15,7 +15,6 @@ * limitations under the License. */ -#import "CHIPError.h" #import #ifdef __cplusplus diff --git a/src/darwin/Framework/CHIP/CHIPSetupPayload.mm b/src/darwin/Framework/CHIP/CHIPSetupPayload.mm index 51488bc6998975..65d705fa2786ba 100644 --- a/src/darwin/Framework/CHIP/CHIPSetupPayload.mm +++ b/src/darwin/Framework/CHIP/CHIPSetupPayload.mm @@ -16,6 +16,7 @@ */ #import "CHIPSetupPayload.h" +#import "CHIPError.h" #import @implementation CHIPOptionalQRCodeInfo diff --git a/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m b/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m index cafab69abf8172..be85816b837844 100644 --- a/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m @@ -20,6 +20,7 @@ // module headers #import "CHIPManualSetupPayloadParser.h" #import "CHIPQRCodeSetupPayloadParser.h" +#import "CHIPSetupPayload.h" // additional includes #import "CHIPError.h"