Merge pull request #1879 from hbhpeng/master

on a 32bit machine,long long type transfer to NSInteger may become ne…
This commit is contained in:
Bogdan Poplauschi 2017-05-03 11:21:03 +03:00 committed by GitHub
commit 041842bf08
1 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,8 @@ didReceiveResponse:(NSURLResponse *)response
//'304 Not Modified' is an exceptional one //'304 Not Modified' is an exceptional one
if (![response respondsToSelector:@selector(statusCode)] || (((NSHTTPURLResponse *)response).statusCode < 400 && ((NSHTTPURLResponse *)response).statusCode != 304)) { if (![response respondsToSelector:@selector(statusCode)] || (((NSHTTPURLResponse *)response).statusCode < 400 && ((NSHTTPURLResponse *)response).statusCode != 304)) {
NSInteger expected = response.expectedContentLength > 0 ? (NSInteger)response.expectedContentLength : 0; NSInteger expected = (NSInteger)response.expectedContentLength;
expected = expected > 0 ? expected : 0;
self.expectedSize = expected; self.expectedSize = expected;
for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) { for (SDWebImageDownloaderProgressBlock progressBlock in [self callbacksForKey:kProgressCallbackKey]) {
progressBlock(0, expected, self.request.URL); progressBlock(0, expected, self.request.URL);