CF warning cleanup. fixed case on -[NSMutableArray exchangeObjectAtIndex:withObjectAtIndex:]

This commit is contained in:
Christopher Lloyd 2009-06-10 20:55:23 +00:00
parent 53ea1dc325
commit 2f60a957c4
6 changed files with 97 additions and 16 deletions

View File

@ -1,9 +0,0 @@
/* Copyright (c) 2007 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
typedef id CFAllocatorRef;

View File

@ -75,7 +75,7 @@ CFHashCode CFHash(CFTypeRef self){
} }
Boolean CFEqual(CFTypeRef self,CFTypeRef other){ Boolean CFEqual(CFTypeRef self,CFTypeRef other){
return [(id) self idEqual:other]; return [(id) self isEqual:(id)other];
} }
CFStringRef CFCopyTypeIDDescription(CFTypeID typeID){ CFStringRef CFCopyTypeIDDescription(CFTypeID typeID){

View File

@ -6,6 +6,98 @@
#define NSSocketCast(_) ((NSSocket *)_) #define NSSocketCast(_) ((NSSocket *)_)
@implementation NSSocket(CFSocket)
+(CFTypeID)typeID {
NSInvalidAbstractInvocation();
return 0;
}
+(CFSocketRef)createWithAllocator:(CFAllocatorRef)allocator protocolFamily:(CFInteger)protocolFamily type:(CFInteger)socketType protocol:(CFInteger)protocol options:(CFOptionFlags)flags callback:(CFSocketCallBack)callback context:(const CFSocketContext *)context {
NSInvalidAbstractInvocation();
return 0;
}
+(CFSocketRef)createConnectedWithAllocator:(CFAllocatorRef)allocator signature:(const CFSocketSignature *)signature options:(CFOptionFlags)flags callback:(CFSocketCallBack)callback context:(const CFSocketContext *)context timeout:(CFTimeInterval)timeout {
NSInvalidAbstractInvocation();
return 0;
}
+(CFSocketRef)createWithAllocator:(CFAllocatorRef)allocator native:(CFSocketNativeHandle)native options:(CFOptionFlags)flag callback:(CFSocketCallBack)callback context:(const CFSocketContext *)context {
NSInvalidAbstractInvocation();
return 0;
}
+(CFSocketRef)createWithAllocator:(CFAllocatorRef)allocator signature:(const CFSocketSignature *)signature options:(CFOptionFlags)flags callback:(CFSocketCallBack)callback context:(const CFSocketContext *)context {
NSInvalidAbstractInvocation();
return 0;
}
-(CFSocketError)connectToAddress:(CFDataRef)address timeout:(CFTimeInterval)timeout {
NSInvalidAbstractInvocation();
return 0;
}
-(CFDataRef)copyAddress {
NSInvalidAbstractInvocation();
return 0;
}
-(CFDataRef)copyPeerAddress {
NSInvalidAbstractInvocation();
return 0;
}
-(CFRunLoopSourceRef)createRunLoopSourceWithAllocator:(CFAllocatorRef)allocator order:(CFIndex)order {
NSInvalidAbstractInvocation();
return 0;
}
-(void)disableCallBacks:(CFOptionFlags)mask {
NSInvalidAbstractInvocation();
}
-(void)enableCallBacks:(CFOptionFlags)mask {
NSInvalidAbstractInvocation();
}
-(void)getContext:(CFSocketContext *)context {
NSInvalidAbstractInvocation();
}
-(CFSocketNativeHandle)native {
NSInvalidAbstractInvocation();
return 0;
}
-(CFOptionFlags)socketFlags {
NSInvalidAbstractInvocation();
return 0;
}
-(void)invalidate {
NSInvalidAbstractInvocation();
}
-(Boolean)isValid {
NSInvalidAbstractInvocation();
return 0;
}
-(CFSocketError)sendToAddress:(CFDataRef)address data:(CFDataRef)data timeout:(CFTimeInterval)timeout {
NSInvalidAbstractInvocation();
return 0;
}
-(CFSocketError)setAddress:(CFDataRef)address {
NSInvalidAbstractInvocation();
return 0;
}
-(void)setSocketFlags:(CFOptionFlags)flags {
NSInvalidAbstractInvocation();
}
CFTypeID CFSocketGetTypeID() { CFTypeID CFSocketGetTypeID() {
return [NSSocket typeID]; return [NSSocket typeID];
} }
@ -82,4 +174,6 @@ void CFSocketSetSocketFlags(CFSocketRef self,CFOptionFlags flags) {
[NSSocketCast(self) setSocketFlags:flags]; [NSSocketCast(self) setSocketFlags:flags];
} }
@end
#endif #endif

View File

@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
FE03F1C30FDFF65F008260E9 /* CFAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE03F19E0FDFF65F008260E9 /* CFAllocator.h */; };
FEE0F9CD0DC962D600598037 /* CFBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE0F9C60DC962D600598037 /* CFBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; FEE0F9CD0DC962D600598037 /* CFBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE0F9C60DC962D600598037 /* CFBase.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEE0F9CE0DC962D600598037 /* CFLocale.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE0F9C70DC962D600598037 /* CFLocale.h */; settings = {ATTRIBUTES = (Public, ); }; }; FEE0F9CE0DC962D600598037 /* CFLocale.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE0F9C70DC962D600598037 /* CFLocale.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEE0F9D00DC962D600598037 /* CFNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE0F9C90DC962D600598037 /* CFNumber.h */; settings = {ATTRIBUTES = (Public, ); }; }; FEE0F9D00DC962D600598037 /* CFNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = FEE0F9C90DC962D600598037 /* CFNumber.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -65,7 +64,6 @@
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* CoreFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8DC2EF5B0486A6940098B216 /* CoreFoundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreFoundation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FE03F19E0FDFF65F008260E9 /* CFAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFAllocator.h; sourceTree = "<group>"; };
FEE0F9C60DC962D600598037 /* CFBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFBase.h; sourceTree = "<group>"; }; FEE0F9C60DC962D600598037 /* CFBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFBase.h; sourceTree = "<group>"; };
FEE0F9C70DC962D600598037 /* CFLocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFLocale.h; sourceTree = "<group>"; }; FEE0F9C70DC962D600598037 /* CFLocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFLocale.h; sourceTree = "<group>"; };
FEE0F9C90DC962D600598037 /* CFNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNumber.h; sourceTree = "<group>"; }; FEE0F9C90DC962D600598037 /* CFNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFNumber.h; sourceTree = "<group>"; };
@ -129,7 +127,6 @@
0867D691FE84028FC02AAC07 /* CoreFoundation */ = { 0867D691FE84028FC02AAC07 /* CoreFoundation */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
FE03F19E0FDFF65F008260E9 /* CFAllocator.h */,
FEED22530EFB669D004E378B /* CFArray.h */, FEED22530EFB669D004E378B /* CFArray.h */,
FEED22540EFB669D004E378B /* CFAttributedString.h */, FEED22540EFB669D004E378B /* CFAttributedString.h */,
FEED22550EFB669D004E378B /* CFBag.h */, FEED22550EFB669D004E378B /* CFBag.h */,
@ -262,7 +259,6 @@
FEED22940EFB669D004E378B /* CFUUID.h in Headers */, FEED22940EFB669D004E378B /* CFUUID.h in Headers */,
FEED22950EFB669D004E378B /* CFXMLNode.h in Headers */, FEED22950EFB669D004E378B /* CFXMLNode.h in Headers */,
FEED22960EFB669D004E378B /* CFXMLParser.h in Headers */, FEED22960EFB669D004E378B /* CFXMLParser.h in Headers */,
FE03F1C30FDFF65F008260E9 /* CFAllocator.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -35,7 +35,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)replaceObjectAtIndex:(NSUInteger)index withObject:object; -(void)replaceObjectAtIndex:(NSUInteger)index withObject:object;
-(void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray *)array; -(void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray *)array;
-(void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray *)array range:(NSRange)otherRange; -(void)replaceObjectsInRange:(NSRange)range withObjectsFromArray:(NSArray *)array range:(NSRange)otherRange;
-(void)exchangeobjectAtIndex:(NSUInteger)index withobjectAtIndex:(NSUInteger)other; -(void)exchangeObjectAtIndex:(NSUInteger)index withObjectAtIndex:(NSUInteger)other;
-(void)sortUsingSelector:(SEL)selector; -(void)sortUsingSelector:(SEL)selector;
-(void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context; -(void)sortUsingFunction:(NSInteger (*)(id, id, void *))compare context:(void *)context;

View File

@ -359,7 +359,7 @@ static int _nsmutablearraycompareindices(const void* v1, const void* v2)
} }
} }
-(void)exchangeobjectAtIndex:(NSUInteger)index withobjectAtIndex:(NSUInteger)other { -(void)exchangeObjectAtIndex:(NSUInteger)index withObjectAtIndex:(NSUInteger)other {
id object=[[self objectAtIndex:index] retain]; id object=[[self objectAtIndex:index] retain];
id otherObject=[self objectAtIndex:other]; id otherObject=[self objectAtIndex:other];