@@ -255,13 +255,16 @@ - (id)initWithBaseURL:(NSURL *)url {
255
255
*stop = q <= 0 .5f ;
256
256
}];
257
257
[self setDefaultHeader: @" Accept-Language" value: [acceptLanguagesComponents componentsJoinedByString: @" , " ]];
258
-
258
+
259
+ #pragma clang diagnostic push
260
+ #pragma clang diagnostic ignored "-Wgnu"
259
261
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
260
262
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
261
263
[self setDefaultHeader: @" User-Agent" value: [NSString stringWithFormat: @" %@ /%@ (%@ ; iOS %@ ; Scale/%0.2f )" , [[[NSBundle mainBundle ] infoDictionary ] objectForKey: (__bridge NSString *)kCFBundleExecutableKey ] ?: [[[NSBundle mainBundle ] infoDictionary ] objectForKey: (__bridge NSString *)kCFBundleIdentifierKey ], (__bridge id )CFBundleGetValueForInfoDictionaryKey (CFBundleGetMainBundle (), kCFBundleVersionKey ) ?: [[[NSBundle mainBundle ] infoDictionary ] objectForKey: (__bridge NSString *)kCFBundleVersionKey ], [[UIDevice currentDevice ] model ], [[UIDevice currentDevice ] systemVersion ], ([[UIScreen mainScreen ] respondsToSelector: @selector (scale )] ? [[UIScreen mainScreen ] scale ] : 1 .0f )]];
262
264
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
263
265
[self setDefaultHeader: @" User-Agent" value: [NSString stringWithFormat: @" %@ /%@ (Mac OS X %@ )" , [[[NSBundle mainBundle ] infoDictionary ] objectForKey: (__bridge NSString *)kCFBundleExecutableKey ] ?: [[[NSBundle mainBundle ] infoDictionary ] objectForKey: (__bridge NSString *)kCFBundleIdentifierKey ], [[[NSBundle mainBundle ] infoDictionary ] objectForKey: @" CFBundleShortVersionString" ] ?: [[[NSBundle mainBundle ] infoDictionary ] objectForKey: (__bridge NSString *)kCFBundleVersionKey ], [[NSProcessInfo processInfo ] operatingSystemVersionString ]]];
264
266
#endif
267
+ #pragma clang diagnostic pop
265
268
266
269
#ifdef _SYSTEMCONFIGURATION_H
267
270
self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
@@ -474,7 +477,10 @@ - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
474
477
break ;
475
478
case AFJSONParameterEncoding:;
476
479
[request setValue: [NSString stringWithFormat: @" application/json; charset=%@ " , charset] forHTTPHeaderField: @" Content-Type" ];
480
+ #pragma clang diagnostic push
481
+ #pragma clang diagnostic ignored "-Wassign-enum"
477
482
[request setHTTPBody: [NSJSONSerialization dataWithJSONObject: parameters options: 0 error: &error]];
483
+ #pragma clang diagnostic pop
478
484
break ;
479
485
case AFPropertyListParameterEncoding:;
480
486
[request setValue: [NSString stringWithFormat: @" application/x-plist; charset=%@ " , charset] forHTTPHeaderField: @" Content-Type" ];
@@ -565,7 +571,10 @@ - (void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation {
565
571
- (void )cancelAllHTTPOperationsWithMethod : (NSString *)method
566
572
path : (NSString *)path
567
573
{
574
+ #pragma clang diagnostic push
575
+ #pragma clang diagnostic ignored "-Wgnu"
568
576
NSString *pathToBeMatched = [[[self requestWithMethod: (method ?: @" GET" ) path: path parameters: nil ] URL ] path ];
577
+ #pragma clang diagnostic pop
569
578
570
579
for (NSOperation *operation in [self .operationQueue operations ]) {
571
580
if (![operation isKindOfClass: [AFHTTPRequestOperation class ]]) {
@@ -615,7 +624,10 @@ - (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations
615
624
__weak __typeof (&*operation)weakOperation = operation;
616
625
operation.completionBlock = ^{
617
626
__strong __typeof (&*weakOperation)strongOperation = weakOperation;
627
+ #pragma clang diagnostic push
628
+ #pragma clang diagnostic ignored "-Wgnu"
618
629
dispatch_queue_t queue = strongOperation.successCallbackQueue ?: dispatch_get_main_queue ();
630
+ #pragma clang diagnostic pop
619
631
dispatch_group_async (dispatchGroup, queue, ^{
620
632
if (originalCompletionBlock) {
621
633
originalCompletionBlock ();
@@ -1329,8 +1341,11 @@ - (NSInteger)readData:(NSData *)data
1329
1341
intoBuffer : (uint8_t *)buffer
1330
1342
maxLength : (NSUInteger )length
1331
1343
{
1344
+ #pragma clang diagnostic push
1345
+ #pragma clang diagnostic ignored "-Wgnu"
1332
1346
NSRange range = NSMakeRange ((NSUInteger )_phaseReadOffset, MIN ([data length ] - ((NSUInteger )_phaseReadOffset), length));
1333
1347
[data getBytes: buffer range: range];
1348
+ #pragma clang diagnostic pop
1334
1349
1335
1350
_phaseReadOffset += range.length ;
1336
1351
0 commit comments