Skip to content

Commit 6b5900d

Browse files
Apple Open Sourceopensource-apple
authored andcommitted
1 parent c30dab8 commit 6b5900d

File tree

150 files changed

+12317
-5547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+12317
-5547
lines changed

CFApplicationPreferences.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
/* CFApplicationPreferences.c
25-
Copyright (c) 1998-2011, Apple Inc. All rights reserved.
25+
Copyright (c) 1998-2012, Apple Inc. All rights reserved.
2626
Responsibility: David Smith
2727
*/
2828

CFArray.c

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
/* CFArray.c
25-
Copyright (c) 1998-2011, Apple Inc. All rights reserved.
25+
Copyright (c) 1998-2012, Apple Inc. All rights reserved.
2626
Responsibility: Christopher Kane
2727
*/
2828

@@ -31,6 +31,7 @@
3131
#include "CFInternal.h"
3232
#include <string.h>
3333

34+
3435
const CFArrayCallBacks kCFTypeArrayCallBacks = {0, __CFTypeCollectionRetain, __CFTypeCollectionRelease, CFCopyDescription, CFEqual};
3536
static const CFArrayCallBacks __kCFNullArrayCallBacks = {0, NULL, NULL, NULL, NULL};
3637

@@ -314,6 +315,7 @@ static CFStringRef __CFArrayCopyDescription(CFTypeRef cf) {
314315
static void __CFArrayDeallocate(CFTypeRef cf) {
315316
CFArrayRef array = (CFArrayRef)cf;
316317
BEGIN_MUTATION(array);
318+
#if DEPLOYMENT_TARGET_MACOSX
317319
// Under GC, keep contents alive when we know we can, either standard callbacks or NULL
318320
// if (__CFBitfieldGetValue(cf->info, 5, 4)) return; // bits only ever set under GC
319321
CFAllocatorRef allocator = __CFGetAllocator(array);
@@ -334,6 +336,7 @@ static void __CFArrayDeallocate(CFTypeRef cf) {
334336
return;
335337
}
336338
}
339+
#endif
337340
__CFArrayReleaseValues(array, CFRangeMake(0, __CFArrayGetCount(array)), true);
338341
END_MUTATION(array);
339342
}
@@ -544,7 +547,7 @@ CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex cap
544547
#endif
545548

546549
CFIndex CFArrayGetCount(CFArrayRef array) {
547-
CF_OBJC_FUNCDISPATCH0(__kCFArrayTypeID, CFIndex, array, "count");
550+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, CFIndex, (NSArray *)array, count);
548551
__CFGenericValidateType(array, __kCFArrayTypeID);
549552
CHECK_FOR_MUTATION(array);
550553
return __CFArrayGetCount(array);
@@ -582,7 +585,7 @@ Boolean CFArrayContainsValue(CFArrayRef array, CFRange range, const void *value)
582585
}
583586

584587
const void *CFArrayGetValueAtIndex(CFArrayRef array, CFIndex idx) {
585-
CF_OBJC_FUNCDISPATCH1(__kCFArrayTypeID, void *, array, "objectAtIndex:", idx);
588+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, const void *, (NSArray *)array, objectAtIndex:idx);
586589
__CFGenericValidateType(array, __kCFArrayTypeID);
587590
CFAssert2(0 <= idx && idx < __CFArrayGetCount(array), __kCFLogAssertion, "%s(): index (%d) out of bounds", __PRETTY_FUNCTION__, idx);
588591
CHECK_FOR_MUTATION(array);
@@ -598,7 +601,7 @@ const void *_CFArrayCheckAndGetValueAtIndex(CFArrayRef array, CFIndex idx) {
598601

599602

600603
void CFArrayGetValues(CFArrayRef array, CFRange range, const void **values) {
601-
CF_OBJC_FUNCDISPATCH2(__kCFArrayTypeID, void, array, "getObjects:range:", values, range);
604+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSArray *)array, getObjects:(id *)values range:NSMakeRange(range.location, range.length));
602605
__CFGenericValidateType(array, __kCFArrayTypeID);
603606
__CFArrayValidateRange(array, range, __PRETTY_FUNCTION__);
604607
CFAssert1(NULL != values, __kCFLogAssertion, "%s(): pointer to values may not be NULL", __PRETTY_FUNCTION__);
@@ -682,15 +685,16 @@ CFIndex CFArrayGetLastIndexOfValue(CFArrayRef array, CFRange range, const void *
682685
}
683686

684687
void CFArrayAppendValue(CFMutableArrayRef array, const void *value) {
685-
CF_OBJC_FUNCDISPATCH1(__kCFArrayTypeID, void, array, "addObject:", value);
688+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, addObject:(id)value);
689+
686690
__CFGenericValidateType(array, __kCFArrayTypeID);
687691
CFAssert1(__CFArrayGetType(array) != __kCFArrayImmutable, __kCFLogAssertion, "%s(): array is immutable", __PRETTY_FUNCTION__);
688692
CHECK_FOR_MUTATION(array);
689693
_CFArrayReplaceValues(array, CFRangeMake(__CFArrayGetCount(array), 0), &value, 1);
690694
}
691695

692696
void CFArraySetValueAtIndex(CFMutableArrayRef array, CFIndex idx, const void *value) {
693-
CF_OBJC_FUNCDISPATCH2(__kCFArrayTypeID, void, array, "setObject:atIndex:", value, idx);
697+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, setObject:(id)value atIndex:(NSUInteger)idx);
694698
__CFGenericValidateType(array, __kCFArrayTypeID);
695699
CFAssert1(__CFArrayGetType(array) != __kCFArrayImmutable, __kCFLogAssertion, "%s(): array is immutable", __PRETTY_FUNCTION__);
696700
CFAssert2(0 <= idx && idx <= __CFArrayGetCount(array), __kCFLogAssertion, "%s(): index (%d) out of bounds", __PRETTY_FUNCTION__, idx);
@@ -717,7 +721,7 @@ void CFArraySetValueAtIndex(CFMutableArrayRef array, CFIndex idx, const void *va
717721
}
718722

719723
void CFArrayInsertValueAtIndex(CFMutableArrayRef array, CFIndex idx, const void *value) {
720-
CF_OBJC_FUNCDISPATCH2(__kCFArrayTypeID, void, array, "insertObject:atIndex:", value, idx);
724+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, insertObject:(id)value atIndex:(NSUInteger)idx);
721725
__CFGenericValidateType(array, __kCFArrayTypeID);
722726
CFAssert1(__CFArrayGetType(array) != __kCFArrayImmutable, __kCFLogAssertion, "%s(): array is immutable", __PRETTY_FUNCTION__);
723727
CFAssert2(0 <= idx && idx <= __CFArrayGetCount(array), __kCFLogAssertion, "%s(): index (%d) out of bounds", __PRETTY_FUNCTION__, idx);
@@ -730,7 +734,7 @@ void CFArrayInsertValueAtIndex(CFMutableArrayRef array, CFIndex idx, const void
730734
void CFArrayExchangeValuesAtIndices(CFMutableArrayRef array, CFIndex idx1, CFIndex idx2) {
731735
const void *tmp;
732736
struct __CFArrayBucket *bucket1, *bucket2;
733-
CF_OBJC_FUNCDISPATCH2(__kCFArrayTypeID, void, array, "exchangeObjectAtIndex:withObjectAtIndex:", idx1, idx2);
737+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2);
734738
__CFGenericValidateType(array, __kCFArrayTypeID);
735739
CFAssert2(0 <= idx1 && idx1 < __CFArrayGetCount(array), __kCFLogAssertion, "%s(): index #1 (%d) out of bounds", __PRETTY_FUNCTION__, idx1);
736740
CFAssert2(0 <= idx2 && idx2 < __CFArrayGetCount(array), __kCFLogAssertion, "%s(): index #2 (%d) out of bounds", __PRETTY_FUNCTION__, idx2);
@@ -748,7 +752,7 @@ void CFArrayExchangeValuesAtIndices(CFMutableArrayRef array, CFIndex idx1, CFInd
748752
}
749753

750754
void CFArrayRemoveValueAtIndex(CFMutableArrayRef array, CFIndex idx) {
751-
CF_OBJC_FUNCDISPATCH1(__kCFArrayTypeID, void, array, "removeObjectAtIndex:", idx);
755+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, removeObjectAtIndex:(NSUInteger)idx);
752756
__CFGenericValidateType(array, __kCFArrayTypeID);
753757
CFAssert1(__CFArrayGetType(array) != __kCFArrayImmutable, __kCFLogAssertion, "%s(): array is immutable", __PRETTY_FUNCTION__);
754758
CFAssert2(0 <= idx && idx < __CFArrayGetCount(array), __kCFLogAssertion, "%s(): index (%d) out of bounds", __PRETTY_FUNCTION__, idx);
@@ -757,7 +761,7 @@ void CFArrayRemoveValueAtIndex(CFMutableArrayRef array, CFIndex idx) {
757761
}
758762

759763
void CFArrayRemoveAllValues(CFMutableArrayRef array) {
760-
CF_OBJC_FUNCDISPATCH0(__kCFArrayTypeID, void, array, "removeAllObjects");
764+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, removeAllObjects);
761765
__CFGenericValidateType(array, __kCFArrayTypeID);
762766
CFAssert1(__CFArrayGetType(array) != __kCFArrayImmutable, __kCFLogAssertion, "%s(): array is immutable", __PRETTY_FUNCTION__);
763767
CHECK_FOR_MUTATION(array);
@@ -905,7 +909,7 @@ void _CFArraySetCapacity(CFMutableArrayRef array, CFIndex cap) {
905909

906910

907911
void CFArrayReplaceValues(CFMutableArrayRef array, CFRange range, const void **newValues, CFIndex newCount) {
908-
CF_OBJC_FUNCDISPATCH3(__kCFArrayTypeID, void, array, "replaceObjectsInRange:withObjects:count:", range, (void **)newValues, newCount);
912+
CF_OBJC_FUNCDISPATCHV(__kCFArrayTypeID, void, (NSMutableArray *)array, replaceObjectsInRange:NSMakeRange(range.location, range.length) withObjects:(id *)newValues count:(NSUInteger)newCount);
909913
__CFGenericValidateType(array, __kCFArrayTypeID);
910914
__CFArrayValidateRange(array, range, __PRETTY_FUNCTION__);
911915
CFAssert1(__CFArrayGetType(array) != __kCFArrayImmutable, __kCFLogAssertion, "%s(): array is immutable", __PRETTY_FUNCTION__);
@@ -1037,7 +1041,7 @@ void CFArraySortValues(CFMutableArrayRef array, CFRange range, CFComparatorFunct
10371041
Boolean immutable = false;
10381042
if (CF_IS_OBJC(__kCFArrayTypeID, array)) {
10391043
BOOL result;
1040-
CF_OBJC_CALL1(BOOL, result, array, "isKindOfClass:", objc_lookUpClass("NSMutableArray"));
1044+
result = CF_OBJC_CALLV((NSMutableArray *)array, isKindOfClass:[NSMutableArray class]);
10411045
immutable = !result;
10421046
} else if (__kCFArrayImmutable == __CFArrayGetType(array)) {
10431047
immutable = true;

CFArray.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323

2424
/* CFArray.h
25-
Copyright (c) 1998-2011, Apple Inc. All rights reserved.
25+
Copyright (c) 1998-2012, Apple Inc. All rights reserved.
2626
*/
2727

2828
/*!
@@ -69,6 +69,7 @@
6969

7070
#include <CoreFoundation/CFBase.h>
7171

72+
CF_IMPLICIT_BRIDGING_ENABLED
7273
CF_EXTERN_C_BEGIN
7374

7475
/*!
@@ -689,6 +690,7 @@ CF_EXPORT
689690
void CFArrayAppendArray(CFMutableArrayRef theArray, CFArrayRef otherArray, CFRange otherRange);
690691

691692
CF_EXTERN_C_END
693+
CF_IMPLICIT_BRIDGING_DISABLED
692694

693695
#endif /* ! __COREFOUNDATION_CFARRAY__ */
694696

0 commit comments

Comments
 (0)