Skip to content

Commit 5ec794d

Browse files
committed
Indenting macro conditionals
1 parent d5bd23c commit 5ec794d

8 files changed

+97
-107
lines changed

AFNetworking/AFHTTPClient.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ typedef enum {
8181
AFNetworkReachabilityStatusReachableViaWiFi = 2,
8282
} AFNetworkReachabilityStatus;
8383
#else
84-
#warning SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available.
84+
#warning SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available.
8585
#endif
8686

8787
#ifndef __UTTYPE__
88-
#if __IPHONE_OS_VERSION_MIN_REQUIRED
89-
#warning MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available.
90-
#else
91-
#warning CoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available.
92-
#endif
88+
#if __IPHONE_OS_VERSION_MIN_REQUIRED
89+
#warning MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available.
90+
#else
91+
#warning CoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available.
92+
#endif
9393
#endif
9494

9595
typedef enum {

AFNetworking/AFHTTPClient.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
#import <Availability.h>
2929

3030
#ifdef _SYSTEMCONFIGURATION_H
31-
#import <netinet/in.h>
32-
#import <netinet6/in6.h>
33-
#import <arpa/inet.h>
34-
#import <ifaddrs.h>
35-
#import <netdb.h>
31+
#import <netinet/in.h>
32+
#import <netinet6/in6.h>
33+
#import <arpa/inet.h>
34+
#import <ifaddrs.h>
35+
#import <netdb.h>
3636
#endif
3737

3838
#if __IPHONE_OS_VERSION_MIN_REQUIRED
39-
#import <UIKit/UIKit.h>
39+
#import <UIKit/UIKit.h>
4040
#endif
4141

4242
#ifdef _SYSTEMCONFIGURATION_H

AFNetworking/AFHTTPRequestOperation.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
// Workaround for change in imp_implementationWithBlock() with Xcode 4.5
2727
#if defined(__IPHONE_6_0) || defined(__MAC_10_8)
28-
#define AF_CAST_TO_BLOCK id
28+
#define AF_CAST_TO_BLOCK id
2929
#else
30-
#define AF_CAST_TO_BLOCK __bridge void *
30+
#define AF_CAST_TO_BLOCK __bridge void *
3131
#endif
3232

3333
NSSet * AFContentTypesFromHTTPHeader(NSString *string) {

AFNetworking/AFImageRequestOperation.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#import <Availability.h>
2727

2828
#if __IPHONE_OS_VERSION_MIN_REQUIRED
29-
#import <UIKit/UIKit.h>
29+
#import <UIKit/UIKit.h>
3030
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
31-
#import <Cocoa/Cocoa.h>
31+
#import <Cocoa/Cocoa.h>
3232
#endif
3333

3434
/**

AFNetworking/AFNetworking.h

+12-13
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,20 @@
2424
#import <Availability.h>
2525

2626
#ifndef _AFNETWORKING_
27-
#define _AFNETWORKING_
27+
#define _AFNETWORKING_
2828

29-
#import "AFURLConnectionOperation.h"
29+
#import "AFURLConnectionOperation.h"
3030

31-
#import "AFHTTPRequestOperation.h"
32-
#import "AFJSONRequestOperation.h"
33-
#import "AFXMLRequestOperation.h"
34-
#import "AFPropertyListRequestOperation.h"
35-
#import "AFHTTPClient.h"
31+
#import "AFHTTPRequestOperation.h"
32+
#import "AFJSONRequestOperation.h"
33+
#import "AFXMLRequestOperation.h"
34+
#import "AFPropertyListRequestOperation.h"
35+
#import "AFHTTPClient.h"
3636

37-
#import "AFImageRequestOperation.h"
38-
39-
#if __IPHONE_OS_VERSION_MIN_REQUIRED
40-
#import "AFNetworkActivityIndicatorManager.h"
41-
#import "UIImageView+AFNetworking.h"
42-
#endif
37+
#import "AFImageRequestOperation.h"
4338

39+
#if __IPHONE_OS_VERSION_MIN_REQUIRED
40+
#import "AFNetworkActivityIndicatorManager.h"
41+
#import "UIImageView+AFNetworking.h"
42+
#endif
4443
#endif /* _AFNETWORKING_ */

AFNetworking/AFURLConnectionOperation.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
// THE SOFTWARE.
2222

2323
#import "AFURLConnectionOperation.h"
24+
2425
#if __IPHONE_OS_VERSION_MIN_REQUIRED
25-
#import <UIKit/UIKit.h>
26+
#import <UIKit/UIKit.h>
2627
#endif
2728

2829
#if !__has_feature(objc_arc)

Example/AppDelegate.h

+11-17
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,22 @@
2323
#import <Availability.h>
2424

2525
#if __IPHONE_OS_VERSION_MIN_REQUIRED
26+
#import <UIKit/UIKit.h>
2627

27-
#import <UIKit/UIKit.h>
28+
@interface AppDelegate : NSObject <UIApplicationDelegate>
2829

29-
@interface AppDelegate : NSObject <UIApplicationDelegate> {
30-
31-
}
32-
33-
@property (nonatomic, strong) UIWindow *window;
34-
@property (nonatomic, strong) UINavigationController *navigationController;
35-
36-
@end
30+
@property (nonatomic, strong) UIWindow *window;
31+
@property (nonatomic, strong) UINavigationController *navigationController;
3732

33+
@end
3834
#else
35+
#import <Cocoa/Cocoa.h>
3936

40-
#import <Cocoa/Cocoa.h>
41-
42-
@interface AppDelegate : NSObject <NSApplicationDelegate>
43-
44-
@property (strong) IBOutlet NSWindow *window;
45-
@property (strong) IBOutlet NSTableView *tableView;
46-
@property (strong) IBOutlet NSArrayController *postsArrayController;
37+
@interface AppDelegate : NSObject <NSApplicationDelegate>
4738

48-
@end
39+
@property (strong) IBOutlet NSWindow *window;
40+
@property (strong) IBOutlet NSTableView *tableView;
41+
@property (strong) IBOutlet NSArrayController *postsArrayController;
4942

43+
@end
5044
#endif

Example/AppDelegate.m

+56-60
Original file line numberDiff line numberDiff line change
@@ -23,75 +23,71 @@
2323
#import "AppDelegate.h"
2424

2525
#if __IPHONE_OS_VERSION_MIN_REQUIRED
26+
#import "GlobalTimelineViewController.h"
2627

27-
#import "GlobalTimelineViewController.h"
28+
#import "AFNetworkActivityIndicatorManager.h"
2829

29-
#import "AFNetworkActivityIndicatorManager.h"
30+
@implementation AppDelegate
31+
@synthesize window = _window;
32+
@synthesize navigationController = _navigationController;
3033

31-
@implementation AppDelegate
32-
@synthesize window = _window;
33-
@synthesize navigationController = _navigationController;
34-
35-
- (BOOL)application:(UIApplication *)application
36-
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
37-
{
38-
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
39-
[NSURLCache setSharedURLCache:URLCache];
34+
- (BOOL)application:(UIApplication *)application
35+
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
36+
{
37+
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
38+
[NSURLCache setSharedURLCache:URLCache];
39+
40+
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
4041

41-
[[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
42-
43-
UITableViewController *viewController = [[GlobalTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
44-
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
45-
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
46-
47-
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
48-
self.window.backgroundColor = [UIColor whiteColor];
49-
self.window.rootViewController = self.navigationController;
50-
[self.window makeKeyAndVisible];
51-
52-
return YES;
53-
}
54-
55-
@end
42+
UITableViewController *viewController = [[GlobalTimelineViewController alloc] initWithStyle:UITableViewStylePlain];
43+
self.navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
44+
self.navigationController.navigationBar.tintColor = [UIColor darkGrayColor];
45+
46+
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
47+
self.window.backgroundColor = [UIColor whiteColor];
48+
self.window.rootViewController = self.navigationController;
49+
[self.window makeKeyAndVisible];
50+
51+
return YES;
52+
}
5653

54+
@end
5755
#else
56+
#import "Post.h"
57+
#import "User.h"
5858

59-
#import "Post.h"
60-
#import "User.h"
61-
62-
@implementation AppDelegate
59+
@implementation AppDelegate
6360

64-
@synthesize window = _window;
65-
@synthesize tableView = _tableView;
66-
@synthesize postsArrayController = _postsArrayController;
61+
@synthesize window = _window;
62+
@synthesize tableView = _tableView;
63+
@synthesize postsArrayController = _postsArrayController;
6764

68-
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
69-
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
70-
[NSURLCache setSharedURLCache:URLCache];
71-
72-
[self.window makeKeyAndOrderFront:self];
73-
74-
[Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) {
75-
if (error) {
76-
[[NSAlert alertWithMessageText:NSLocalizedString(@"Error", nil) defaultButton:NSLocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@",[error localizedDescription]] runModal];
77-
}
65+
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
66+
NSURLCache *URLCache = [[NSURLCache alloc] initWithMemoryCapacity:4 * 1024 * 1024 diskCapacity:20 * 1024 * 1024 diskPath:nil];
67+
[NSURLCache setSharedURLCache:URLCache];
7868

79-
self.postsArrayController.content = posts;
80-
}];
81-
82-
[[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
83-
[self.tableView reloadData];
84-
}];
85-
}
86-
87-
- (BOOL)applicationShouldHandleReopen:(NSApplication *)application
88-
hasVisibleWindows:(BOOL)flag
89-
{
90-
[self.window makeKeyAndOrderFront:self];
91-
92-
return YES;
93-
}
69+
[self.window makeKeyAndOrderFront:self];
70+
71+
[Post globalTimelinePostsWithBlock:^(NSArray *posts, NSError *error) {
72+
if (error) {
73+
[[NSAlert alertWithMessageText:NSLocalizedString(@"Error", nil) defaultButton:NSLocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@",[error localizedDescription]] runModal];
74+
}
75+
76+
self.postsArrayController.content = posts;
77+
}];
78+
79+
[[NSNotificationCenter defaultCenter] addObserverForName:kUserProfileImageDidLoadNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
80+
[self.tableView reloadData];
81+
}];
82+
}
9483

95-
@end
84+
- (BOOL)applicationShouldHandleReopen:(NSApplication *)application
85+
hasVisibleWindows:(BOOL)flag
86+
{
87+
[self.window makeKeyAndOrderFront:self];
88+
89+
return YES;
90+
}
9691

97-
#endif
92+
@end
93+
#endif

0 commit comments

Comments
 (0)