Joseph Heenan

Merge pull request #342 from jweyrich/master

Fix warnings when compiling with some -W options.
... ... @@ -28,8 +28,8 @@ typedef enum _ASIAuthenticationType {
+ (void)presentAuthenticationDialogForRequest:(ASIHTTPRequest *)request;
+ (void)dismiss;
@property (retain) ASIHTTPRequest *request;
@property (assign) ASIAuthenticationType type;
@property (assign) BOOL didEnableRotationNotifications;
@property (atomic, retain) ASIHTTPRequest *request;
@property (atomic, assign) ASIAuthenticationType type;
@property (atomic, assign) BOOL didEnableRotationNotifications;
@property (retain, nonatomic) UIViewController *presentingController;
@end
... ...
... ... @@ -41,7 +41,7 @@ static const NSUInteger kDomainSection = 1;
- (void)orientationChanged:(NSNotification *)notification;
- (void)cancelAuthenticationFromDialog:(id)sender;
- (void)loginWithCredentialsFromDialog:(id)sender;
@property (retain) UITableView *tableView;
@property (atomic, retain) UITableView *tableView;
@end
@implementation ASIAuthenticationDialog
... ... @@ -193,7 +193,7 @@ static const NSUInteger kDomainSection = 1;
- (UITextField *)textFieldInRow:(NSUInteger)row section:(NSUInteger)section
{
return [[[[[self tableView] cellForRowAtIndexPath:
[NSIndexPath indexPathForRow:row inSection:section]]
[NSIndexPath indexPathForRow:(NSInteger)row inSection:(NSInteger)section]]
contentView] subviews] objectAtIndex:0];
}
... ... @@ -471,8 +471,8 @@ static const NSUInteger kDomainSection = 1;
[textField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
[textField setAutocorrectionType:UITextAutocorrectionTypeNo];
NSUInteger s = [indexPath section];
NSUInteger r = [indexPath row];
NSInteger s = [indexPath section];
NSInteger r = [indexPath row];
if (s == kUsernameSection && r == kUsernameRow) {
[textField setPlaceholder:@"User"];
... ...
... ... @@ -38,5 +38,5 @@
// If deflating finishes or fails, this method will be called automatically
- (NSError *)closeStream;
@property (assign, readonly) BOOL streamReady;
@property (atomic, assign, readonly) BOOL streamReady;
@end
... ...
... ... @@ -81,7 +81,7 @@
zStream.avail_in = (unsigned int)length;
zStream.avail_out = 0;
NSInteger bytesProcessedAlready = zStream.total_out;
NSUInteger bytesProcessedAlready = zStream.total_out;
while (zStream.avail_out == 0) {
if (zStream.total_out-bytesProcessedAlready >= [outputData length]) {
... ... @@ -174,7 +174,7 @@
}
// Attempt to deflate the chunk of data
outputData = [compressor compressBytes:inputData length:readLength error:&theError shouldFinish:readLength < DATA_CHUNK_SIZE ];
outputData = [compressor compressBytes:inputData length:(NSUInteger)readLength error:&theError shouldFinish:readLength < DATA_CHUNK_SIZE];
if (theError) {
if (err) {
*err = theError;
... ...
... ... @@ -37,5 +37,5 @@
// If inflating finishes or fails, this method will be called automatically
- (NSError *)closeStream;
@property (assign, readonly) BOOL streamReady;
@property (atomic, assign, readonly) BOOL streamReady;
@end
... ...
... ... @@ -78,7 +78,7 @@
zStream.avail_in = (unsigned int)length;
zStream.avail_out = 0;
NSInteger bytesProcessedAlready = zStream.total_out;
NSUInteger bytesProcessedAlready = zStream.total_out;
while (zStream.avail_in != 0) {
if (zStream.total_out-bytesProcessedAlready >= [outputData length]) {
... ... @@ -155,7 +155,7 @@
while ([decompressor streamReady]) {
// Read some data from the file
readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE];
readLength = [inputStream read:inputData maxLength:DATA_CHUNK_SIZE];
// Make sure nothing went wrong
if ([inputStream streamStatus] == NSStreamStatusError) {
... ... @@ -171,7 +171,7 @@
}
// Attempt to inflate the chunk of data
outputData = [decompressor uncompressBytes:inputData length:readLength error:&theError];
outputData = [decompressor uncompressBytes:inputData length:(NSUInteger)readLength error:&theError];
if (theError) {
if (err) {
*err = theError;
... ...
... ... @@ -41,6 +41,6 @@
@property (assign, nonatomic) ASICachePolicy defaultCachePolicy;
@property (retain, nonatomic) NSString *storagePath;
@property (retain) NSRecursiveLock *accessLock;
@property (assign) BOOL shouldRespectCacheControlHeaders;
@property (atomic, retain) NSRecursiveLock *accessLock;
@property (atomic, assign) BOOL shouldRespectCacheControlHeaders;
@end
... ...
... ... @@ -70,7 +70,6 @@ typedef enum _ASIPostFormat {
// Same as above, but you can specify the content-type and file name
- (void)setData:(id)data withFileName:(NSString *)fileName andContentType:(NSString *)contentType forKey:(NSString *)key;
@property (assign) ASIPostFormat postFormat;
@property (assign) NSStringEncoding stringEncoding;
@property (atomic, assign) ASIPostFormat postFormat;
@property (atomic, assign) NSStringEncoding stringEncoding;
@end
... ...
... ... @@ -15,8 +15,8 @@
- (void)buildURLEncodedPostBody;
- (void)appendPostString:(NSString *)string;
@property (retain) NSMutableArray *postData;
@property (retain) NSMutableArray *fileData;
@property (atomic, retain) NSMutableArray *postData;
@property (atomic, retain) NSMutableArray *fileData;
#if DEBUG_FORM_DATA_REQUEST
- (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;
[readLock unlock];
NSInteger rv = [stream read:buffer maxLength:toRead];
if (rv > 0)
[ASIHTTPRequest incrementBandwidthUsedInLastSecond:rv];
[ASIHTTPRequest incrementBandwidthUsedInLastSecond:(NSUInteger)rv];
return rv;
}
... ...
... ... @@ -88,21 +88,21 @@
@property (assign, nonatomic, setter=setUploadProgressDelegate:) id uploadProgressDelegate;
@property (assign, nonatomic, setter=setDownloadProgressDelegate:) id downloadProgressDelegate;
@property (assign) SEL requestDidStartSelector;
@property (assign) SEL requestDidReceiveResponseHeadersSelector;
@property (assign) SEL requestWillRedirectSelector;
@property (assign) SEL requestDidFinishSelector;
@property (assign) SEL requestDidFailSelector;
@property (assign) SEL queueDidFinishSelector;
@property (assign) BOOL shouldCancelAllRequestsOnFailure;
@property (assign) id delegate;
@property (assign) BOOL showAccurateProgress;
@property (assign, readonly) int requestsCount;
@property (retain) NSDictionary *userInfo;
@property (assign, atomic) SEL requestDidStartSelector;
@property (assign, atomic) SEL requestDidReceiveResponseHeadersSelector;
@property (assign, atomic) SEL requestWillRedirectSelector;
@property (assign, atomic) SEL requestDidFinishSelector;
@property (assign, atomic) SEL requestDidFailSelector;
@property (assign, atomic) SEL queueDidFinishSelector;
@property (assign, atomic) BOOL shouldCancelAllRequestsOnFailure;
@property (assign, atomic) id delegate;
@property (assign, atomic) BOOL showAccurateProgress;
@property (assign, atomic, readonly) int requestsCount;
@property (retain, atomic) NSDictionary *userInfo;
@property (assign) unsigned long long bytesUploadedSoFar;
@property (assign) unsigned long long totalBytesToUpload;
@property (assign) unsigned long long bytesDownloadedSoFar;
@property (assign) unsigned long long totalBytesToDownload;
@property (assign, atomic) unsigned long long bytesUploadedSoFar;
@property (assign, atomic) unsigned long long totalBytesToUpload;
@property (assign, atomic) unsigned long long bytesDownloadedSoFar;
@property (assign, atomic) unsigned long long totalBytesToDownload;
@end
... ...
... ... @@ -159,7 +159,7 @@
}
}
[request buildPostBody];
[self request:nil incrementUploadSizeBy:[request postLength]];
[self request:nil incrementUploadSizeBy:(long long)[request postLength]];
} else {
... ... @@ -233,7 +233,7 @@
- (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes
{
[self setBytesDownloadedSoFar:[self bytesDownloadedSoFar]+bytes];
[self setBytesDownloadedSoFar:[self bytesDownloadedSoFar]+(unsigned long long)bytes];
if ([self downloadProgressDelegate]) {
[ASIHTTPRequest updateProgressIndicator:&downloadProgressDelegate withProgress:[self bytesDownloadedSoFar] ofTotal:[self totalBytesToDownload]];
}
... ... @@ -241,7 +241,7 @@
- (void)request:(ASIHTTPRequest *)request didSendBytes:(long long)bytes
{
[self setBytesUploadedSoFar:[self bytesUploadedSoFar]+bytes];
[self setBytesUploadedSoFar:[self bytesUploadedSoFar]+(unsigned long long)bytes];
if ([self uploadProgressDelegate]) {
[ASIHTTPRequest updateProgressIndicator:&uploadProgressDelegate withProgress:[self bytesUploadedSoFar] ofTotal:[self totalBytesToUpload]];
}
... ... @@ -249,12 +249,12 @@
- (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength
{
[self setTotalBytesToDownload:[self totalBytesToDownload]+newLength];
[self setTotalBytesToDownload:[self totalBytesToDownload]+(unsigned long long)newLength];
}
- (void)request:(ASIHTTPRequest *)request incrementUploadSizeBy:(long long)newLength
{
[self setTotalBytesToUpload:[self totalBytesToUpload]+newLength];
[self setTotalBytesToUpload:[self totalBytesToUpload]+(unsigned long long)newLength];
}
... ...
... ... @@ -143,7 +143,7 @@ extern NSString *const kReachabilityChangedNotification;
}
@property (copy) NSString *key; // Atomic because network operations are asynchronous.
@property (atomic, copy) NSString *key; // Atomic because network operations are asynchronous.
// Designated Initializer.
- (Reachability *) initWithReachabilityRef: (SCNetworkReachabilityRef) ref;
... ...
... ... @@ -442,9 +442,9 @@ const SCNetworkReachabilityFlags kConnectionDown = kSCNetworkReachabilityFlagsC
if (flags & kSCNetworkReachabilityFlagsIsWWAN) { return kReachableViaWWAN; }
// Clear moot bits.
flags &= ~kSCNetworkReachabilityFlagsReachable;
flags &= ~kSCNetworkReachabilityFlagsIsDirect;
flags &= ~kSCNetworkReachabilityFlagsIsLocalAddress; // kInternetConnection is local.
flags &= ~(uint32_t)kSCNetworkReachabilityFlagsReachable;
flags &= ~(uint32_t)kSCNetworkReachabilityFlagsIsDirect;
flags &= ~(uint32_t)kSCNetworkReachabilityFlagsIsLocalAddress; // kInternetConnection is local.
// Reachability Flag Status: -R ct---xx Connection down.
if (flags == kConnectionDown) { return kNotReachable; }
... ...