Skip to content

Commit

Permalink
Fixes for GCC_WARN_UNDECLARED_SELECTOR
Browse files Browse the repository at this point in the history
More type conversion tweaks
  • Loading branch information
pokeb committed Nov 20, 2010
1 parent b34b3f1 commit 7433dd0
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 14 deletions.
6 changes: 5 additions & 1 deletion Classes/ASIAuthenticationDialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ - (void)showTitle;
- (void)show;
- (NSArray *)requestsRequiringTheseCredentials;
- (void)presentNextDialog;
- (void)keyboardWillShow:(NSNotification *)notification;
- (void)orientationChanged:(NSNotification *)notification;
- (void)cancelAuthenticationFromDialog:(id)sender;
- (void)loginWithCredentialsFromDialog:(id)sender;
@property (retain) UITableView *tableView;
@end

Expand Down Expand Up @@ -149,7 +153,7 @@ - (void)orientationChanged:(NSNotification *)notification
}

CGAffineTransform previousTransform = self.view.layer.affineTransform;
CGAffineTransform newTransform = CGAffineTransformMakeRotation(angle * M_PI / 180.0);
CGAffineTransform newTransform = CGAffineTransformMakeRotation((CGFloat)(angle * M_PI / 180.0));

// Reset the transform so we can set the size
self.view.layer.affineTransform = CGAffineTransformIdentity;
Expand Down
22 changes: 18 additions & 4 deletions Classes/ASIHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#import "ASIDataCompressor.h"

// Automatically set on build
NSString *ASIHTTPRequestVersion = @"v1.7-140 2010-11-13";
NSString *ASIHTTPRequestVersion = @"v1.8-4 2010-11-20";

NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain";

Expand Down Expand Up @@ -152,16 +152,25 @@ - (void)unscheduleReadStream;

- (BOOL)willAskDelegateForCredentials;
- (BOOL)willAskDelegateForProxyCredentials;
- (void)askDelegateForProxyCredentials;
- (void)askDelegateForCredentials;
- (void)failAuthentication;

+ (void)measureBandwidthUsage;
+ (void)recordBandwidthUsage;

- (void)startRequest;
- (void)updateStatus:(NSTimer *)timer;
- (void)checkRequestStatus;

- (void)markAsFinished;
- (void)performRedirect;
- (BOOL)shouldTimeOut;

+ (void)performInvocation:(NSInvocation *)invocation onTarget:(id *)target releasingObject:(id)objectToRelease;
+ (void)hideNetworkActivityIndicatorAfterDelay;
+ (void)hideNetworkActivityIndicatorIfNeeeded;
+ (void)runRequests;


- (void)useDataFromCache;

Expand All @@ -173,14 +182,19 @@ + (void)registerForNetworkReachabilityNotifications;
+ (void)unsubscribeFromNetworkReachabilityNotifications;
// Called when the status of the network changes
+ (void)reachabilityChanged:(NSNotification *)note;
- (void)failAuthentication;
#endif

#if NS_BLOCKS_AVAILABLE
- (void)performBlockOnMainThread:(ASIBasicBlock)block;
- (void)releaseBlocksOnMainThread;
+ (void)releaseBlocks:(NSArray *)blocks;
- (void)callBlock:(ASIBasicBlock)block;
#endif





@property (assign) BOOL complete;
@property (retain) NSArray *responseCookies;
@property (assign) int responseStatusCode;
Expand Down Expand Up @@ -1820,7 +1834,7 @@ + (void)updateProgressIndicator:(id *)indicator withProgress:(unsigned long long
#if TARGET_OS_IPHONE
// Cocoa Touch: UIProgressView
SEL selector = @selector(setProgress:);
float progressAmount = (progress*1.0f)/(total*1.0f);
float progressAmount = (float)((progress*1.0)/(total*1.0));

#else
// Cocoa: NSProgressIndicator
Expand Down
5 changes: 5 additions & 0 deletions Classes/ASIWebPageRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ - (void)parseAsCSS;
- (void)addURLToFetch:(NSString *)newURL;
+ (NSArray *)CSSURLsFromString:(NSString *)string;
- (NSString *)relativePathTo:(NSString *)destinationPath fromPath:(NSString *)sourcePath;

- (void)finishedFetchingExternalResources:(ASINetworkQueue *)queue;
- (void)externalResourceFetchSucceeded:(ASIHTTPRequest *)externalResourceRequest;
- (void)externalResourceFetchFailed:(ASIHTTPRequest *)externalResourceRequest;

@property (retain, nonatomic) ASINetworkQueue *externalResourceQueue;
@property (retain, nonatomic) NSMutableDictionary *resourceList;
@end
Expand Down
4 changes: 4 additions & 0 deletions Mac Sample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ - (void)authSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo
- (void)postFinished:(ASIHTTPRequest *)request;
- (void)postFailed:(ASIHTTPRequest *)request;
- (void)fetchURL:(NSURL *)url;
- (void)tableViewDataFetchFinished:(ASIHTTPRequest *)request;
- (void)rowImageDownloadFinished:(ASIHTTPRequest *)request;
- (void)webPageFetchFailed:(ASIHTTPRequest *)request;
- (void)webPageFetchSucceeded:(ASIHTTPRequest *)request;
@end

@implementation AppDelegate
Expand Down
6 changes: 6 additions & 0 deletions iPhone Sample/AuthenticationViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ - (void) addTextFieldAtIndex:(NSUInteger) index;
- (UITextField *) textFieldAtIndex:(NSUInteger) index;
@end

// Private stuff
@interface AuthenticationViewController ()
- (IBAction)topSecretFetchFailed:(ASIHTTPRequest *)theRequest;
- (IBAction)topSecretFetchComplete:(ASIHTTPRequest *)theRequest;
@end

@implementation AuthenticationViewController

- (IBAction)fetchTopSecretInformation:(id)sender
Expand Down
11 changes: 8 additions & 3 deletions iPhone Sample/QueueViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
#import "InfoCell.h"
#import "ToggleCell.h"

@implementation QueueViewController
// Private stuff
@interface QueueViewController ()
- (void)imageFetchComplete:(ASIHTTPRequest *)request;
- (void)imageFetchFailed:(ASIHTTPRequest *)request;
@end

@implementation QueueViewController

- (IBAction)fetchThreeImages:(id)sender
{
Expand Down Expand Up @@ -222,7 +227,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath

}
NSUInteger imageWidth = (tableWidth-tablePadding-20)/3;
NSUInteger imageHeight = imageWidth*0.66;
NSUInteger imageHeight = imageWidth*0.66f;


[imageView1 setFrame:CGRectMake(tablePadding/2,10,imageWidth,imageHeight)];
Expand Down Expand Up @@ -265,7 +270,7 @@ - (CGFloat)tableView:(UITableView *)theTableView heightForRowAtIndexPath:(NSInde
tablePadding = 110;
}
NSUInteger imageWidth = (tableWidth-tablePadding-20)/3;
NSUInteger imageHeight = imageWidth*0.66;
NSUInteger imageHeight = imageWidth*0.66f;
return imageHeight+50;
} else {
return 42;
Expand Down
2 changes: 1 addition & 1 deletion iPhone Sample/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ @implementation RootViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.contentSizeForViewInPopover = CGSizeMake(310.0, self.tableView.rowHeight*5.0);
self.contentSizeForViewInPopover = CGSizeMake(310.0f, self.tableView.rowHeight*5.0f);
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
Expand Down
7 changes: 7 additions & 0 deletions iPhone Sample/SampleViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@

#import "SampleViewController.h"

// Private stuff
@interface SampleViewController ()
- (void)keyboardWillShow:(NSNotification *)notification;
- (void)keyboardWillHide:(NSNotification *)notification;
@end



@implementation SampleViewController

Expand Down
6 changes: 6 additions & 0 deletions iPhone Sample/UploadViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
#import "ASIFormDataRequest.h"
#import "InfoCell.h"

// Private stuff
@interface UploadViewController ()
- (void)uploadFailed:(ASIHTTPRequest *)theRequest;
- (void)uploadFinished:(ASIHTTPRequest *)theRequest;
@end

@implementation UploadViewController

- (IBAction)performLargeUpload:(id)sender
Expand Down
10 changes: 8 additions & 2 deletions iPhone Sample/WebPageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
#import "ToggleCell.h"
#import "RequestProgressCell.h"

// Private stuff
@interface WebPageViewController ()
- (void)webPageFetchFailed:(ASIHTTPRequest *)theRequest;
- (void)webPageFetchSucceeded:(ASIHTTPRequest *)theRequest;
@end

@implementation WebPageViewController

- (void)fetchWebPage:(id)sender
Expand Down Expand Up @@ -116,7 +122,7 @@ - (void)request:(ASIHTTPRequest *)theRequest didReceiveBytes:(long long)newLengt
if (requestNumber != NSNotFound) {
RequestProgressCell *cell = (RequestProgressCell *)[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:requestNumber inSection:2]];
if ([theRequest contentLength]+[theRequest partialDownloadSize] > 0) {
float progressAmount = ([theRequest totalBytesRead]*1.0f)/(([theRequest contentLength]+[theRequest partialDownloadSize])*1.0f);
float progressAmount = (float)(([theRequest totalBytesRead]*1.0)/(([theRequest contentLength]+[theRequest partialDownloadSize])*1.0));
[[cell progressView] setProgress:progressAmount];
}
}
Expand Down Expand Up @@ -216,7 +222,7 @@ - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath
} else {
[[cell textLabel] setText:[[theRequest url] absoluteString]];
if ([theRequest contentLength] > 0) {
[[(RequestProgressCell *)cell progressView] setProgress:[theRequest totalBytesRead]/([theRequest contentLength]+[theRequest partialDownloadSize])];
[[(RequestProgressCell *)cell progressView] setProgress:(float)(([theRequest totalBytesRead]*1.0)/(([theRequest contentLength]+[theRequest partialDownloadSize])*1.0))];
}
[[cell accessoryView] setHidden:NO];
}
Expand Down
16 changes: 14 additions & 2 deletions iPhone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
B50C182C121C26FA0055FCAB /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B50C182B121C26FA0055FCAB /* Security.framework */; };
B50C1848121C27510055FCAB /* client.p12 in Resources */ = {isa = PBXBuildFile; fileRef = B50C1847121C27510055FCAB /* client.p12 */; };
B50D532C126C87ED0022EA6F /* BlocksTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B50D532B126C87ED0022EA6F /* BlocksTests.m */; };
B50F66191297FA45003887B1 /* strict.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B50F66181297FA45003887B1 /* strict.xcconfig */; };
B50F661A1297FA45003887B1 /* strict.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B50F66181297FA45003887B1 /* strict.xcconfig */; };
B50F661B1297FA45003887B1 /* strict.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B50F66181297FA45003887B1 /* strict.xcconfig */; };
B51791A31024C3E800583567 /* AuthenticationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B51791A21024C3E800583567 /* AuthenticationViewController.m */; };
B51A1A9B11DDF85100ED75CF /* ASIDownloadCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B51A1A7A11DDF7BF00ED75CF /* ASIDownloadCacheTests.m */; };
B522DACE1030B2AB009A2D22 /* ASIInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = B522DACD1030B2AB009A2D22 /* ASIInputStream.m */; };
Expand Down Expand Up @@ -148,6 +151,7 @@
B50C1847121C27510055FCAB /* client.p12 */ = {isa = PBXFileReference; lastKnownFileType = file; name = client.p12; path = "iPhone Sample/Resources/client.p12"; sourceTree = "<group>"; };
B50D532A126C87ED0022EA6F /* BlocksTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlocksTests.h; sourceTree = "<group>"; };
B50D532B126C87ED0022EA6F /* BlocksTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlocksTests.m; sourceTree = "<group>"; };
B50F66181297FA45003887B1 /* strict.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = strict.xcconfig; sourceTree = "<group>"; };
B51791A11024C3E800583567 /* AuthenticationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AuthenticationViewController.h; path = "iPhone Sample/AuthenticationViewController.h"; sourceTree = "<group>"; };
B51791A21024C3E800583567 /* AuthenticationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AuthenticationViewController.m; path = "iPhone Sample/AuthenticationViewController.m"; sourceTree = "<group>"; };
B51A1A7911DDF7BF00ED75CF /* ASIDownloadCacheTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASIDownloadCacheTests.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -435,6 +439,7 @@
B5BD2AF811CA541100D7C426 /* iPadSampleAppDelegate.h */,
B5BD2AF911CA541100D7C426 /* iPadSampleAppDelegate.m */,
B55B605F0F765A750064029C /* iPhone_Prefix.pch */,
B50F66181297FA45003887B1 /* strict.xcconfig */,
B55B60600F765A750064029C /* main.m */,
B52329A911CA3380006C6E5A /* UI helpers */,
);
Expand Down Expand Up @@ -687,6 +692,7 @@
B55B60740F765A990064029C /* iphone-icon.png in Resources */,
B576D76611C7F4D90059B815 /* iPhoneMainWindow.xib in Resources */,
B523254311CA01F1006C6E5A /* Sample.xib in Resources */,
B50F661A1297FA45003887B1 /* strict.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -696,6 +702,7 @@
files = (
B56529A3101C8EDA000499CF /* iphone-tests-icon.png in Resources */,
B50C1848121C27510055FCAB /* client.p12 in Resources */,
B50F661B1297FA45003887B1 /* strict.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -707,6 +714,7 @@
B558B5EB11C7F9C8009B4627 /* iPadMainWindow.xib in Resources */,
B523254211CA01F1006C6E5A /* Sample.xib in Resources */,
B52325AD11CA05A8006C6E5A /* info.png in Resources */,
B50F66191297FA45003887B1 /* strict.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -878,7 +886,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
PRODUCT_NAME = "ASIHTTPRequest iPhone";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos4.1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
Expand All @@ -897,13 +905,14 @@
IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
PRODUCT_NAME = "ASIHTTPRequest iPhone";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos4.1;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
};
B55B60CC0F765BB10064029C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -938,6 +947,7 @@
};
B55B60CD0F765BB10064029C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
Expand Down Expand Up @@ -974,6 +984,7 @@
};
B576D72111C7F34D0059B815 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
Expand All @@ -996,6 +1007,7 @@
};
B576D72211C7F34D0059B815 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B50F66181297FA45003887B1 /* strict.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
Expand Down
2 changes: 1 addition & 1 deletion strict.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_SIGN_COMPARE = YES
GCC_WARN_STRICT_SELECTOR_MATCH = missing value
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
//GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_LABEL = YES
GCC_WARN_UNUSED_VALUE = YES
Expand Down

0 comments on commit 7433dd0

Please sign in to comment.