aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-12-19 14:09:56 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-12-19 14:09:56 -0800
commitc5f84c5cb8830ad5ac4a9f097804308adce204be (patch)
tree7434a239f33acfd9ea3417b03263b2bdab87d60e /src
parent0de27b5d2955c2d19a998e133580b721836676da (diff)
Batch fix
Diffstat (limited to 'src')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCWrappedCall.m4
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.h6
-rw-r--r--src/objective-c/ProtoRPC/ProtoService.m13
3 files changed, 16 insertions, 7 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
index 1a848a4b7c..7d7e77f6ba 100644
--- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
+++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m
@@ -292,6 +292,10 @@
gpr_free(ops_array);
NSAssert(error == GRPC_CALL_OK, @"Error starting a batch of operations: %i", error);
+ // To avoid compiler complaint when NSAssert is disabled.
+ if (error != GRPC_CALL_OK) {
+ return;
+ }
}
}
}
diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h
index d76e96ce2a..900ec8d0e1 100644
--- a/src/objective-c/ProtoRPC/ProtoService.h
+++ b/src/objective-c/ProtoRPC/ProtoService.h
@@ -25,7 +25,7 @@
@class GRPCProtoCall;
@class GRPCUnaryProtoCall;
@class GRPCStreamingProtoCall;
-@protocol GRPCProtoResponseCallbacks;
+@protocol GRPCProtoResponseHandler;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnullability-completeness"
@@ -49,12 +49,12 @@ __attribute__((deprecated("Please use GRPCProtoService."))) @interface ProtoServ
- (nullable GRPCUnaryProtoCall *)RPCToMethod:(nonnull NSString *)method
message:(nonnull id)message
- responseHandler:(nonnull id<GRPCProtoResponseCallbacks>)handler
+ responseHandler:(nonnull id<GRPCProtoResponseHandler>)handler
callOptions:(nullable GRPCCallOptions *)callOptions
responseClass:(nonnull Class)responseClass;
- (nullable GRPCStreamingProtoCall *)RPCToMethod:(nonnull NSString *)method
- responseHandler:(nonnull id<GRPCProtoResponseCallbacks>)handler
+ responseHandler:(nonnull id<GRPCProtoResponseHandler>)handler
callOptions:(nullable GRPCCallOptions *)callOptions
responseClass:(nonnull Class)responseClass;
diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m
index b7c7fadbcf..80a1f2f226 100644
--- a/src/objective-c/ProtoRPC/ProtoService.m
+++ b/src/objective-c/ProtoRPC/ProtoService.m
@@ -58,11 +58,14 @@
return self;
}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wobjc-designated-initializers"
+// Do not call designated initializer here due to nullability incompatibility. This method is from
+// old API and does not assert on nullability of the parameters.
+
- (instancetype)initWithHost:(NSString *)host
packageName:(NSString *)packageName
serviceName:(NSString *)serviceName {
- // Do not call designated initializer here due to nullability incompatibility. This method is from
- // old API and does not assert on nullability of the parameters.
if ((self = [super init])) {
_host = [host copy];
_packageName = [packageName copy];
@@ -72,6 +75,8 @@
return self;
}
+#pragma clang diagnostic pop
+
- (GRPCProtoCall *)RPCToMethod:(NSString *)method
requestsWriter:(GRXWriter *)requestsWriter
responseClass:(Class)responseClass
@@ -87,7 +92,7 @@
- (GRPCUnaryProtoCall *)RPCToMethod:(NSString *)method
message:(id)message
- responseHandler:(id<GRPCProtoResponseCallbacks>)handler
+ responseHandler:(id<GRPCProtoResponseHandler>)handler
callOptions:(GRPCCallOptions *)callOptions
responseClass:(Class)responseClass {
GRPCProtoMethod *methodName =
@@ -104,7 +109,7 @@
}
- (GRPCStreamingProtoCall *)RPCToMethod:(NSString *)method
- responseHandler:(id<GRPCProtoResponseCallbacks>)handler
+ responseHandler:(id<GRPCProtoResponseHandler>)handler
callOptions:(GRPCCallOptions *)callOptions
responseClass:(Class)responseClass {
GRPCProtoMethod *methodName =