Suppressed GNU expression and Enum assignment warnings from clang
This commit is contained in:
parent
215a32e23c
commit
cbfe5b72c6
7 changed files with 29 additions and 2 deletions
|
|
@ -248,12 +248,15 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
|
||||||
}];
|
}];
|
||||||
[self setDefaultHeader:@"Accept-Language" value:[acceptLanguagesComponents componentsJoinedByString:@", "]];
|
[self setDefaultHeader:@"Accept-Language" value:[acceptLanguagesComponents componentsJoinedByString:@", "]];
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
|
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
|
||||||
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
|
// 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)]];
|
[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)
|
#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]]];
|
[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
|
#endif
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
#ifdef _SYSTEMCONFIGURATION_H
|
#ifdef _SYSTEMCONFIGURATION_H
|
||||||
self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
|
self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
|
||||||
|
|
@ -464,7 +467,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
break;
|
break;
|
||||||
case AFJSONParameterEncoding:;
|
case AFJSONParameterEncoding:;
|
||||||
[request setValue:[NSString stringWithFormat:@"application/json; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
|
[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]];
|
[request setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error]];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
break;
|
break;
|
||||||
case AFPropertyListParameterEncoding:;
|
case AFPropertyListParameterEncoding:;
|
||||||
[request setValue:[NSString stringWithFormat:@"application/x-plist; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
|
[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
|
- (void)cancelAllHTTPOperationsWithMethod:(NSString *)method
|
||||||
path:(NSString *)path
|
path:(NSString *)path
|
||||||
{
|
{
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
NSString *pathToBeMatched = [[[self requestWithMethod:(method ?: @"GET") path:path parameters:nil] URL] path];
|
NSString *pathToBeMatched = [[[self requestWithMethod:(method ?: @"GET") path:path parameters:nil] URL] path];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
for (NSOperation *operation in [self.operationQueue operations]) {
|
for (NSOperation *operation in [self.operationQueue operations]) {
|
||||||
if (![operation isKindOfClass:[AFHTTPRequestOperation class]]) {
|
if (![operation isKindOfClass:[AFHTTPRequestOperation class]]) {
|
||||||
|
|
@ -605,7 +614,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
__weak __typeof(&*operation)weakOperation = operation;
|
__weak __typeof(&*operation)weakOperation = operation;
|
||||||
operation.completionBlock = ^{
|
operation.completionBlock = ^{
|
||||||
__strong __typeof(&*weakOperation)strongOperation = weakOperation;
|
__strong __typeof(&*weakOperation)strongOperation = weakOperation;
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
dispatch_queue_t queue = strongOperation.successCallbackQueue ?: dispatch_get_main_queue();
|
dispatch_queue_t queue = strongOperation.successCallbackQueue ?: dispatch_get_main_queue();
|
||||||
|
#pragma clang diagnostic pop
|
||||||
dispatch_group_async(dispatchGroup, queue, ^{
|
dispatch_group_async(dispatchGroup, queue, ^{
|
||||||
if (originalCompletionBlock) {
|
if (originalCompletionBlock) {
|
||||||
originalCompletionBlock();
|
originalCompletionBlock();
|
||||||
|
|
@ -1297,8 +1309,11 @@ typedef enum {
|
||||||
intoBuffer:(uint8_t *)buffer
|
intoBuffer:(uint8_t *)buffer
|
||||||
maxLength:(NSUInteger)length
|
maxLength:(NSUInteger)length
|
||||||
{
|
{
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length));
|
NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length));
|
||||||
[data getBytes:buffer range:range];
|
[data getBytes:buffer range:range];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
|
||||||
_phaseReadOffset += range.length;
|
_phaseReadOffset += range.length;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,7 @@ static void AFSwizzleClassMethodWithClassAndSelectorUsingBlock(Class klass, SEL
|
||||||
// completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle.
|
// completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle.
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
self.completionBlock = ^{
|
self.completionBlock = ^{
|
||||||
if (self.error) {
|
if (self.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,12 @@ static dispatch_queue_t image_request_operation_processing_queue() {
|
||||||
if (imageProcessingBlock) {
|
if (imageProcessingBlock) {
|
||||||
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
||||||
UIImage *processedImage = imageProcessingBlock(image);
|
UIImage *processedImage = imageProcessingBlock(image);
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
dispatch_async(operation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) {
|
dispatch_async(operation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) {
|
||||||
success(operation.request, operation.response, processedImage);
|
success(operation.request, operation.response, processedImage);
|
||||||
});
|
});
|
||||||
|
#pragma clang diagnostic pop
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
success(operation.request, operation.response, image);
|
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 push
|
||||||
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
|
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
dispatch_async(image_request_operation_processing_queue(), ^(void) {
|
||||||
if (self.error) {
|
if (self.error) {
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,8 @@ static dispatch_queue_t json_request_operation_processing_queue() {
|
||||||
{
|
{
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
|
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if (self.error) {
|
if (self.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,10 @@ static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17;
|
||||||
- (void)decrementActivityCount {
|
- (void)decrementActivityCount {
|
||||||
[self willChangeValueForKey:@"activityCount"];
|
[self willChangeValueForKey:@"activityCount"];
|
||||||
@synchronized(self) {
|
@synchronized(self) {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
_activityCount = MAX(_activityCount - 1, 0);
|
_activityCount = MAX(_activityCount - 1, 0);
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
[self didChangeValueForKey:@"activityCount"];
|
[self didChangeValueForKey:@"activityCount"];
|
||||||
[self updateNetworkActivityIndicatorVisibilityDelayed];
|
[self updateNetworkActivityIndicatorVisibilityDelayed];
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ static dispatch_queue_t property_list_request_operation_processing_queue() {
|
||||||
{
|
{
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
if (self.error) {
|
if (self.error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,7 @@ static dispatch_queue_t xml_request_operation_processing_queue() {
|
||||||
{
|
{
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
#pragma clang diagnostic ignored "-Warc-retain-cycles"
|
||||||
|
#pragma clang diagnostic ignored "-Wgnu"
|
||||||
self.completionBlock = ^ {
|
self.completionBlock = ^ {
|
||||||
dispatch_async(xml_request_operation_processing_queue(), ^(void) {
|
dispatch_async(xml_request_operation_processing_queue(), ^(void) {
|
||||||
NSXMLParser *XMLParser = self.responseXMLParser;
|
NSXMLParser *XMLParser = self.responseXMLParser;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue