Permalink
Browse files

changed sizes to NSUInteger

  • Loading branch information...
1 parent 2184274 commit 77fad5cdf1ab531b9aa58f3808e0b426675fa5fa @akhenakh akhenakh committed Jan 4, 2014
Showing with 8 additions and 8 deletions.
  1. +2 −2 SDWebImage/SDImageCache.h
  2. +6 −6 SDWebImage/SDImageCache.m
View
4 SDWebImage/SDImageCache.h
@@ -45,7 +45,7 @@ typedef enum SDImageCacheType SDImageCacheType;
/**
* The maximum size of the cache, in bytes.
*/
-@property (assign, nonatomic) unsigned long long maxCacheSize;
+@property (assign, nonatomic) NSUInteger maxCacheSize;
/**
* Returns global shared cache instance
@@ -153,7 +153,7 @@ typedef enum SDImageCacheType SDImageCacheType;
/**
* Get the size used by the disk cache
*/
-- (unsigned long long)getSize;
+- (NSUInteger)getSize;
/**
* Get the number of images in the disk cache
View
12 SDWebImage/SDImageCache.m
@@ -423,7 +423,7 @@ - (void)cleanDisk
NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-self.maxCacheAge];
NSMutableDictionary *cacheFiles = [NSMutableDictionary dictionary];
- unsigned long long currentCacheSize = 0;
+ NSUInteger currentCacheSize = 0;
// Enumerate all of the files in the cache directory. This loop has two purposes:
//
@@ -449,7 +449,7 @@ - (void)cleanDisk
// Store a reference to this file and account for its total size.
NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey];
- currentCacheSize += [totalAllocatedSize unsignedLongLongValue];
+ currentCacheSize += [totalAllocatedSize unsignedIntegerValue];
[cacheFiles setObject:resourceValues forKey:fileURL];
}
@@ -458,7 +458,7 @@ - (void)cleanDisk
if (self.maxCacheSize > 0 && currentCacheSize > self.maxCacheSize)
{
// Target half of our maximum cache size for this cleanup pass.
- const unsigned long long desiredCacheSize = self.maxCacheSize / 2;
+ const NSUInteger desiredCacheSize = self.maxCacheSize / 2;
// Sort the remaining cache files by their last modification time (oldest first).
NSArray *sortedFiles = [cacheFiles keysSortedByValueWithOptions:NSSortConcurrent
@@ -474,7 +474,7 @@ - (void)cleanDisk
{
NSDictionary *resourceValues = cacheFiles[fileURL];
NSNumber *totalAllocatedSize = resourceValues[NSURLTotalFileAllocatedSizeKey];
- currentCacheSize -= [totalAllocatedSize unsignedLongLongValue];
+ currentCacheSize -= [totalAllocatedSize unsignedIntegerValue];
if (currentCacheSize < desiredCacheSize)
{
@@ -508,9 +508,9 @@ - (void)backgroundCleanDisk
});
}
-- (unsigned long long)getSize
+- (NSUInteger)getSize
{
- unsigned long long size = 0;
+ NSUInteger size = 0;
NSDirectoryEnumerator *fileEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:self.diskCachePath];
for (NSString *fileName in fileEnumerator)
{

0 comments on commit 77fad5c

Please sign in to comment.