From 8eaebb8a33a103202f71970c039ec3b05f172a74 Mon Sep 17 00:00:00 2001 From: Joel Fischer Date: Tue, 18 Feb 2020 15:46:07 -0500 Subject: Remove deprecations of structs -> dictionary and visa versa --- SmartDeviceLink/SDLProtocol.m | 4 ---- SmartDeviceLink/SDLRPCStruct.h | 4 ++-- SmartDeviceLink/SDLRPCStruct.m | 3 --- SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m | 6 ------ SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m | 3 --- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/SmartDeviceLink/SDLProtocol.m b/SmartDeviceLink/SDLProtocol.m index f71da8354..29c7ca38f 100644 --- a/SmartDeviceLink/SDLProtocol.m +++ b/SmartDeviceLink/SDLProtocol.m @@ -286,11 +286,7 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)sendRPC:(SDLRPCMessage *)message encrypted:(BOOL)encryption error:(NSError *__autoreleasing *)error { NSParameterAssert(message != nil); - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSData *jsonData = [NSJSONSerialization dataWithJSONObject:[message serializeAsDictionary:(Byte)[SDLGlobals sharedGlobals].protocolVersion.major] options:kNilOptions error:error]; -#pragma clang diagnostic pop if (error != nil) { SDLLogW(@"Error encoding JSON data: %@", *error); diff --git a/SmartDeviceLink/SDLRPCStruct.h b/SmartDeviceLink/SDLRPCStruct.h index 523400261..e8a36d903 100644 --- a/SmartDeviceLink/SDLRPCStruct.h +++ b/SmartDeviceLink/SDLRPCStruct.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN * @param dict A dictionary * @return A SDLRPCStruct object */ -- (instancetype)initWithDictionary:(NSDictionary *)dict __deprecated_msg("This is not intended for public use"); +- (instancetype)initWithDictionary:(NSDictionary *)dict; /** * Converts struct to JSON formatted data @@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN * @param version The protocol version * @return JSON formatted data */ -- (NSDictionary *)serializeAsDictionary:(Byte)version __deprecated_msg("This is not intended for public use"); +- (NSDictionary *)serializeAsDictionary:(Byte)version; @end diff --git a/SmartDeviceLink/SDLRPCStruct.m b/SmartDeviceLink/SDLRPCStruct.m index e3de83f73..9956df03d 100644 --- a/SmartDeviceLink/SDLRPCStruct.m +++ b/SmartDeviceLink/SDLRPCStruct.m @@ -54,8 +54,6 @@ NS_ASSUME_NONNULL_BEGIN return [self.store description]; } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" + (NSDictionary *)sdl_serializeDictionary:(NSDictionary *)dict version:(Byte)version { NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithCapacity:dict.count]; for (NSString *key in dict.keyEnumerator) { @@ -82,7 +80,6 @@ NS_ASSUME_NONNULL_BEGIN } return ret; } -#pragma clang diagnostic pop - (id)copyWithZone:(nullable NSZone *)zone { SDLRPCStruct *newStruct = [[[self class] allocWithZone:zone] initWithDictionary:_store]; diff --git a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m index 1a322e373..a8901a2a0 100644 --- a/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m +++ b/SmartDeviceLinkTests/ProtocolSpecs/MessageSpecs/SDLProtocolSpec.m @@ -215,10 +215,7 @@ describe(@"SendRPCRequest Tests", ^ { context(@"During V1 session", ^ { it(@"Should send the correct data", ^ { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" [[[[mockRequest stub] andReturn:dictionaryV1] ignoringNonObjectArgs] serializeAsDictionary:1]; -#pragma clang diagnostic pop SDLProtocol* testProtocol = [[SDLProtocol alloc] init]; SDLV1ProtocolHeader *testHeader = [[SDLV1ProtocolHeader alloc] init]; @@ -255,10 +252,7 @@ describe(@"SendRPCRequest Tests", ^ { context(@"During V2 session", ^ { it(@"Should send the correct data bulk data when bulk data is available", ^ { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" [[[[mockRequest stub] andReturn:dictionaryV2] ignoringNonObjectArgs] serializeAsDictionary:2]; -#pragma clang diagnostic pop [[[mockRequest stub] andReturn:@0x98765] correlationID]; [[[mockRequest stub] andReturn:@"DeleteCommand"] name]; [[[mockRequest stub] andReturn:[NSData dataWithBytes:"COMMAND" length:strlen("COMMAND")]] bulkData]; diff --git a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m index 8dd6eaf99..1b2c4d348 100644 --- a/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/SuperclassSpecs/SDLRPCStructSpec.m @@ -14,13 +14,10 @@ QuickSpecBegin(SDLRPCStructSpec) describe(@"SerializeAsDictionary Tests", ^ { it(@"Should serialize correctly", ^ { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSMutableDictionary *dict = [@{@"Key":@"Value", @"Answer":@42, @"Struct":[[SDLRPCStruct alloc] initWithDictionary:[@{@"Array":@[@1, @1, @1, @1]} mutableCopy]]} mutableCopy]; SDLRPCStruct* testStruct = [[SDLRPCStruct alloc] initWithDictionary:dict]; expect([testStruct serializeAsDictionary:2]).to(equal([@{@"Key":@"Value", @"Answer":@42, @"Struct":@{@"Array":@[@1, @1, @1, @1]}} mutableCopy])); -#pragma clang diagnostic pop }); }); -- cgit v1.2.1