diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index e23f2a0..bee9a4c 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -247,13 +247,16 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) { *stop = q <= 0.5f; }]; [self setDefaultHeader:@"Accept-Language" value:[acceptLanguagesComponents componentsJoinedByString:@", "]]; - + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" #if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleIdentifierKey], (__bridge id)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), kCFBundleVersionKey) ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0f)]]; #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]]; #endif +#pragma clang diagnostic pop #ifdef _SYSTEMCONFIGURATION_H self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown; @@ -464,7 +467,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { break; case AFJSONParameterEncoding:; [request setValue:[NSString stringWithFormat:@"application/json; charset=%@", charset] forHTTPHeaderField:@"Content-Type"]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wassign-enum" [request setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error]]; +#pragma clang diagnostic pop break; case AFPropertyListParameterEncoding:; [request setValue:[NSString stringWithFormat:@"application/x-plist; charset=%@", charset] forHTTPHeaderField:@"Content-Type"]; @@ -555,7 +561,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { - (void)cancelAllHTTPOperationsWithMethod:(NSString *)method path:(NSString *)path { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" NSString *pathToBeMatched = [[[self requestWithMethod:(method ?: @"GET") path:path parameters:nil] URL] path]; +#pragma clang diagnostic pop for (NSOperation *operation in [self.operationQueue operations]) { if (![operation isKindOfClass:[AFHTTPRequestOperation class]]) { @@ -605,7 +614,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { __weak __typeof(&*operation)weakOperation = operation; operation.completionBlock = ^{ __strong __typeof(&*weakOperation)strongOperation = weakOperation; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" dispatch_queue_t queue = strongOperation.successCallbackQueue ?: dispatch_get_main_queue(); +#pragma clang diagnostic pop dispatch_group_async(dispatchGroup, queue, ^{ if (originalCompletionBlock) { originalCompletionBlock(); @@ -1297,8 +1309,11 @@ typedef enum { intoBuffer:(uint8_t *)buffer maxLength:(NSUInteger)length { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length)); [data getBytes:buffer range:range]; +#pragma clang diagnostic pop _phaseReadOffset += range.length; diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index 98aa07c..772489e 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -261,6 +261,7 @@ static void AFSwizzleClassMethodWithClassAndSelectorUsingBlock(Class klass, SEL // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" self.completionBlock = ^{ if (self.error) { if (failure) { diff --git a/AFNetworking/AFImageRequestOperation.m b/AFNetworking/AFImageRequestOperation.m index cfac8d9..d4119d2 100644 --- a/AFNetworking/AFImageRequestOperation.m +++ b/AFNetworking/AFImageRequestOperation.m @@ -82,10 +82,12 @@ static dispatch_queue_t image_request_operation_processing_queue() { if (imageProcessingBlock) { dispatch_async(image_request_operation_processing_queue(), ^(void) { UIImage *processedImage = imageProcessingBlock(image); - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" dispatch_async(operation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) { success(operation.request, operation.response, processedImage); }); +#pragma clang diagnostic pop }); } else { success(operation.request, operation.response, image); @@ -203,6 +205,8 @@ static dispatch_queue_t image_request_operation_processing_queue() { { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" + self.completionBlock = ^ { dispatch_async(image_request_operation_processing_queue(), ^(void) { if (self.error) { diff --git a/AFNetworking/AFJSONRequestOperation.m b/AFNetworking/AFJSONRequestOperation.m index ac7423a..0a39dee 100644 --- a/AFNetworking/AFJSONRequestOperation.m +++ b/AFNetworking/AFJSONRequestOperation.m @@ -109,6 +109,8 @@ static dispatch_queue_t json_request_operation_processing_queue() { { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" + self.completionBlock = ^ { if (self.error) { if (failure) { diff --git a/AFNetworking/AFNetworkActivityIndicatorManager.m b/AFNetworking/AFNetworkActivityIndicatorManager.m index b7e4256..810db10 100644 --- a/AFNetworking/AFNetworkActivityIndicatorManager.m +++ b/AFNetworking/AFNetworkActivityIndicatorManager.m @@ -120,7 +120,10 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17; - (void)decrementActivityCount { [self willChangeValueForKey:@"activityCount"]; @synchronized(self) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu" _activityCount = MAX(_activityCount - 1, 0); +#pragma clang diagnostic pop } [self didChangeValueForKey:@"activityCount"]; [self updateNetworkActivityIndicatorVisibilityDelayed]; diff --git a/AFNetworking/AFPropertyListRequestOperation.m b/AFNetworking/AFPropertyListRequestOperation.m index 4d6123b..370e12b 100644 --- a/AFNetworking/AFPropertyListRequestOperation.m +++ b/AFNetworking/AFPropertyListRequestOperation.m @@ -109,6 +109,7 @@ static dispatch_queue_t property_list_request_operation_processing_queue() { { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" self.completionBlock = ^ { if (self.error) { if (failure) { diff --git a/AFNetworking/AFXMLRequestOperation.m b/AFNetworking/AFXMLRequestOperation.m index 30a76b9..a97cd88 100644 --- a/AFNetworking/AFXMLRequestOperation.m +++ b/AFNetworking/AFXMLRequestOperation.m @@ -141,6 +141,7 @@ static dispatch_queue_t xml_request_operation_processing_queue() { { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-retain-cycles" +#pragma clang diagnostic ignored "-Wgnu" self.completionBlock = ^ { dispatch_async(xml_request_operation_processing_queue(), ^(void) { NSXMLParser *XMLParser = self.responseXMLParser;