Merge pull request #152 from triplef/fix-nsurlrequest-instancetype

Update NSURLRequest header to use "instancetype".
This commit is contained in:
rfm 2020-07-14 09:33:22 +01:00 committed by GitHub
commit 98b94dea15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 16 deletions

View file

@ -1,3 +1,9 @@
2020-07-13 Frederik Seiffert <frederik@algoriddim.com>
* Headers/Foundation/NSURLRequest.h:
* Source/NSURLRequest.m:
Update NSURLRequest header to use "instancetype".
2020-07-08 Frederik Seiffert <frederik@algoriddim.com> 2020-07-08 Frederik Seiffert <frederik@algoriddim.com>
* Source/NSLog.m: * Source/NSLog.m:

View file

@ -99,15 +99,15 @@ typedef NSUInteger NSURLRequestCachePolicy;
* and with the default cache policy (NSURLRequestUseProtocolCachePolicy) * and with the default cache policy (NSURLRequestUseProtocolCachePolicy)
* and a sixty second timeout. * and a sixty second timeout.
*/ */
+ (id) requestWithURL: (NSURL *)URL; + (instancetype) requestWithURL: (NSURL *)URL;
/** /**
* Returns an autoreleased instance initialised with the specified URL, * Returns an autoreleased instance initialised with the specified URL,
* cachePolicy, and timeoutInterval. * cachePolicy, and timeoutInterval.
*/ */
+ (id) requestWithURL: (NSURL *)URL + (instancetype) requestWithURL: (NSURL *)URL
cachePolicy: (NSURLRequestCachePolicy)cachePolicy cachePolicy: (NSURLRequestCachePolicy)cachePolicy
timeoutInterval: (NSTimeInterval)timeoutInterval; timeoutInterval: (NSTimeInterval)timeoutInterval;
/** /**
* Returns the cache policy associated with the receiver. * Returns the cache policy associated with the receiver.
@ -119,15 +119,15 @@ typedef NSUInteger NSURLRequestCachePolicy;
* and with the default cache policy (NSURLRequestUseProtocolCachePolicy) * and with the default cache policy (NSURLRequestUseProtocolCachePolicy)
* and a sixty second timeout. * and a sixty second timeout.
*/ */
- (id) initWithURL: (NSURL *)URL; - (instancetype) initWithURL: (NSURL *)URL;
/** /**
* Initialises the receiver with the specified URL, * Initialises the receiver with the specified URL,
* cachePolicy, and timeoutInterval. * cachePolicy, and timeoutInterval.
*/ */
- (id) initWithURL: (NSURL *)URL - (instancetype) initWithURL: (NSURL *)URL
cachePolicy: (NSURLRequestCachePolicy)cachePolicy cachePolicy: (NSURLRequestCachePolicy)cachePolicy
timeoutInterval: (NSTimeInterval)timeoutInterval; timeoutInterval: (NSTimeInterval)timeoutInterval;
/** /**
* Returns the main document URL for the receiver.<br /> * Returns the main document URL for the receiver.<br />

View file

@ -68,16 +68,16 @@ typedef struct {
return o; return o;
} }
+ (id) requestWithURL: (NSURL *)URL + (instancetype) requestWithURL: (NSURL *)URL
{ {
return [self requestWithURL: URL return [self requestWithURL: URL
cachePolicy: NSURLRequestUseProtocolCachePolicy cachePolicy: NSURLRequestUseProtocolCachePolicy
timeoutInterval: 60.0]; timeoutInterval: 60.0];
} }
+ (id) requestWithURL: (NSURL *)URL + (instancetype) requestWithURL: (NSURL *)URL
cachePolicy: (NSURLRequestCachePolicy)cachePolicy cachePolicy: (NSURLRequestCachePolicy)cachePolicy
timeoutInterval: (NSTimeInterval)timeoutInterval timeoutInterval: (NSTimeInterval)timeoutInterval
{ {
NSURLRequest *o = [[self class] allocWithZone: NSDefaultMallocZone()]; NSURLRequest *o = [[self class] allocWithZone: NSDefaultMallocZone()];
@ -177,16 +177,16 @@ typedef struct {
return [self initWithURL: nil]; return [self initWithURL: nil];
} }
- (id) initWithURL: (NSURL *)URL - (instancetype) initWithURL: (NSURL *)URL
{ {
return [self initWithURL: URL return [self initWithURL: URL
cachePolicy: NSURLRequestUseProtocolCachePolicy cachePolicy: NSURLRequestUseProtocolCachePolicy
timeoutInterval: 60.0]; timeoutInterval: 60.0];
} }
- (id) initWithURL: (NSURL *)URL - (instancetype) initWithURL: (NSURL *)URL
cachePolicy: (NSURLRequestCachePolicy)cachePolicy cachePolicy: (NSURLRequestCachePolicy)cachePolicy
timeoutInterval: (NSTimeInterval)timeoutInterval timeoutInterval: (NSTimeInterval)timeoutInterval
{ {
if ([URL isKindOfClass: [NSURL class]] == NO) if ([URL isKindOfClass: [NSURL class]] == NO)
{ {