|
@@ -88,6 +88,12 @@ static inline NSString * AFKeyPathFromOperationState(AFOperationState state) {
|
|
|
return @"isFinished";
|
|
|
case AFOperationPausedState:
|
|
|
return @"isPaused";
|
|
|
+ default: {
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wunreachable-code"
|
|
|
+ return @"state";
|
|
|
+#pragma clang diagnostic pop
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -115,7 +121,9 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
|
|
return NO;
|
|
|
case AFOperationPausedState:
|
|
|
return toState == AFOperationReadyState;
|
|
|
- default:
|
|
|
+ default: {
|
|
|
+#pragma clang diagnostic push
|
|
|
+#pragma clang diagnostic ignored "-Wunreachable-code"
|
|
|
switch (toState) {
|
|
|
case AFOperationPausedState:
|
|
|
case AFOperationReadyState:
|
|
@@ -125,6 +133,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
|
|
default:
|
|
|
return NO;
|
|
|
}
|
|
|
+ }
|
|
|
+#pragma clang diagnostic pop
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -182,7 +192,9 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
|
|
if (!self) {
|
|
|
return nil;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ _state = AFOperationReadyState;
|
|
|
+
|
|
|
self.lock = [[NSRecursiveLock alloc] init];
|
|
|
self.lock.name = kAFNetworkingLockName;
|
|
|
|
|
@@ -192,8 +204,6 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
|
|
|
|
|
self.shouldUseCredentialStorage = YES;
|
|
|
|
|
|
- _state = AFOperationReadyState;
|
|
|
-
|
|
|
self.securityPolicy = [AFSecurityPolicy defaultPolicy];
|
|
|
|
|
|
return self;
|