diff options
author | Muxi Yan <mxyan@google.com> | 2018-04-11 18:10:02 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2018-04-11 18:10:02 -0700 |
commit | c92d90aba2bd1bd710830c781d1e1e4c8adea0ba (patch) | |
tree | db1825d2676e0be8809918378ab2826c24d42f17 /src/objective-c/RxLibrary | |
parent | e433b56defb450f5815e973da8798512b99c9e51 (diff) |
clang-format objective-c files
Diffstat (limited to 'src/objective-c/RxLibrary')
10 files changed, 28 insertions, 28 deletions
diff --git a/src/objective-c/RxLibrary/GRXBufferedPipe.m b/src/objective-c/RxLibrary/GRXBufferedPipe.m index 577a5e9a42..546d46cba3 100644 --- a/src/objective-c/RxLibrary/GRXBufferedPipe.m +++ b/src/objective-c/RxLibrary/GRXBufferedPipe.m @@ -67,7 +67,7 @@ #pragma mark GRXWriter implementation - (void)setState:(GRXWriterState)newState { - @synchronized (self) { + @synchronized(self) { // Manual transitions are only allowed from the started or paused states. if (_state == GRXWriterStateNotStarted || _state == GRXWriterStateFinished) { return; @@ -112,8 +112,7 @@ - (void)dealloc { GRXWriterState state = self.state; - if (state == GRXWriterStateNotStarted || - state == GRXWriterStatePaused) { + if (state == GRXWriterStateNotStarted || state == GRXWriterStatePaused) { dispatch_resume(_writeQueue); } } diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h index f16a3d052a..abb831e6fb 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.h +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.h @@ -18,8 +18,8 @@ #import <Foundation/Foundation.h> -#import "GRXWriter.h" #import "GRXWriteable.h" +#import "GRXWriter.h" /** * This is a thread-safe wrapper over a GRXWriteable instance. It lets one enqueue calls to a diff --git a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m index c262313496..523c59c6de 100644 --- a/src/objective-c/RxLibrary/GRXConcurrentWriteable.m +++ b/src/objective-c/RxLibrary/GRXConcurrentWriteable.m @@ -46,8 +46,7 @@ } - (instancetype)initWithWriteable:(id<GRXWriteable>)writeable { - return [self initWithWriteable:writeable - dispatchQueue:dispatch_get_main_queue()]; + return [self initWithWriteable:writeable dispatchQueue:dispatch_get_main_queue()]; } - (void)enqueueValue:(id)value completionHandler:(void (^)(void))handler { @@ -69,7 +68,7 @@ typeof(self) strongSelf = weakSelf; if (strongSelf) { BOOL finished = NO; - @synchronized (self) { + @synchronized(self) { if (!strongSelf->_alreadyFinished) { strongSelf->_alreadyFinished = YES; } else { @@ -90,7 +89,7 @@ - (void)cancelWithError:(NSError *)error { NSAssert(error, @"For a successful completion, use enqueueSuccessfulCompletion."); BOOL finished = NO; - @synchronized (self) { + @synchronized(self) { if (!_alreadyFinished) { _alreadyFinished = YES; } else { @@ -112,7 +111,7 @@ - (void)cancelSilently { BOOL finished = NO; - @synchronized (self) { + @synchronized(self) { if (!_alreadyFinished) { _alreadyFinished = YES; } else { diff --git a/src/objective-c/RxLibrary/GRXForwardingWriter.m b/src/objective-c/RxLibrary/GRXForwardingWriter.m index e7365d3097..3e522ef24e 100644 --- a/src/objective-c/RxLibrary/GRXForwardingWriter.m +++ b/src/objective-c/RxLibrary/GRXForwardingWriter.m @@ -18,7 +18,7 @@ #import "GRXForwardingWriter.h" -@interface GRXForwardingWriter () <GRXWriteable> +@interface GRXForwardingWriter ()<GRXWriteable> @end @implementation GRXForwardingWriter { diff --git a/src/objective-c/RxLibrary/GRXImmediateWriter.m b/src/objective-c/RxLibrary/GRXImmediateWriter.m index c5d6d1310a..0456961b2d 100644 --- a/src/objective-c/RxLibrary/GRXImmediateWriter.m +++ b/src/objective-c/RxLibrary/GRXImmediateWriter.m @@ -28,8 +28,8 @@ @synthesize state = _state; -- (instancetype) init { - return [self initWithEnumerator:nil error:nil]; // results in an empty writer. +- (instancetype)init { + return [self initWithEnumerator:nil error:nil]; // results in an empty writer. } // Designated initializer @@ -57,7 +57,8 @@ } + (GRXWriter *)writerWithContainer:(id<NSFastEnumeration>)container { - return [self writerWithEnumerator:[NSEnumerator grx_enumeratorWithContainer:container]];; + return [self writerWithEnumerator:[NSEnumerator grx_enumeratorWithContainer:container]]; + ; } + (GRXWriter *)writerWithValue:(id)value { diff --git a/src/objective-c/RxLibrary/GRXWriteable.h b/src/objective-c/RxLibrary/GRXWriteable.h index d150bc849c..71b5979c69 100644 --- a/src/objective-c/RxLibrary/GRXWriteable.h +++ b/src/objective-c/RxLibrary/GRXWriteable.h @@ -22,7 +22,7 @@ * A GRXWriteable is an object to which a sequence of values can be sent. The * sequence finishes with an optional error. */ -@protocol GRXWriteable <NSObject> +@protocol GRXWriteable<NSObject> /** Push the next value of the sequence to the receiving object. */ - (void)writeValue:(id)value; diff --git a/src/objective-c/RxLibrary/GRXWriteable.m b/src/objective-c/RxLibrary/GRXWriteable.m index fcdf3bab40..e6c4c810c7 100644 --- a/src/objective-c/RxLibrary/GRXWriteable.m +++ b/src/objective-c/RxLibrary/GRXWriteable.m @@ -42,9 +42,8 @@ } else if (error) { singleHandler(nil, error); } else { - NSDictionary *userInfo = @{ - NSLocalizedDescriptionKey: @"The writer finished without producing any value." - }; + NSDictionary *userInfo = + @{NSLocalizedDescriptionKey : @"The writer finished without producing any value."}; // Even though RxLibrary is independent of gRPC, the domain and code here are, for the moment, // set to the values of kGRPCErrorDomain and GRPCErrorCodeInternal. This way, the error formed // is the one user of gRPC would expect if the server failed to produce a response. @@ -55,9 +54,9 @@ // the two domains. static NSString *kGRPCErrorDomain = @"io.grpc"; static NSUInteger kGRPCErrorCodeInternal = 13; - singleHandler(nil, [NSError errorWithDomain:kGRPCErrorDomain - code:kGRPCErrorCodeInternal - userInfo:userInfo]); + singleHandler( + nil, + [NSError errorWithDomain:kGRPCErrorDomain code:kGRPCErrorCodeInternal userInfo:userInfo]); } }; return [self writeableWithEventHandler:^(BOOL done, id value, NSError *error) { @@ -73,9 +72,10 @@ } return [[self alloc] initWithValueHandler:^(id value) { handler(NO, value, nil); - } completionHandler:^(NSError *errorOrNil) { - handler(YES, nil, errorOrNil); - }]; + } + completionHandler:^(NSError *errorOrNil) { + handler(YES, nil, errorOrNil); + }]; } - (instancetype)init { diff --git a/src/objective-c/RxLibrary/GRXWriter+Immediate.m b/src/objective-c/RxLibrary/GRXWriter+Immediate.m index a36a56764d..58cd8dde60 100644 --- a/src/objective-c/RxLibrary/GRXWriter+Immediate.m +++ b/src/objective-c/RxLibrary/GRXWriter+Immediate.m @@ -18,8 +18,8 @@ #import "GRXWriter+Immediate.h" -#import "GRXImmediateWriter.h" #import "GRXImmediateSingleWriter.h" +#import "GRXImmediateWriter.h" @implementation GRXWriter (Immediate) diff --git a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h index 39fe7e1e0a..a344f96622 100644 --- a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h +++ b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h @@ -18,8 +18,9 @@ #import "RxLibrary/GRXForwardingWriter.h" -/** A "proxy" writer that transforms all the values of its input writer by using a mapping function. */ +/** A "proxy" writer that transforms all the values of its input writer by using a mapping function. + */ @interface GRXMappingWriter : GRXForwardingWriter -- (instancetype)initWithWriter:(GRXWriter *)writer map:(id (^)(id value))map - NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithWriter:(GRXWriter *)writer + map:(id (^)(id value))map NS_DESIGNATED_INITIALIZER; @end diff --git a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.m b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.m index baad4ab99d..108ed868a2 100644 --- a/src/objective-c/RxLibrary/transformations/GRXMappingWriter.m +++ b/src/objective-c/RxLibrary/transformations/GRXMappingWriter.m @@ -18,7 +18,7 @@ #import "GRXMappingWriter.h" -@interface GRXForwardingWriter () <GRXWriteable> +@interface GRXForwardingWriter ()<GRXWriteable> @end @implementation GRXMappingWriter { |