Skip to content

Commit b85b0a1

Browse files
committed
Preliminary work to get swift-corelibs-foundation's package branch building for Darwin.
The tests do not yet run on Darwin, but it does pass tests for other platforms. This patch also updates the contents of the CF Unicode data tables, bringing them up to date.
1 parent d8f1bfe commit b85b0a1

File tree

109 files changed

+37777
-1565
lines changed

Some content is hidden

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

109 files changed

+37777
-1565
lines changed

Package.swift

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33

44
import PackageDescription
55

6-
let buildSettings: [CSetting] = [
6+
let coreFoundationBuildSettings: [CSetting] = [
77
.headerSearchPath("internalInclude"),
88
.define("DEBUG", .when(configuration: .debug)),
99
.define("CF_BUILDING_CF"),
10-
.define("DEPLOYMENT_RUNTIME_SWIFT"),
10+
.define("DEPLOYMENT_RUNTIME_SWIFT", .when(platforms: [.linux])),
1111
.define("DEPLOYMENT_ENABLE_LIBDISPATCH"),
1212
.define("HAVE_STRUCT_TIMESPEC"),
1313
.define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"),
1414
.define("_GNU_SOURCE", .when(platforms: [.linux, .android])),
15-
.define("CF_CHARACTERSET_UNICODE_DATA_L", to: "\"\(Context.packageDirectory)/Sources/CoreFoundation/CFUnicodeData-L.mapping\""),
16-
.define("CF_CHARACTERSET_UNICODE_DATA_B", to: "\"\(Context.packageDirectory)/Sources/CoreFoundation/CFUnicodeData-B.mapping\""),
17-
.define("CF_CHARACTERSET_UNICHAR_DB", to: "\"\(Context.packageDirectory)/Sources/CoreFoundation/CFUniCharPropertyDatabase.data\""),
18-
.define("CF_CHARACTERSET_BITMAP", to: "\"\(Context.packageDirectory)/Sources/CoreFoundation/CFCharacterSetBitmaps.bitmap\""),
15+
.define("TARGET_OS_WASI", to: "0", .when(platforms: [.macOS])),
16+
.define("TARGET_OS_BSD", to: "0", .when(platforms: [.macOS])),
17+
.define("INCLUDE_OBJC", to: "1", .when(platforms: [.macOS])),
1918
.unsafeFlags([
2019
"-Wno-shorten-64-to-32",
2120
"-Wno-deprecated-declarations",
@@ -29,11 +28,26 @@ let buildSettings: [CSetting] = [
2928
"-fdollars-in-identifiers",
3029
"-fno-common",
3130
"-fcf-runtime-abi=swift",
31+
"-include",
32+
"\(Context.packageDirectory)/Sources/CoreFoundation/internalInclude/CoreFoundation_Prefix.h",
3233
// /EHsc for Windows
3334
]),
3435
.unsafeFlags(["-I/usr/lib/swift"], .when(platforms: [.linux, .android])) // dispatch
3536
]
3637

38+
#if os(macOS)
39+
let coreFoundationLinkerSettings: [LinkerSetting] = [
40+
.unsafeFlags([
41+
"-Xlinker",
42+
"-alias_list",
43+
"-Xlinker",
44+
"\(Context.packageDirectory)/Sources/CoreFoundation/DarwinSymbolAliases",
45+
])
46+
]
47+
#else
48+
let coreFoundationLinkerSettings: [LinkerSetting] = []
49+
#endif
50+
3751
// For _CFURLSessionInterface, _CFXMLInterface
3852
let interfaceBuildSettings: [CSetting] = [
3953
.headerSearchPath("../CoreFoundation/internalInclude"),
@@ -45,6 +59,9 @@ let interfaceBuildSettings: [CSetting] = [
4559
.define("HAVE_STRUCT_TIMESPEC"),
4660
.define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"),
4761
.define("_GNU_SOURCE", .when(platforms: [.linux, .android])),
62+
.define("TARGET_OS_WASI", to: "0", .when(platforms: [.macOS])),
63+
.define("TARGET_OS_BSD", to: "0", .when(platforms: [.macOS])),
64+
.define("INCLUDE_OBJC", to: "1", .when(platforms: [.macOS])),
4865
.unsafeFlags([
4966
"-Wno-shorten-64-to-32",
5067
"-Wno-deprecated-declarations",
@@ -63,6 +80,11 @@ let interfaceBuildSettings: [CSetting] = [
6380
.unsafeFlags(["-I/usr/lib/swift"], .when(platforms: [.linux, .android])) // dispatch
6481
]
6582

83+
let swiftBuildSettings: [SwiftSetting] = [
84+
.define("DEPLOYMENT_RUNTIME_SWIFT"),
85+
.define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS"),
86+
]
87+
6688
let package = Package(
6789
name: "swift-corelibs-foundation",
6890
platforms: [.macOS("13.3"), .iOS("16.4"), .tvOS("16.4"), .watchOS("9.4")],
@@ -77,8 +99,8 @@ let package = Package(
7799
url: "https://github.com/apple/swift-foundation-icu",
78100
from: "0.0.5"),
79101
.package(
80-
url: "https://github.com/apple/swift-foundation",
81-
revision: "7eb8b598ad8f77ac743b2decc97d56bf350aedee"
102+
url: "https://github.com/apple/swift-foundation",
103+
revision: "7eb8b598ad8f77ac743b2decc97d56bf350aedee"
82104
),
83105
],
84106
targets: [
@@ -90,7 +112,7 @@ let package = Package(
90112
"_CoreFoundation"
91113
],
92114
path: "Sources/Foundation",
93-
swiftSettings: [.define("DEPLOYMENT_RUNTIME_SWIFT"), .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS")]
115+
swiftSettings: swiftBuildSettings
94116
),
95117
.target(
96118
name: "FoundationXML",
@@ -101,7 +123,7 @@ let package = Package(
101123
"_CFXMLInterface"
102124
],
103125
path: "Sources/FoundationXML",
104-
swiftSettings: [.define("DEPLOYMENT_RUNTIME_SWIFT"), .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS")]
126+
swiftSettings: swiftBuildSettings
105127
),
106128
.target(
107129
name: "FoundationNetworking",
@@ -112,15 +134,16 @@ let package = Package(
112134
"_CFURLSessionInterface"
113135
],
114136
path: "Sources/FoundationNetworking",
115-
swiftSettings: [.define("DEPLOYMENT_RUNTIME_SWIFT"), .define("SWIFT_CORELIBS_FOUNDATION_HAS_THREADS")]
137+
swiftSettings:swiftBuildSettings
116138
),
117139
.target(
118140
name: "_CoreFoundation",
119141
dependencies: [
120142
.product(name: "FoundationICU", package: "swift-foundation-icu"),
121143
],
122144
path: "Sources/CoreFoundation",
123-
cSettings: buildSettings
145+
cSettings: coreFoundationBuildSettings,
146+
linkerSettings: coreFoundationLinkerSettings
124147
),
125148
.target(
126149
name: "_CFXMLInterface",

Sources/CoreFoundation/CFCharacterSet.c

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
#include "CFUniCharPriv.h"
2020
#include <stdlib.h>
2121
#include <string.h>
22+
#include "CFPriv.h"
2223
#include <unicode/uchar.h>
23-
24+
#include <unicode/uset.h>
2425

2526
#define BITSPERBYTE 8 /* (CHAR_BIT * sizeof(unsigned char)) */
2627
#define LOG_BPB 3
@@ -104,57 +105,63 @@ enum {
104105
__kCFCharSetClassCompactBitmap = 4,
105106
};
106107

108+
#define __CFCSetInfoFlagVariantHighBit (6)
109+
#define __CFCSetInfoFlagVariantLowBit (4)
110+
#define __CFCSetInfoFlagInvertedBit (3)
111+
#define __CFCSetInfoFlagHasHashBit (2)
112+
#define __CFCSetInfoFlagIsMutableBit (0)
113+
107114
/* Inline accessor macros for _base._info
108115
*/
109116
CF_INLINE Boolean __CFCSetIsMutable(CFCharacterSetRef cset) {
110117
return __CFRuntimeGetFlag(cset, 0);
111118
}
112119

113120
CF_INLINE Boolean __CFCSetIsBuiltin(CFCharacterSetRef cset) {
114-
return __CFRuntimeGetValue(cset, 6, 4) == __kCFCharSetClassBuiltin;
121+
return __CFRuntimeGetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit) == __kCFCharSetClassBuiltin;
115122
}
116123

117124
CF_INLINE Boolean __CFCSetIsRange(CFCharacterSetRef cset) {
118-
return __CFRuntimeGetValue(cset, 6, 4) == __kCFCharSetClassRange;
125+
return __CFRuntimeGetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit) == __kCFCharSetClassRange;
119126
}
120127

121128
CF_INLINE Boolean __CFCSetIsString(CFCharacterSetRef cset) {
122-
return __CFRuntimeGetValue(cset, 6, 4) == __kCFCharSetClassString;
129+
return __CFRuntimeGetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit) == __kCFCharSetClassString;
123130
}
124131

125132
CF_INLINE Boolean __CFCSetIsBitmap(CFCharacterSetRef cset) {
126-
return __CFRuntimeGetValue(cset, 6, 4) == __kCFCharSetClassBitmap;
133+
return __CFRuntimeGetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit) == __kCFCharSetClassBitmap;
127134
}
128135
CF_INLINE Boolean __CFCSetIsCompactBitmap(CFCharacterSetRef cset) {
129-
return __CFRuntimeGetValue(cset, 6, 4) == __kCFCharSetClassCompactBitmap;
136+
return __CFRuntimeGetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit) == __kCFCharSetClassCompactBitmap;
130137
}
131138

132139
CF_INLINE UInt32 __CFCSetClassType(CFCharacterSetRef cset) {
133-
return __CFRuntimeGetValue(cset, 6, 4);
140+
return __CFRuntimeGetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit);
134141
}
135142

136143
CF_INLINE Boolean __CFCSetIsInverted(CFCharacterSetRef cset) {
137-
return __CFRuntimeGetFlag(cset, 3);
144+
return __CFRuntimeGetFlag(cset, __CFCSetInfoFlagInvertedBit);
138145
}
139146

140147
CF_INLINE Boolean __CFCSetHasHashValue(CFCharacterSetRef cset) {
141-
return __CFRuntimeGetFlag(cset, 2);
148+
return __CFRuntimeGetFlag(cset, __CFCSetInfoFlagHasHashBit);
142149
}
143150

144151
CF_INLINE void __CFCSetPutIsMutable(CFMutableCharacterSetRef cset, Boolean isMutable) {
145-
__CFRuntimeSetFlag(cset, 0, isMutable);
152+
__CFRuntimeSetFlag(cset, __CFCSetInfoFlagIsMutableBit, isMutable);
146153
}
147154

148155
CF_INLINE void __CFCSetPutIsInverted(CFMutableCharacterSetRef cset, Boolean isInverted) {
149-
__CFRuntimeSetFlag(cset, 3, isInverted);
156+
__CFRuntimeSetFlag(cset, __CFCSetInfoFlagInvertedBit, isInverted);
150157
}
151158

152159
CF_INLINE void __CFCSetPutHasHashValue(CFMutableCharacterSetRef cset, Boolean hasHash) {
153-
__CFRuntimeSetFlag(cset, 2, hasHash);
160+
__CFRuntimeSetFlag(cset, __CFCSetInfoFlagHasHashBit, hasHash);
154161
}
155162

156163
CF_INLINE void __CFCSetPutClassType(CFMutableCharacterSetRef cset, UInt32 classType) {
157-
__CFRuntimeSetValue(cset, 6, 4, classType);
164+
__CFRuntimeSetValue(cset, __CFCSetInfoFlagVariantHighBit, __CFCSetInfoFlagVariantLowBit, classType);
158165
}
159166

160167
CF_PRIVATE Boolean __CFCharacterSetIsMutable(CFCharacterSetRef cset) {
@@ -181,13 +188,13 @@ CF_INLINE void __CFCSetPutCompactBitmapBits(CFMutableCharacterSetRef cset, uint8
181188

182189
/* Validation funcs
183190
*/
184-
185191
CF_INLINE void __CFCSetValidateBuiltinType(CFCharacterSetPredefinedSet type, const char *func) {
186192
if (type < __kCFFirstBuiltinSetID || type > __kCFLastBuiltinSetID) {
187193
CFLog(__kCFLogAssertion, CFSTR("%s: Unknown builtin type %ld"), func, (long)type);
188194
HALT_MSG("Unknown builtin CFCharacterSet type");
189195
}
190196
}
197+
191198
CF_INLINE void __CFCSetValidateTypeAndMutability(CFCharacterSetRef cset, const char *func) {
192199
__CFGenericValidateType(cset, _kCFRuntimeIDCFCharacterSet);
193200
if (!__CFCSetIsMutable(cset)) {
@@ -196,11 +203,18 @@ CF_INLINE void __CFCSetValidateTypeAndMutability(CFCharacterSetRef cset, const c
196203
}
197204
}
198205

199-
CF_INLINE void __CFCSetValidateRange(CFRange theRange, const char *func) {
200-
if (theRange.location < UCHAR_MIN_VALUE || theRange.location > UCHAR_MAX_VALUE || theRange.length > UCHAR_MAX_VALUE + 1 || theRange.location + theRange.length < UCHAR_MIN_VALUE || theRange.location + theRange.length > UCHAR_MAX_VALUE + 1) {
206+
bool _CFCharacterSetIsValidRange(CFRange theRange) {
207+
return theRange.location >= UCHAR_MIN_VALUE && theRange.location <= UCHAR_MAX_VALUE && theRange.length <= UCHAR_MAX_VALUE + 1 && theRange.location + theRange.length >= UCHAR_MIN_VALUE && theRange.location + theRange.length <= UCHAR_MAX_VALUE + 1;
208+
}
209+
210+
CF_INLINE Boolean __CFCSetValidateRange(CFRange theRange, const char *func) {
211+
if (!_CFCharacterSetIsValidRange(theRange)) {
201212
CFLog(__kCFLogAssertion, CFSTR("%s: Range (location: %ld, length: %ld) outside of valid Unicode range (0x0 - 0x10FFFF)"), func, (long)theRange.location, (long)theRange.length);
202-
HALT_MSG("CFCharacterSet range is outside of valid Unicode range (0x0 - 0x10FFFF)");
213+
HALT_MSG("CFCharacterSet range is outside of valid Unicode range (0x0 - 0x10FFFF)");
214+
215+
return false;
203216
}
217+
return true;
204218
}
205219

206220
/* Inline utility funcs
@@ -524,7 +538,7 @@ static void __CFCheckForExpandedSet(CFCharacterSetRef cset) {
524538
static bool warnedOnce = false;
525539

526540
if (0 > __CFNumberOfPlanesForLogging) {
527-
const char *envVar = __CFgetenv("CFCharacterSetCheckForExpandedSet");
541+
const char *envVar = getenv("CFCharacterSetCheckForExpandedSet");
528542
long value = (envVar ? strtol_l(envVar, NULL, 0, NULL) : 0);
529543
__CFNumberOfPlanesForLogging = (int8_t)(((value > 0) && (value <= 16)) ? value : 0);
530544
}
@@ -1394,9 +1408,12 @@ CFCharacterSetRef CFCharacterSetGetPredefined(CFCharacterSetPredefinedSet theSet
13941408
return cset;
13951409
}
13961410

1411+
13971412
#if DEPLOYMENT_RUNTIME_SWIFT
13981413
Boolean _CFCharacterSetInitWithCharactersInRange(CFMutableCharacterSetRef cset, CFRange theRange) {
1399-
__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__);
1414+
if (!__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__)) {
1415+
return false;
1416+
}
14001417

14011418
if (theRange.length) {
14021419
if (!__CFCSetGenericInit(cset, __kCFCharSetClassRange, false)) return false;
@@ -1412,7 +1429,9 @@ Boolean _CFCharacterSetInitWithCharactersInRange(CFMutableCharacterSetRef cset,
14121429
#endif
14131430

14141431
CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange(CFAllocatorRef allocator, CFRange theRange) {
1415-
__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__);
1432+
if (!__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__)) {
1433+
return NULL;
1434+
}
14161435

14171436
CFMutableCharacterSetRef cset;
14181437

@@ -1634,7 +1653,6 @@ CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation(CFAllocatorRef al
16341653

16351654
CFCharacterSetRef CFCharacterSetCreateInvertedSet(CFAllocatorRef alloc, CFCharacterSetRef theSet) {
16361655
CFMutableCharacterSetRef cset;
1637-
16381656
CF_OBJC_RETAINED_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, CFCharacterSetRef , (NSCharacterSet *)theSet, invertedSet);
16391657

16401658
cset = CFCharacterSetCreateMutableCopy(alloc, theSet);
@@ -2002,7 +2020,7 @@ Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlan
20022020
}
20032021

20042022
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, Boolean, (NSCharacterSet *)theSet, hasMemberInPlane:(uint8_t)thePlane);
2005-
2023+
20062024
if (__CFCSetIsEmpty(theSet)) {
20072025
return (isInverted ? TRUE : FALSE);
20082026
} else if (__CFCSetIsBuiltin(theSet)) {
@@ -2080,7 +2098,7 @@ Boolean CFCharacterSetHasMemberInPlane(CFCharacterSetRef theSet, CFIndex thePlan
20802098

20812099
CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFCharacterSetRef theSet) {
20822100
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, CFDataRef , (NSCharacterSet *)theSet, _retainedBitmapRepresentation);
2083-
2101+
20842102
__CFGenericValidateType(theSet, _kCFRuntimeIDCFCharacterSet);
20852103

20862104
bool isAnnexInverted = (__CFCSetAnnexIsInverted(theSet) != 0);
@@ -2280,9 +2298,11 @@ CFDataRef CFCharacterSetCreateBitmapRepresentation(CFAllocatorRef alloc, CFChara
22802298
/*** MutableCharacterSet functions ***/
22812299
void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange) {
22822300
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, addCharactersInRange:NSMakeRange(theRange.location, theRange.length));
2283-
2301+
22842302
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
2285-
__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__);
2303+
if (!__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__)) {
2304+
return;
2305+
}
22862306

22872307
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
22882308
CFCharacterSetRef sharedSet = CFCharacterSetGetPredefined(__CFCSetBuiltinType((CFCharacterSetRef)theSet));
@@ -2347,9 +2367,11 @@ void CFCharacterSetAddCharactersInRange(CFMutableCharacterSetRef theSet, CFRange
23472367

23482368
void CFCharacterSetRemoveCharactersInRange(CFMutableCharacterSetRef theSet, CFRange theRange) {
23492369
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, removeCharactersInRange:NSMakeRange(theRange.location, theRange.length));
2350-
2370+
23512371
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
2352-
__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__);
2372+
if (!__CFCSetValidateRange(theRange, __PRETTY_FUNCTION__)) {
2373+
return;
2374+
}
23532375

23542376
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
23552377
CFCharacterSetRef sharedSet = CFCharacterSetGetPredefined(__CFCSetBuiltinType((CFCharacterSetRef)theSet));
@@ -2423,7 +2445,7 @@ void CFCharacterSetAddCharactersInString(CFMutableCharacterSetRef theSet, CFStr
24232445
BOOL hasSurrogate = NO;
24242446

24252447
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, addCharactersInString:(NSString *)theString);
2426-
2448+
24272449
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
24282450

24292451
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
@@ -2516,7 +2538,7 @@ void CFCharacterSetRemoveCharactersInString(CFMutableCharacterSetRef theSet, CFS
25162538
BOOL hasSurrogate = NO;
25172539

25182540
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, removeCharactersInString:(NSString *)theString);
2519-
2541+
25202542
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
25212543

25222544
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
@@ -2601,7 +2623,7 @@ void CFCharacterSetUnion(CFMutableCharacterSetRef theSet, CFCharacterSetRef theO
26012623
CFCharacterSetRef expandedSet = NULL;
26022624

26032625
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, formUnionWithCharacterSet:(NSCharacterSet *)theOtherSet);
2604-
2626+
26052627
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
26062628

26072629
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
@@ -2738,7 +2760,7 @@ void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef
27382760
CFCharacterSetRef expandedSet = NULL;
27392761

27402762
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, formIntersectionWithCharacterSet:(NSCharacterSet *)theOtherSet);
2741-
2763+
27422764
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
27432765

27442766
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
@@ -2981,7 +3003,7 @@ void CFCharacterSetIntersect(CFMutableCharacterSetRef theSet, CFCharacterSetRef
29813003
void CFCharacterSetInvert(CFMutableCharacterSetRef theSet) {
29823004

29833005
CF_OBJC_FUNCDISPATCHV(_kCFRuntimeIDCFCharacterSet, void, (NSMutableCharacterSet *)theSet, invert);
2984-
3006+
29853007
__CFCSetValidateTypeAndMutability(theSet, __PRETTY_FUNCTION__);
29863008

29873009
if (__CFCSetIsBuiltin((CFCharacterSetRef)theSet) && !__CFCSetIsMutable((CFCharacterSetRef)theSet) && !__CFCSetIsInverted((CFCharacterSetRef)theSet)) {
@@ -3060,7 +3082,6 @@ void _CFCharacterSetFast(CFMutableCharacterSetRef theSet) {
30603082
}
30613083
}
30623084
}
3063-
30643085
/* Keyed-coding support
30653086
*/
30663087
CFCharacterSetKeyedCodingType _CFCharacterSetGetKeyedCodingType(CFCharacterSetRef cset) {
@@ -3072,7 +3093,7 @@ CFCharacterSetKeyedCodingType _CFCharacterSetGetKeyedCodingType(CFCharacterSetRe
30723093

30733094
case __kCFCharSetClassString: // We have to check if we have non-BMP here
30743095
if (!__CFCSetHasNonBMPPlane(cset) && !__CFCSetAnnexIsInverted(cset)) return kCFCharacterSetKeyedCodingTypeString; // BMP only. we can archive the string
3075-
/* fallthrough */
3096+
CF_FALLTHROUGH;
30763097

30773098
default:
30783099
return kCFCharacterSetKeyedCodingTypeBitmap;

0 commit comments

Comments
 (0)