From b3584aa21e5828a2949f93dcb097cccef2d74105 Mon Sep 17 00:00:00 2001 From: Jorge Canizales Date: Sat, 8 Aug 2015 15:01:24 -0700 Subject: [PATCH] Have ObjC use the new future-proofed C interface --- src/objective-c/GRPCClient/private/GRPCCompletionQueue.m | 5 +++-- src/objective-c/GRPCClient/private/GRPCHost.m | 2 +- src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m | 2 +- src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m index 696069c200f..ea2b01ee1d7 100644 --- a/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m +++ b/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m @@ -43,7 +43,7 @@ - (instancetype)init { if ((self = [super init])) { - _unmanagedQueue = grpc_completion_queue_create(); + _unmanagedQueue = grpc_completion_queue_create(NULL); // This is for the following block to capture the pointer by value (instead // of retaining self and doing self->_unmanagedQueue). This is essential @@ -64,7 +64,8 @@ while (YES) { // The following call blocks until an event is available. grpc_event event = grpc_completion_queue_next(unmanagedQueue, - gpr_inf_future(GPR_CLOCK_REALTIME)); + gpr_inf_future(GPR_CLOCK_REALTIME), + NULL); GRPCQueueCompletionHandler handler; switch (event.type) { case GRPC_OP_COMPLETE: diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m index d902f95b516..a7142d0f009 100644 --- a/src/objective-c/GRPCClient/private/GRPCHost.m +++ b/src/objective-c/GRPCClient/private/GRPCHost.m @@ -97,7 +97,7 @@ queue.unmanagedQueue, path.UTF8String, self.hostName.UTF8String, - gpr_inf_future(GPR_CLOCK_REALTIME)); + gpr_inf_future(GPR_CLOCK_REALTIME), NULL); } - (GRPCChannel *)channel { diff --git a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m b/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m index 070a529629a..15b6ffc75cf 100644 --- a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m +++ b/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m @@ -38,7 +38,7 @@ @implementation GRPCUnsecuredChannel - (instancetype)initWithHost:(NSString *)host { - return (self = [super initWithChannel:grpc_insecure_channel_create(host.UTF8String, NULL)]); + return (self = [super initWithChannel:grpc_insecure_channel_create(host.UTF8String, NULL, NULL)]); } // TODO(jcanizales): GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 951c0510369..fe3d51da53a 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -282,7 +282,7 @@ for (GRPCOperation *operation in operations) { [operation finish]; } - })); + }), NULL); gpr_free(ops_array); if (error != GRPC_CALL_OK) { @@ -293,7 +293,7 @@ } - (void)cancel { - grpc_call_cancel(_call); + grpc_call_cancel(_call, NULL); } - (void)dealloc {