Skip to content

Commit 938c2e0

Browse files
author
Olivier Poitrey
committed
Fix some indentation issues
1 parent a883c63 commit 938c2e0

File tree

6 files changed

+46
-41
lines changed

6 files changed

+46
-41
lines changed

SDWebImage/SDImageCache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ typedef NS_ENUM(NSInteger, SDImageCacheType) {
1313
/**
1414
* The image wasn't available the SDWebImage caches, but was downloaded from the web.
1515
*/
16-
SDImageCacheTypeNone,
16+
SDImageCacheTypeNone,
1717
/**
1818
* The image was obtained from the disk cache.
1919
*/
20-
SDImageCacheTypeDisk,
20+
SDImageCacheTypeDisk,
2121
/**
2222
* The image was obtained from the memory cache.
2323
*/
24-
SDImageCacheTypeMemory
24+
SDImageCacheTypeMemory
2525
};
2626

2727
typedef void(^SDWebImageQueryCompletedBlock)(UIImage *image, SDImageCacheType cacheType);

SDWebImage/SDWebImageCompat.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@
5454
extern UIImage *SDScaledImageForKey(NSString *key, UIImage *image);
5555

5656
#define dispatch_main_sync_safe(block)\
57-
if ([NSThread isMainThread])\
58-
{\
57+
if ([NSThread isMainThread]) {\
5958
block();\
6059
}\
61-
else\
62-
{\
60+
else {\
6361
dispatch_sync(dispatch_get_main_queue(), block);\
6462
}

SDWebImage/SDWebImageDownloader.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,48 +13,56 @@
1313
typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) {
1414
SDWebImageDownloaderLowPriority = 1 << 0,
1515
SDWebImageDownloaderProgressiveDownload = 1 << 1,
16+
1617
/**
1718
* By default, request prevent the of NSURLCache. With this flag, NSURLCache
1819
* is used with default policies.
1920
*/
20-
SDWebImageDownloaderUseNSURLCache = 1 << 2,
21+
SDWebImageDownloaderUseNSURLCache = 1 << 2,
22+
2123
/**
2224
* Call completion block with nil image/imageData if the image was read from NSURLCache
2325
* (to be combined with `SDWebImageDownloaderUseNSURLCache`).
2426
*/
25-
SDWebImageDownloaderIgnoreCachedResponse = 1 << 3,
27+
28+
SDWebImageDownloaderIgnoreCachedResponse = 1 << 3,
2629
/**
2730
* In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for
2831
* extra time in background to let the request finish. If the background task expires the operation will be cancelled.
2932
*/
30-
SDWebImageDownloaderContinueInBackground = 1 << 4,
33+
34+
SDWebImageDownloaderContinueInBackground = 1 << 4,
35+
3136
/**
3237
* Handles cookies stored in NSHTTPCookieStore by setting
3338
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
3439
*/
35-
SDWebImageDownloaderHandleCookies = 1 << 5,
40+
SDWebImageDownloaderHandleCookies = 1 << 5,
41+
3642
/**
3743
* Enable to allow untrusted SSL ceriticates.
3844
* Useful for testing purposes. Use with caution in production.
3945
*/
40-
SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6,
46+
SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6,
47+
4148
/**
42-
*
49+
* Put the image in the high priority queue.
4350
*/
44-
SDWebImageDownloaderHighPriority = 1 << 7,
51+
SDWebImageDownloaderHighPriority = 1 << 7,
4552

4653

4754
};
4855

4956
typedef NS_ENUM(NSInteger, SDWebImageDownloaderExecutionOrder) {
50-
SDWebImageDownloaderFIFOExecutionOrder,
5157
/**
5258
* Default value. All download operations will execute in queue style (first-in-first-out).
5359
*/
54-
SDWebImageDownloaderLIFOExecutionOrder
60+
SDWebImageDownloaderFIFOExecutionOrder,
61+
5562
/**
5663
* All download operations will execute in stack style (last-in-first-out).
5764
*/
65+
SDWebImageDownloaderLIFOExecutionOrder
5866
};
5967

6068
extern NSString *const SDWebImageDownloadStartNotification;

SDWebImage/SDWebImageManager.h

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
1616
* By default, when a URL fail to be downloaded, the URL is blacklisted so the library won't keep trying.
1717
* This flag disable this blacklisting.
1818
*/
19-
SDWebImageRetryFailed = 1 << 0,
19+
SDWebImageRetryFailed = 1 << 0,
20+
2021
/**
2122
* By default, image downloads are started during UI interactions, this flags disable this feature,
2223
* leading to delayed download on UIScrollView deceleration for instance.
2324
*/
24-
SDWebImageLowPriority = 1 << 1,
25+
SDWebImageLowPriority = 1 << 1,
26+
2527
/**
2628
* This flag disables on-disk caching
2729
*/
28-
SDWebImageCacheMemoryOnly = 1 << 2,
30+
SDWebImageCacheMemoryOnly = 1 << 2,
31+
2932
/**
3033
* This flag enables progressive download, the image is displayed progressively during download as a browser would do.
3134
* By default, the image is only displayed once completely downloaded.
3235
*/
33-
SDWebImageProgressiveDownload = 1 << 3,
36+
SDWebImageProgressiveDownload = 1 << 3,
37+
3438
/**
3539
* Even if the image is cached, respect the HTTP response cache control, and refresh the image from remote location if needed.
3640
* The disk caching will be handled by NSURLCache instead of SDWebImage leading to slight performance degradation.
@@ -39,29 +43,32 @@ typedef NS_OPTIONS(NSUInteger, SDWebImageOptions) {
3943
*
4044
* Use this flag only if you can't make your URLs static with embeded cache busting parameter.
4145
*/
42-
SDWebImageRefreshCached = 1 << 4,
46+
SDWebImageRefreshCached = 1 << 4,
4347

4448
/**
4549
* In iOS 4+, continue the download of the image if the app goes to background. This is achieved by asking the system for
4650
* extra time in background to let the request finish. If the background task expires the operation will be cancelled.
4751
*/
48-
SDWebImageContinueInBackground = 1 << 5,
52+
SDWebImageContinueInBackground = 1 << 5,
53+
4954
/**
5055
* Handles cookies stored in NSHTTPCookieStore by setting
5156
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
5257
*/
53-
SDWebImageHandleCookies = 1 << 6,
58+
SDWebImageHandleCookies = 1 << 6,
59+
5460
/**
5561
* Enable to allow untrusted SSL ceriticates.
5662
* Useful for testing purposes. Use with caution in production.
5763
*/
58-
SDWebImageAllowInvalidSSLCertificates = 1 << 7,
64+
SDWebImageAllowInvalidSSLCertificates = 1 << 7,
65+
5966
/**
6067
* By default, image are loaded in the order they were queued. This flag move them to
6168
* the front of the queue and is loaded immediately instead of waiting for the current queue to be loaded (which
6269
* could take a while).
6370
*/
64-
SDWebImageHighPriority = 1 << 8
71+
SDWebImageHighPriority = 1 << 8
6572
};
6673

6774
typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType);
@@ -113,10 +120,8 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
113120
[manager downloadWithURL:imageURL
114121
options:0
115122
progress:nil
116-
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished)
117-
{
118-
if (image)
119-
{
123+
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) {
124+
if (image) {
120125
// do something with image
121126
}
122127
}];
@@ -139,8 +144,7 @@ SDWebImageManager *manager = [SDWebImageManager sharedManager];
139144
*
140145
* @code
141146
142-
[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url)
143-
{
147+
[[SDWebImageManager sharedManager] setCacheKeyFilter:^(NSURL *url) {
144148
url = [[NSURL alloc] initWithScheme:url.scheme host:url.host path:url.path];
145149
return [url absoluteString];
146150
}];

SDWebImage/UIImage+WebP.m

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,23 @@ static void FreeImageData(void *info, const void *data, size_t size)
1818

1919
@implementation UIImage (WebP)
2020

21-
+ (UIImage *)sd_imageWithWebPData:(NSData *)data
22-
{
21+
+ (UIImage *)sd_imageWithWebPData:(NSData *)data {
2322
WebPDecoderConfig config;
24-
if (!WebPInitDecoderConfig(&config))
25-
{
23+
if (!WebPInitDecoderConfig(&config)) {
2624
return nil;
2725
}
2826

2927
config.output.colorspace = MODE_rgbA;
3028
config.options.use_threads = 1;
3129

3230
// Decode the WebP image data into a RGBA value array.
33-
if (WebPDecode(data.bytes, data.length, &config) != VP8_STATUS_OK)
34-
{
31+
if (WebPDecode(data.bytes, data.length, &config) != VP8_STATUS_OK) {
3532
return nil;
3633
}
3734

3835
int width = config.input.width;
3936
int height = config.input.height;
40-
if (config.options.use_scaling)
41-
{
37+
if (config.options.use_scaling) {
4238
width = config.options.scaled_width;
4339
height = config.options.scaled_height;
4440
}

SDWebImage/UIImageView+WebCache.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
2727
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
2828
29-
if (cell == nil)
30-
{
29+
if (cell == nil) {
3130
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier]
3231
autorelease];
3332
}

0 commit comments

Comments
 (0)