Joseph Heenan

Merge pull request #342 from jweyrich/master

Fix warnings when compiling with some -W options.
@@ -28,8 +28,8 @@ typedef enum _ASIAuthenticationType { @@ -28,8 +28,8 @@ typedef enum _ASIAuthenticationType {
28 + (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request; 28 + (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request;
29 + (void)dismiss; 29 + (void)dismiss;
30 30
31 -@property (retain) ASIHTTPRequest *request; 31 +@property (atomic, retain) ASIHTTPRequest *request;
32 -@property (assign) ASIAuthenticationType type; 32 +@property (atomic, assign) ASIAuthenticationType type;
33 -@property (assign) BOOL didEnableRotationNotifications; 33 +@property (atomic, assign) BOOL didEnableRotationNotifications;
34 @property (retain, nonatomic) UIViewController *presentingController; 34 @property (retain, nonatomic) UIViewController *presentingController;
35 @end 35 @end
@@ -41,7 +41,7 @@ static const NSUInteger kDomainSection = 1; @@ -41,7 +41,7 @@ static const NSUInteger kDomainSection = 1;
41 - (void)orientationChanged:(NSNotification *)notification; 41 - (void)orientationChanged:(NSNotification *)notification;
42 - (void)cancelAuthenticationFromDialog:(id)sender; 42 - (void)cancelAuthenticationFromDialog:(id)sender;
43 - (void)loginWithCredentialsFromDialog:(id)sender; 43 - (void)loginWithCredentialsFromDialog:(id)sender;
44 -@property (retain) UITableView *tableView; 44 +@property (atomic, retain) UITableView *tableView;
45 @end 45 @end
46 46
47 @implementation ASIAuthenticationDialog 47 @implementation ASIAuthenticationDialog
@@ -193,7 +193,7 @@ static const NSUInteger kDomainSection = 1; @@ -193,7 +193,7 @@ static const NSUInteger kDomainSection = 1;
193 - (UITextField *)textFieldInRow:(NSUInteger)row section:(NSUInteger)section 193 - (UITextField *)textFieldInRow:(NSUInteger)row section:(NSUInteger)section
194 { 194 {
195 return [[[[[self tableView] cellForRowAtIndexPath: 195 return [[[[[self tableView] cellForRowAtIndexPath:
196 - [NSIndexPath indexPathForRow:row inSection:section]] 196 + [NSIndexPath indexPathForRow:(NSInteger)row inSection:(NSInteger)section]]
197 contentView] subviews] objectAtIndex:0]; 197 contentView] subviews] objectAtIndex:0];
198 } 198 }
199 199
@@ -471,8 +471,8 @@ static const NSUInteger kDomainSection = 1; @@ -471,8 +471,8 @@ static const NSUInteger kDomainSection = 1;
471 [textField setAutocapitalizationType:UITextAutocapitalizationTypeNone]; 471 [textField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
472 [textField setAutocorrectionType:UITextAutocorrectionTypeNo]; 472 [textField setAutocorrectionType:UITextAutocorrectionTypeNo];
473 473
474 - NSUInteger s = [indexPath section]; 474 + NSInteger s = [indexPath section];
475 - NSUInteger r = [indexPath row]; 475 + NSInteger r = [indexPath row];
476 476
477 if (s == kUsernameSection && r == kUsernameRow) { 477 if (s == kUsernameSection && r == kUsernameRow) {
478 [textField setPlaceholder:@"User"]; 478 [textField setPlaceholder:@"User"];
@@ -38,5 +38,5 @@ @@ -38,5 +38,5 @@
38 // If deflating finishes or fails, this method will be called automatically 38 // If deflating finishes or fails, this method will be called automatically
39 - (NSError *)closeStream; 39 - (NSError *)closeStream;
40 40
41 -@property (assign, readonly) BOOL streamReady; 41 +@property (atomic, assign, readonly) BOOL streamReady;
42 @end 42 @end
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 zStream.avail_in = (unsigned int)length; 81 zStream.avail_in = (unsigned int)length;
82 zStream.avail_out = 0; 82 zStream.avail_out = 0;
83 83
84 - NSInteger bytesProcessedAlready = zStream.total_out; 84 + NSUInteger bytesProcessedAlready = zStream.total_out;
85 while (zStream.avail_out == 0) { 85 while (zStream.avail_out == 0) {
86 86
87 if (zStream.total_out-bytesProcessedAlready >= [outputData length]) { 87 if (zStream.total_out-bytesProcessedAlready >= [outputData length]) {
@@ -174,7 +174,7 @@ @@ -174,7 +174,7 @@
174 } 174 }
175 175
176 // Attempt to deflate the chunk of data 176 // Attempt to deflate the chunk of data
177 - outputData = [compressor compressBytes:inputData length:readLength error:&theError shouldFinish:readLength < DATA_CHUNK_SIZE ]; 177 + outputData = [compressor compressBytes:inputData length:(NSUInteger)readLength error:&theError shouldFinish:readLength < DATA_CHUNK_SIZE];
178 if (theError) { 178 if (theError) {
179 if (err) { 179 if (err) {
180 *err = theError; 180 *err = theError;
@@ -37,5 +37,5 @@ @@ -37,5 +37,5 @@
37 // If inflating finishes or fails, this method will be called automatically 37 // If inflating finishes or fails, this method will be called automatically
38 - (NSError *)closeStream; 38 - (NSError *)closeStream;
39 39
40 -@property (assign, readonly) BOOL streamReady; 40 +@property (atomic, assign, readonly) BOOL streamReady;
41 @end 41 @end
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 zStream.avail_in = (unsigned int)length; 78 zStream.avail_in = (unsigned int)length;
79 zStream.avail_out = 0; 79 zStream.avail_out = 0;
80 80
81 - NSInteger bytesProcessedAlready = zStream.total_out; 81 + NSUInteger bytesProcessedAlready = zStream.total_out;
82 while (zStream.avail_in != 0) { 82 while (zStream.avail_in != 0) {
83 83
84 if (zStream.total_out-bytesProcessedAlready >= [outputData length]) { 84 if (zStream.total_out-bytesProcessedAlready >= [outputData length]) {
@@ -171,7 +171,7 @@ @@ -171,7 +171,7 @@
171 } 171 }
172 172
173 // Attempt to inflate the chunk of data 173 // Attempt to inflate the chunk of data
174 - outputData = [decompressor uncompressBytes:inputData length:readLength error:&theError]; 174 + outputData = [decompressor uncompressBytes:inputData length:(NSUInteger)readLength error:&theError];
175 if (theError) { 175 if (theError) {
176 if (err) { 176 if (err) {
177 *err = theError; 177 *err = theError;
@@ -41,6 +41,6 @@ @@ -41,6 +41,6 @@
41 41
42 @property (assign, nonatomic) ASICachePolicy defaultCachePolicy; 42 @property (assign, nonatomic) ASICachePolicy defaultCachePolicy;
43 @property (retain, nonatomic) NSString *storagePath; 43 @property (retain, nonatomic) NSString *storagePath;
44 -@property (retain) NSRecursiveLock *accessLock; 44 +@property (atomic, retain) NSRecursiveLock *accessLock;
45 -@property (assign) BOOL shouldRespectCacheControlHeaders; 45 +@property (atomic, assign) BOOL shouldRespectCacheControlHeaders;
46 @end 46 @end
@@ -70,7 +70,6 @@ typedef enum _ASIPostFormat { @@ -70,7 +70,6 @@ typedef enum _ASIPostFormat {
70 // Same as above, but you can specify the content-type and file name 70 // Same as above, but you can specify the content-type and file name
71 - (void)setData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key; 71 - (void)setData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key;
72 72
73 - 73 +@property (atomic, assign) ASIPostFormat postFormat;
74 -@property (assign) ASIPostFormat postFormat; 74 +@property (atomic, assign) NSStringEncoding stringEncoding;
75 -@property (assign) NSStringEncoding stringEncoding;  
76 @end 75 @end
@@ -15,8 +15,8 @@ @@ -15,8 +15,8 @@
15 - (void)buildURLEncodedPostBody; 15 - (void)buildURLEncodedPostBody;
16 - (void)appendPostString:(NSString *)string; 16 - (void)appendPostString:(NSString *)string;
17 17
18 -@property (retain) NSMutableArray *postData; 18 +@property (atomic, retain) NSMutableArray *postData;
19 -@property (retain) NSMutableArray *fileData; 19 +@property (atomic, retain) NSMutableArray *fileData;
20 20
21 #if DEBUG_FORM_DATA_REQUEST 21 #if DEBUG_FORM_DATA_REQUEST
22 - (void)addToDebugBody:(NSString *)string; 22 - (void)addToDebugBody:(NSString *)string;
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
@@ -61,7 +61,7 @@ static NSLock *readLock = nil; @@ -61,7 +61,7 @@ static NSLock *readLock = nil;
61 [readLock unlock]; 61 [readLock unlock];
62 NSInteger rv = [stream read:buffer maxLength:toRead]; 62 NSInteger rv = [stream read:buffer maxLength:toRead];
63 if (rv > 0) 63 if (rv > 0)
64 - [ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv]; 64 + [ASIHTTPRequest incrementBandwidthUsedInLastSecond:(NSUInteger)rv];
65 return rv; 65 return rv;
66 } 66 }
67 67
@@ -88,21 +88,21 @@ @@ -88,21 +88,21 @@
88 @property (assign, nonatomic, setter=setUploadProgressDelegate:) id uploadProgressDelegate; 88 @property (assign, nonatomic, setter=setUploadProgressDelegate:) id uploadProgressDelegate;
89 @property (assign, nonatomic, setter=setDownloadProgressDelegate:) id downloadProgressDelegate; 89 @property (assign, nonatomic, setter=setDownloadProgressDelegate:) id downloadProgressDelegate;
90 90
91 -@property (assign) SEL requestDidStartSelector; 91 +@property (assign, atomic) SEL requestDidStartSelector;
92 -@property (assign) SEL requestDidReceiveResponseHeadersSelector; 92 +@property (assign, atomic) SEL requestDidReceiveResponseHeadersSelector;
93 -@property (assign) SEL requestWillRedirectSelector; 93 +@property (assign, atomic) SEL requestWillRedirectSelector;
94 -@property (assign) SEL requestDidFinishSelector; 94 +@property (assign, atomic) SEL requestDidFinishSelector;
95 -@property (assign) SEL requestDidFailSelector; 95 +@property (assign, atomic) SEL requestDidFailSelector;
96 -@property (assign) SEL queueDidFinishSelector; 96 +@property (assign, atomic) SEL queueDidFinishSelector;
97 -@property (assign) BOOL shouldCancelAllRequestsOnFailure; 97 +@property (assign, atomic) BOOL shouldCancelAllRequestsOnFailure;
98 -@property (assign) id delegate; 98 +@property (assign, atomic) id delegate;
99 -@property (assign) BOOL showAccurateProgress; 99 +@property (assign, atomic) BOOL showAccurateProgress;
100 -@property (assign, readonly) int requestsCount; 100 +@property (assign, atomic, readonly) int requestsCount;
101 -@property (retain) NSDictionary *userInfo; 101 +@property (retain, atomic) NSDictionary *userInfo;
102 - 102 +
103 -@property (assign) unsigned long long bytesUploadedSoFar; 103 +@property (assign, atomic) unsigned long long bytesUploadedSoFar;
104 -@property (assign) unsigned long long totalBytesToUpload; 104 +@property (assign, atomic) unsigned long long totalBytesToUpload;
105 -@property (assign) unsigned long long bytesDownloadedSoFar; 105 +@property (assign, atomic) unsigned long long bytesDownloadedSoFar;
106 -@property (assign) unsigned long long totalBytesToDownload; 106 +@property (assign, atomic) unsigned long long totalBytesToDownload;
107 107
108 @end 108 @end
@@ -159,7 +159,7 @@ @@ -159,7 +159,7 @@
159 } 159 }
160 } 160 }
161 [request buildPostBody]; 161 [request buildPostBody];
162 - [self request:nil incrementUploadSizeBy:[request postLength]]; 162 + [self request:nil incrementUploadSizeBy:(long long)[request postLength]];
163 163
164 164
165 } else { 165 } else {
@@ -233,7 +233,7 @@ @@ -233,7 +233,7 @@
233 233
234 - (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes 234 - (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes
235 { 235 {
236 - [self setBytesDownloadedSoFar:[self bytesDownloadedSoFar]+bytes]; 236 + [self setBytesDownloadedSoFar:[self bytesDownloadedSoFar]+(unsigned long long)bytes];
237 if ([self downloadProgressDelegate]) { 237 if ([self downloadProgressDelegate]) {
238 [ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:[self bytesDownloadedSoFar] ofTotal:[self totalBytesToDownload]]; 238 [ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:[self bytesDownloadedSoFar] ofTotal:[self totalBytesToDownload]];
239 } 239 }
@@ -241,7 +241,7 @@ @@ -241,7 +241,7 @@
241 241
242 - (void)request:(ASIHTTPRequest *)request didSendBytes:(long long)bytes 242 - (void)request:(ASIHTTPRequest *)request didSendBytes:(long long)bytes
243 { 243 {
244 - [self setBytesUploadedSoFar:[self bytesUploadedSoFar]+bytes]; 244 + [self setBytesUploadedSoFar:[self bytesUploadedSoFar]+(unsigned long long)bytes];
245 if ([self uploadProgressDelegate]) { 245 if ([self uploadProgressDelegate]) {
246 [ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:[self bytesUploadedSoFar] ofTotal:[self totalBytesToUpload]]; 246 [ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:[self bytesUploadedSoFar] ofTotal:[self totalBytesToUpload]];
247 } 247 }
@@ -249,12 +249,12 @@ @@ -249,12 +249,12 @@
249 249
250 - (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength 250 - (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength
251 { 251 {
252 - [self setTotalBytesToDownload:[self totalBytesToDownload]+newLength]; 252 + [self setTotalBytesToDownload:[self totalBytesToDownload]+(unsigned long long)newLength];
253 } 253 }
254 254
255 - (void)request:(ASIHTTPRequest *)request incrementUploadSizeBy:(long long)newLength 255 - (void)request:(ASIHTTPRequest *)request incrementUploadSizeBy:(long long)newLength
256 { 256 {
257 - [self setTotalBytesToUpload:[self totalBytesToUpload]+newLength]; 257 + [self setTotalBytesToUpload:[self totalBytesToUpload]+(unsigned long long)newLength];
258 } 258 }
259 259
260 260
@@ -143,7 +143,7 @@ extern NSString *const kReachabilityChangedNotification; @@ -143,7 +143,7 @@ extern NSString *const kReachabilityChangedNotification;
143 143
144 } 144 }
145 145
146 -@property (copy) NSString *key; // Atomic because network operations are asynchronous. 146 +@property (atomic, copy) NSString *key; // Atomic because network operations are asynchronous.
147 147
148 // Designated Initializer. 148 // Designated Initializer.
149 - (Reachability *) initWithReachabilityRef: (SCNetworkReachabilityRef) ref; 149 - (Reachability *) initWithReachabilityRef: (SCNetworkReachabilityRef) ref;
@@ -442,9 +442,9 @@ const SCNetworkReachabilityFlags kConnectionDown = kSCNetworkReachabilityFlagsC @@ -442,9 +442,9 @@ const SCNetworkReachabilityFlags kConnectionDown = kSCNetworkReachabilityFlagsC
442 if (flags & kSCNetworkReachabilityFlagsIsWWAN) { return kReachableViaWWAN; } 442 if (flags & kSCNetworkReachabilityFlagsIsWWAN) { return kReachableViaWWAN; }
443 443
444 // Clear moot bits. 444 // Clear moot bits.
445 - flags &= ~kSCNetworkReachabilityFlagsReachable; 445 + flags &= ~(uint32_t)kSCNetworkReachabilityFlagsReachable;
446 - flags &= ~kSCNetworkReachabilityFlagsIsDirect; 446 + flags &= ~(uint32_t)kSCNetworkReachabilityFlagsIsDirect;
447 - flags &= ~kSCNetworkReachabilityFlagsIsLocalAddress; // kInternetConnection is local. 447 + flags &= ~(uint32_t)kSCNetworkReachabilityFlagsIsLocalAddress; // kInternetConnection is local.
448 448
449 // Reachability Flag Status: -R ct---xx Connection down. 449 // Reachability Flag Status: -R ct---xx Connection down.
450 if (flags == kConnectionDown) { return kNotReachable; } 450 if (flags == kConnectionDown) { return kNotReachable; }