Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit b813bbf

Browse files
committed
Fix Objective C warnings
Fixed the following warnings: * conflicting return type in implementation of 'setNodeId:': 'void *' vs 'void' * extra tokens at end of #endif directive * unannotated fall-through between switch labels * designated initializer should only invoke a designated initializer on 'super' * convenience initializer should not invoke an initializer on 'super' * hiding of overloaded virtual functions
1 parent 1898571 commit b813bbf

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

src/device-manager/WeaveDataManagementClient.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ typedef WEAVE_ERROR (*GetDataHandleFunct)(void * apContext, const TraitCatalogBa
8181
class NL_DLL_EXPORT GenericTraitUpdatableDataSink : public nl::Weave::Profiles::DataManagement::TraitUpdatableDataSink
8282
{
8383
friend class WdmClient;
84-
84+
using nl::Weave::Profiles::DataManagement_Current::TraitDataSink::SetData;
85+
using nl::Weave::Profiles::DataManagement_Current::TraitUpdatableDataSink::GetData;
8586
private:
8687
GenericTraitUpdatableDataSink(const nl::Weave::Profiles::DataManagement::TraitSchemaEngine * aEngine, WdmClient * apWdmClient);
8788
~GenericTraitUpdatableDataSink(void);

src/device-manager/cocoa/NLGenericTraitUpdatableDataSink_Protected.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242
- (void)close;
4343

4444
@end
45-
#endif WEAVE_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL
45+
#endif // WEAVE_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL

src/device-manager/cocoa/NLNetworkInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extern const int NLThreadChannel_NotSpecified;
6060
@property (nonatomic, strong) NSData * ThreadPSKc; // The Thread pre-shared key commissioner, or NULL if not specified.
6161

6262

63-
- (instancetype)init NS_DESIGNATED_INITIALIZER;
63+
- (instancetype)init;
6464

6565
- (id)initWithWiFiSSID:(NSString *)ssid wifiKey:(NSData *)wifiKey securityType:(NLWiFiSecurityType)securityType;
6666

src/device-manager/cocoa/NLResourceIdentifier.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
@property (nonatomic) int32_t ResourceType;
3030
@property (nonatomic) uint64_t ResourceId;
3131

32-
- (instancetype)init NS_DESIGNATED_INITIALIZER;
33-
- (instancetype)initWithType:(int32_t)type id:(uint64_t)idValue;
32+
- (instancetype)init;
33+
- (instancetype)initWithType:(int32_t)type id:(uint64_t)idValue NS_DESIGNATED_INITIALIZER;
3434
@end

src/device-manager/cocoa/NLWdmClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ typedef void (^WdmClientFailureBlock)(id owner, NSError * error);
5757
* @param nodeId Weave node ID
5858
*
5959
*/
60-
- (void *)setNodeId:(uint64_t)nodeId;
60+
- (void)setNodeId:(uint64_t)nodeId;
6161

6262
/**
6363
* Create the new data newDataSink

src/device-manager/cocoa/NLWdmClient.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ void bindingEventCallback(void * const apAppState, const nl::Weave::Binding::Eve
8080
case nl::Weave::Binding::kEvent_DefaultCheck:
8181
WDM_LOG_DEBUG(@"kEvent_DefaultCheck");
8282
// fall through
83+
OS_FALLTHROUGH;
8384
default:
8485
nl::Weave::Binding::DefaultEventHandler(apAppState, aEvent, aInParam, aOutParam);
8586
}

src/device-manager/cocoa/NLWeaveStack.mm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,10 @@ - (NLWeaveDeviceManager *)createDeviceManager:(NSString *)name appCallbackQueue:
477477
WDM_LOG_METHOD_SIG();
478478

479479
_mDeviceMgr = [[NLWeaveDeviceManager alloc] init:name
480-
weaveWorkQueue:_mWorkQueue
481-
appCallbackQueue:appCallbackQueue
482-
exchangeMgr:&_mExchangeMgr
483-
securityMgr:&_mSecurityMgr];
480+
weaveWorkQueue:_mWorkQueue
481+
appCallbackQueue:appCallbackQueue
482+
exchangeMgr:&_mExchangeMgr
483+
securityMgr:&_mSecurityMgr];
484484
if (nil == _mDeviceMgr) {
485485
WDM_LOG_ERROR(@"Cannot create new NLWeaveDeviceManager\n");
486486
}
@@ -492,12 +492,12 @@ - (NLWdmClient *)createWdmClient:(NSString *)name appCallbackQueue:(dispatch_que
492492
{
493493
WDM_LOG_METHOD_SIG();
494494

495-
NLWdmClient * _mWdmClient = [[NLWdmClient alloc] init:name
496-
weaveWorkQueue:_mWorkQueue
497-
appCallbackQueue:appCallbackQueue
498-
exchangeMgr:&_mExchangeMgr
499-
messageLayer:&_mMessageLayer
500-
nlWeaveDeviceManager:_mDeviceMgr];
495+
_mWdmClient = [[NLWdmClient alloc] init:name
496+
weaveWorkQueue:_mWorkQueue
497+
appCallbackQueue:appCallbackQueue
498+
exchangeMgr:&_mExchangeMgr
499+
messageLayer:&_mMessageLayer
500+
nlWeaveDeviceManager:_mDeviceMgr];
501501
if (nil == _mWdmClient) {
502502
WDM_LOG_ERROR(@"Cannot create new NLWdmClient\n");
503503
}

0 commit comments

Comments
 (0)