Merge pull request #542 from aburgel/2.0-64bit

Fix various 64bit issues on 2.0-compat branch
This commit is contained in:
Olivier Poitrey 2013-10-31 15:34:52 -07:00
commit 706d5d139d
2 changed files with 15 additions and 15 deletions

View File

@ -185,7 +185,7 @@ static SDWebImageManager *instance;
{ {
// Delegates notified, remove downloader and delegate // Delegates notified, remove downloader and delegate
// The delegate callbacks above may have modified the arrays, hence we search for the correct index // The delegate callbacks above may have modified the arrays, hence we search for the correct index
int idx = [downloadDelegates indexOfObjectIdenticalTo:delegate]; NSUInteger idx = [downloadDelegates indexOfObjectIdenticalTo:delegate];
if (idx != NSNotFound) if (idx != NSNotFound)
{ {
[downloaders removeObjectAtIndex:idx]; [downloaders removeObjectAtIndex:idx];
@ -271,7 +271,7 @@ static SDWebImageManager *instance;
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:)])
{ {
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, url); ((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, url);
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:userInfo:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:userInfo:)])
{ {
@ -280,7 +280,7 @@ static SDWebImageManager *instance;
{ {
userInfo = nil; userInfo = nil;
} }
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, url, userInfo); ((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, url, userInfo);
} }
#if NS_BLOCKS_AVAILABLE #if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"success"]) if ([info objectForKey:@"success"])
@ -292,7 +292,7 @@ static SDWebImageManager *instance;
// Delegates notified, remove url and delegate // Delegates notified, remove url and delegate
// The delegate callbacks above may have modified the arrays, hence we search for the correct index // The delegate callbacks above may have modified the arrays, hence we search for the correct index
int removeIdx = [self indexOfDelegate:delegate waitingForURL:url]; NSUInteger removeIdx = [self indexOfDelegate:delegate waitingForURL:url];
if (removeIdx != NSNotFound) if (removeIdx != NSNotFound)
{ {
[cacheDelegates removeObjectAtIndex:removeIdx]; [cacheDelegates removeObjectAtIndex:removeIdx];
@ -379,7 +379,7 @@ static SDWebImageManager *instance;
if ([delegate respondsToSelector:@selector(webImageManager:didProgressWithPartialImage:forURL:)]) if ([delegate respondsToSelector:@selector(webImageManager:didProgressWithPartialImage:forURL:)])
{ {
objc_msgSend(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:), self, image, downloader.url); ((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:), self, image, downloader.url);
} }
if ([delegate respondsToSelector:@selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:)]) if ([delegate respondsToSelector:@selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:)])
{ {
@ -388,7 +388,7 @@ static SDWebImageManager *instance;
{ {
userInfo = nil; userInfo = nil;
} }
objc_msgSend(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:), self, image, downloader.url, userInfo); ((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didProgressWithPartialImage:forURL:userInfo:), self, image, downloader.url, userInfo);
} }
// Delegate notified. Break out and restart loop // Delegate notified. Break out and restart loop
found = YES; found = YES;
@ -430,7 +430,7 @@ static SDWebImageManager *instance;
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:)])
{ {
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, downloader.url); ((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:), self, image, downloader.url);
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:userInfo:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFinishWithImage:forURL:userInfo:)])
{ {
@ -439,7 +439,7 @@ static SDWebImageManager *instance;
{ {
userInfo = nil; userInfo = nil;
} }
objc_msgSend(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, downloader.url, userInfo); ((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFinishWithImage:forURL:userInfo:), self, image, downloader.url, userInfo);
} }
#if NS_BLOCKS_AVAILABLE #if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"success"]) if ([info objectForKey:@"success"])
@ -457,7 +457,7 @@ static SDWebImageManager *instance;
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:)])
{ {
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:), self, nil, downloader.url); ((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:), self, nil, downloader.url);
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:userInfo:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:userInfo:)])
{ {
@ -466,7 +466,7 @@ static SDWebImageManager *instance;
{ {
userInfo = nil; userInfo = nil;
} }
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, nil, downloader.url, userInfo); ((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, nil, downloader.url, userInfo);
} }
#if NS_BLOCKS_AVAILABLE #if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"failure"]) if ([info objectForKey:@"failure"])
@ -536,7 +536,7 @@ static SDWebImageManager *instance;
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:)])
{ {
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:), self, error, downloader.url); ((void ( *)(id, SEL, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:), self, error, downloader.url);
} }
if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:userInfo:)]) if ([delegate respondsToSelector:@selector(webImageManager:didFailWithError:forURL:userInfo:)])
{ {
@ -545,7 +545,7 @@ static SDWebImageManager *instance;
{ {
userInfo = nil; userInfo = nil;
} }
objc_msgSend(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, error, downloader.url, userInfo); ((void ( *)(id, SEL, id, id, id, id))objc_msgSend)(delegate, @selector(webImageManager:didFailWithError:forURL:userInfo:), self, error, downloader.url, userInfo);
} }
#if NS_BLOCKS_AVAILABLE #if NS_BLOCKS_AVAILABLE
if ([info objectForKey:@"failure"]) if ([info objectForKey:@"failure"])

View File

@ -43,7 +43,7 @@ static SDWebImagePrefetcher *instance;
- (void)reportStatus - (void)reportStatus
{ {
NSUInteger total = [self.prefetchURLs count]; NSUInteger total = [self.prefetchURLs count];
NSLog(@"Finished prefetching (%d successful, %d skipped, timeElasped %.2f)", total - _skippedCount, _skippedCount, CFAbsoluteTimeGetCurrent() - _startedTime); NSLog(@"Finished prefetching (%lu successful, %lu skipped, timeElasped %.2f)", (unsigned long)(total - _skippedCount), (unsigned long)_skippedCount, CFAbsoluteTimeGetCurrent() - _startedTime);
} }
- (void)prefetchURLs:(NSArray *)urls - (void)prefetchURLs:(NSArray *)urls
@ -75,7 +75,7 @@ static SDWebImagePrefetcher *instance;
- (void)webImageManager:(SDWebImageManager *)imageManager didFinishWithImage:(UIImage *)image - (void)webImageManager:(SDWebImageManager *)imageManager didFinishWithImage:(UIImage *)image
{ {
_finishedCount++; _finishedCount++;
NSLog(@"Prefetched %d out of %d", _finishedCount, [self.prefetchURLs count]); NSLog(@"Prefetched %lu out of %lu", (unsigned long)_finishedCount, (unsigned long)[self.prefetchURLs count]);
if ([self.prefetchURLs count] > _requestedCount) if ([self.prefetchURLs count] > _requestedCount)
{ {
@ -90,7 +90,7 @@ static SDWebImagePrefetcher *instance;
- (void)webImageManager:(SDWebImageManager *)imageManager didFailWithError:(NSError *)error - (void)webImageManager:(SDWebImageManager *)imageManager didFailWithError:(NSError *)error
{ {
_finishedCount++; _finishedCount++;
NSLog(@"Prefetched %d out of %d (Failed)", _finishedCount, [self.prefetchURLs count]); NSLog(@"Prefetched %lu out of %lu (Failed)", (unsigned long)_finishedCount, (unsigned long)[self.prefetchURLs count]);
// Add last failed // Add last failed
_skippedCount++; _skippedCount++;