Merge pull request #13099 from muxi/fix-objc-void-func

Fix warning "declaration is not a prototype"
pull/13513/merge
Muxi Yan 7 years ago committed by GitHub
commit c762a38879
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      include/grpc/grpc_security.h
  2. 2
      include/grpc/support/alloc.h
  3. 2
      include/grpc/support/log.h
  4. 6
      src/objective-c/GRPCClient/GRPCCall.m
  5. 4
      src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h
  6. 4
      src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m
  7. 2
      src/objective-c/GRPCClient/private/GRPCHost.m
  8. 10
      src/objective-c/GRPCClient/private/GRPCWrappedCall.h
  9. 14
      src/objective-c/GRPCClient/private/GRPCWrappedCall.m
  10. 2
      src/objective-c/RxLibrary/GRXConcurrentWriteable.h
  11. 2
      src/objective-c/RxLibrary/GRXConcurrentWriteable.m
  12. 2
      src/objective-c/RxLibrary/GRXImmediateWriter.h
  13. 2
      src/objective-c/RxLibrary/GRXImmediateWriter.m
  14. 2
      src/objective-c/RxLibrary/GRXWriter+Immediate.h
  15. 2
      src/objective-c/RxLibrary/GRXWriter+Immediate.m
  16. 2
      src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h
  17. 2
      src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m
  18. 2
      src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h
  19. 4
      src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m
  20. 6
      src/ruby/ext/grpc/rb_grpc_imports.generated.h

@ -185,7 +185,7 @@ GRPCAPI grpc_call_credentials* grpc_composite_call_credentials_create(
GRPCAPI grpc_call_credentials* grpc_google_compute_engine_credentials_create(
void* reserved);
GRPCAPI gpr_timespec grpc_max_auth_token_lifetime();
GRPCAPI gpr_timespec grpc_max_auth_token_lifetime(void);
/** Creates a JWT credentials object. May return NULL if the input is invalid.
- json_key is the JSON key string containing the client's private key.

@ -58,7 +58,7 @@ GPRAPI void gpr_free_aligned(void* ptr);
GPRAPI void gpr_set_allocation_functions(gpr_allocation_functions functions);
/** Return the family of allocation functions currently in effect. */
GPRAPI gpr_allocation_functions gpr_get_allocation_functions();
GPRAPI gpr_allocation_functions gpr_get_allocation_functions(void);
#ifdef __cplusplus
}

@ -68,7 +68,7 @@ GPRAPI void gpr_log_message(const char* file, int line,
/** Set global log verbosity */
GPRAPI void gpr_set_log_verbosity(gpr_log_severity min_severity_to_print);
GPRAPI void gpr_log_verbosity_init();
GPRAPI void gpr_log_verbosity_init(void);
/** Log overrides: applications can use this API to intercept logging calls
and use their own implementations */

@ -299,7 +299,7 @@ static NSString * const kBearerPrefix = @"Bearer ";
// network queue if the write didn't succeed.
// If the call is a unary call, parameter \a errorHandler will be ignored and
// the error handler of GRPCOpSendClose will be executed in case of error.
- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)())errorHandler {
- (void)writeMessage:(NSData *)message withErrorHandler:(void (^)(void))errorHandler {
__weak GRPCCall *weakSelf = self;
void(^resumingHandler)(void) = ^{
@ -345,7 +345,7 @@ static NSString * const kBearerPrefix = @"Bearer ";
// Only called from the call queue. The error handler will be called from the
// network queue if the requests stream couldn't be closed successfully.
- (void)finishRequestWithErrorHandler:(void (^)())errorHandler {
- (void)finishRequestWithErrorHandler:(void (^)(void))errorHandler {
if (!_unaryCall) {
[_wrappedCall startBatchWithOperations:@[[[GRPCOpSendClose alloc] init]]
errorHandler:errorHandler];
@ -441,7 +441,7 @@ static NSString * const kBearerPrefix = @"Bearer ";
}
_connectivityMonitor = [GRPCConnectivityMonitor monitorWithHost:host];
__weak typeof(self) weakSelf = self;
void (^handler)() = ^{
void (^handler)(void) = ^{
typeof(self) strongSelf = weakSelf;
[strongSelf finishWithError:[NSError errorWithDomain:kGRPCErrorDomain
code:GRPCErrorCodeUnavailable

@ -57,6 +57,6 @@
* Only one handler is active at a time, so if this method is called again before the previous
* handler has been called, it might never be called at all (or yes, if it has already been queued).
*/
- (void)handleLossWithHandler:(nullable void (^)())lossHandler
wifiStatusChangeHandler:(nullable void (^)())wifiStatusChangeHandler;
- (void)handleLossWithHandler:(nullable void (^)(void))lossHandler
wifiStatusChangeHandler:(nullable void (^)(void))wifiStatusChangeHandler;
@end

@ -136,8 +136,8 @@ static void PassFlagsToContextInfoBlock(SCNetworkReachabilityRef target,
return returnValue;
}
- (void)handleLossWithHandler:(nullable void (^)())lossHandler
wifiStatusChangeHandler:(nullable void (^)())wifiStatusChangeHandler {
- (void)handleLossWithHandler:(nullable void (^)(void))lossHandler
wifiStatusChangeHandler:(nullable void (^)(void))wifiStatusChangeHandler {
__weak typeof(self) weakSelf = self;
[self startListeningWithHandler:^(GRPCReachabilityFlags *flags) {
typeof(self) strongSelf = weakSelf;

@ -93,7 +93,7 @@ static GRPCConnectivityMonitor *connectivityMonitor = nil;
if (!connectivityMonitor) {
connectivityMonitor =
[GRPCConnectivityMonitor monitorWithHost:hostURL.host];
void (^handler)() = ^{
void (^handler)(void) = ^{
[GRPCHost flushChannelCache];
};
[connectivityMonitor handleLossWithHandler:handler

@ -30,24 +30,24 @@
@interface GRPCOpSendMetadata : GRPCOperation
- (instancetype)initWithMetadata:(NSDictionary *)metadata
handler:(void(^)())handler;
handler:(void(^)(void))handler;
- (instancetype)initWithMetadata:(NSDictionary *)metadata
flags:(uint32_t)flags
handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
@end
@interface GRPCOpSendMessage : GRPCOperation
- (instancetype)initWithMessage:(NSData *)message
handler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
handler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
@end
@interface GRPCOpSendClose : GRPCOperation
- (instancetype)initWithHandler:(void(^)())handler NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithHandler:(void(^)(void))handler NS_DESIGNATED_INITIALIZER;
@end
@ -79,7 +79,7 @@
path:(NSString *)path
timeout:(NSTimeInterval)timeout NS_DESIGNATED_INITIALIZER;
- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)())errorHandler;
- (void)startBatchWithOperations:(NSArray *)ops errorHandler:(void(^)(void))errorHandler;
- (void)startBatchWithOperations:(NSArray *)ops;

@ -36,12 +36,12 @@
// Most operation subclasses don't set any flags in the grpc_op, and rely on the flag member being
// initialized to zero.
grpc_op _op;
void(^_handler)();
void(^_handler)(void);
}
- (void)finish {
if (_handler) {
void(^handler)() = _handler;
void(^handler)(void) = _handler;
_handler = nil;
handler();
}
@ -55,13 +55,13 @@
}
- (instancetype)initWithMetadata:(NSDictionary *)metadata
handler:(void (^)())handler {
handler:(void (^)(void))handler {
return [self initWithMetadata:metadata flags:0 handler:handler];
}
- (instancetype)initWithMetadata:(NSDictionary *)metadata
flags:(uint32_t)flags
handler:(void (^)())handler {
handler:(void (^)(void))handler {
if (self = [super init]) {
_op.op = GRPC_OP_SEND_INITIAL_METADATA;
_op.data.send_initial_metadata.count = metadata.count;
@ -92,7 +92,7 @@
return [self initWithMessage:nil handler:nil];
}
- (instancetype)initWithMessage:(NSData *)message handler:(void (^)())handler {
- (instancetype)initWithMessage:(NSData *)message handler:(void (^)(void))handler {
if (!message) {
[NSException raise:NSInvalidArgumentException format:@"message cannot be nil"];
}
@ -116,7 +116,7 @@
return [self initWithHandler:nil];
}
- (instancetype)initWithHandler:(void (^)())handler {
- (instancetype)initWithHandler:(void (^)(void))handler {
if (self = [super init]) {
_op.op = GRPC_OP_SEND_CLOSE_FROM_CLIENT;
_handler = handler;
@ -271,7 +271,7 @@
[self startBatchWithOperations:operations errorHandler:nil];
}
- (void)startBatchWithOperations:(NSArray *)operations errorHandler:(void (^)())errorHandler {
- (void)startBatchWithOperations:(NSArray *)operations errorHandler:(void (^)(void))errorHandler {
// Keep logs of op batches when we are running tests. Disabled when in production for improved
// performance.
#ifdef GRPC_TEST_OBJC

@ -46,7 +46,7 @@
* Enqueues writeValue: to be sent to the writeable in the main thread.
* The passed handler is invoked from the main thread after writeValue: returns.
*/
- (void)enqueueValue:(id)value completionHandler:(void (^)())handler;
- (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler;
/**
* Enqueues writesFinishedWithError:nil to be sent to the writeable in the main thread. After that

@ -50,7 +50,7 @@
dispatchQueue:dispatch_get_main_queue()];
}
- (void)enqueueValue:(id)value completionHandler:(void (^)())handler {
- (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler {
dispatch_async(_writeableQueue, ^{
// We're racing a possible cancellation performed by another thread. To turn all already-
// enqueued messages into noops, cancellation nillifies the writeable property. If we get it

@ -46,7 +46,7 @@
* Returns a writer that pushes to its writeable the successive values returned by the passed
* block. When the block first returns nil, it is released.
*/
+ (GRXWriter *)writerWithValueSupplier:(id (^)())block;
+ (GRXWriter *)writerWithValueSupplier:(id (^)(void))block;
/**
* Returns a writer that iterates over the values of the passed container and pushes them to

@ -52,7 +52,7 @@
return [self writerWithEnumerator:enumerator error:nil];
}
+ (GRXWriter *)writerWithValueSupplier:(id (^)())block {
+ (GRXWriter *)writerWithValueSupplier:(id (^)(void))block {
return [self writerWithEnumerator:[NSEnumerator grx_enumeratorWithValueSupplier:block]];
}

@ -30,7 +30,7 @@
* Returns a writer that pushes to its writeable the successive values returned by the passed
* block. When the block first returns nil, it is released.
*/
+ (instancetype)writerWithValueSupplier:(id (^)())block;
+ (instancetype)writerWithValueSupplier:(id (^)(void))block;
/**
* Returns a writer that iterates over the values of the passed container and pushes them to

@ -27,7 +27,7 @@
return [GRXImmediateWriter writerWithEnumerator:enumerator];
}
+ (instancetype)writerWithValueSupplier:(id (^)())block {
+ (instancetype)writerWithValueSupplier:(id (^)(void))block {
return [GRXImmediateWriter writerWithValueSupplier:block];
}

@ -38,5 +38,5 @@
* Returns a NSEnumerator instance that delegates the invocations of nextObject to the passed block.
* When the block first returns nil, it is released.
*/
+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block;
+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)(void))block;
@end

@ -33,7 +33,7 @@
return [[GRXNSScalarEnumerator alloc] initWithValue:value];
}
+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)())block {
+ (NSEnumerator *)grx_enumeratorWithValueSupplier:(id (^)(void))block {
return [[GRXNSBlockEnumerator alloc] initWithValueSupplier:block];
}
@end

@ -27,5 +27,5 @@
* The first time the passed block returns nil, the enumeration will end and the block will be
* released.
*/
- (instancetype)initWithValueSupplier:(id (^)())block;
- (instancetype)initWithValueSupplier:(id (^)(void))block;
@end

@ -19,14 +19,14 @@
#import "GRXNSBlockEnumerator.h"
@implementation GRXNSBlockEnumerator {
id (^_block)();
id (^_block)(void);
}
- (instancetype)init {
return [self initWithValueSupplier:nil];
}
- (instancetype)initWithValueSupplier:(id (^)())block {
- (instancetype)initWithValueSupplier:(id (^)(void))block {
if ((self = [super init])) {
_block = block;
}

@ -337,7 +337,7 @@ extern grpc_composite_call_credentials_create_type grpc_composite_call_credentia
typedef grpc_call_credentials*(*grpc_google_compute_engine_credentials_create_type)(void* reserved);
extern grpc_google_compute_engine_credentials_create_type grpc_google_compute_engine_credentials_create_import;
#define grpc_google_compute_engine_credentials_create grpc_google_compute_engine_credentials_create_import
typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)();
typedef gpr_timespec(*grpc_max_auth_token_lifetime_type)(void);
extern grpc_max_auth_token_lifetime_type grpc_max_auth_token_lifetime_import;
#define grpc_max_auth_token_lifetime grpc_max_auth_token_lifetime_import
typedef grpc_call_credentials*(*grpc_service_account_jwt_access_credentials_create_type)(const char* json_key, gpr_timespec token_lifetime, void* reserved);
@ -589,7 +589,7 @@ extern gpr_free_aligned_type gpr_free_aligned_import;
typedef void(*gpr_set_allocation_functions_type)(gpr_allocation_functions functions);
extern gpr_set_allocation_functions_type gpr_set_allocation_functions_import;
#define gpr_set_allocation_functions gpr_set_allocation_functions_import
typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)();
typedef gpr_allocation_functions(*gpr_get_allocation_functions_type)(void);
extern gpr_get_allocation_functions_type gpr_get_allocation_functions_import;
#define gpr_get_allocation_functions gpr_get_allocation_functions_import
typedef gpr_avl(*gpr_avl_create_type)(const gpr_avl_vtable* vtable);
@ -712,7 +712,7 @@ extern gpr_log_message_type gpr_log_message_import;
typedef void(*gpr_set_log_verbosity_type)(gpr_log_severity min_severity_to_print);
extern gpr_set_log_verbosity_type gpr_set_log_verbosity_import;
#define gpr_set_log_verbosity gpr_set_log_verbosity_import
typedef void(*gpr_log_verbosity_init_type)();
typedef void(*gpr_log_verbosity_init_type)(void);
extern gpr_log_verbosity_init_type gpr_log_verbosity_init_import;
#define gpr_log_verbosity_init gpr_log_verbosity_init_import
typedef void(*gpr_set_log_function_type)(gpr_log_func func);

Loading…
Cancel
Save