@@ -115,15 +115,16 @@ static CFUUIDRef __CFUUIDCreateWithBytesPrimitive(CFAllocatorRef allocator, CFUU
115
115
116
116
uuid -> _bytes = bytes ;
117
117
__CFUUIDAddUniqueUUIDHasLock (uuid );
118
- } else if (!isConst ) {
119
- CFRetain (uuid );
118
+ return ;
120
119
}
121
-
122
- if (isConst ) {
120
+
123
121
#if !DEPLOYMENT_RUNTIME_SWIFT
122
+ if (isConst ) {
124
123
__CFRuntimeSetRC (uuid , 0 ); // constant CFUUIDs should be immortal. This applies even to equivalent UUIDs created earlier that were *not* constant.
124
+ else
125
+ CFRetain (uuid );
125
126
#else
126
- CFRetain (uuid ); // Swift doesn't support meddling with the retain count. Just ensure there is one retain here.
127
+ CFRetain (uuid ); // Swift doesn't support meddling with the retain count. Just ensure there is one retain here.
127
128
#endif
128
129
}
129
130
});
@@ -175,25 +176,8 @@ CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc) {
175
176
return (retval == 0 ) ? __CFUUIDCreateWithBytesPrimitive (alloc , bytes , false) : NULL ;
176
177
}
177
178
178
- CFUUIDRef CFUUIDCreateWithBytes (CFAllocatorRef alloc , uint8_t byte0 , uint8_t byte1 , uint8_t byte2 , uint8_t byte3 , uint8_t byte4 , uint8_t byte5 , uint8_t byte6 , uint8_t byte7 , uint8_t byte8 , uint8_t byte9 , uint8_t byte10 , uint8_t byte11 , uint8_t byte12 , uint8_t byte13 , uint8_t byte14 , uint8_t byte15 ) {
179
- CFUUIDBytes bytes ;
180
- // CodeWarrior can't handle the structure assignment of bytes, so we must explode this - REW, 10/8/99
181
- bytes .byte0 = byte0 ;
182
- bytes .byte1 = byte1 ;
183
- bytes .byte2 = byte2 ;
184
- bytes .byte3 = byte3 ;
185
- bytes .byte4 = byte4 ;
186
- bytes .byte5 = byte5 ;
187
- bytes .byte6 = byte6 ;
188
- bytes .byte7 = byte7 ;
189
- bytes .byte8 = byte8 ;
190
- bytes .byte9 = byte9 ;
191
- bytes .byte10 = byte10 ;
192
- bytes .byte11 = byte11 ;
193
- bytes .byte12 = byte12 ;
194
- bytes .byte13 = byte13 ;
195
- bytes .byte14 = byte14 ;
196
- bytes .byte15 = byte15 ;
179
+ CFUUIDRef CFUUIDCreateWithBytes (CFAllocatorRef alloc , UInt8 byte0 , UInt8 byte1 , UInt8 byte2 , UInt8 byte3 , UInt8 byte4 , UInt8 byte5 , UInt8 byte6 , UInt8 byte7 , UInt8 byte8 , UInt8 byte9 , UInt8 byte10 , UInt8 byte11 , UInt8 byte12 , UInt8 byte13 , UInt8 byte14 , UInt8 byte15 ) {
180
+ CFUUIDBytes bytes = {byte0 , byte1 , byte2 , byte3 , byte4 , byte5 , byte6 , byte7 , byte8 , byte9 , byte10 , byte11 , byte12 , byte13 , byte14 , byte15 };
197
181
198
182
return __CFUUIDCreateWithBytesPrimitive (alloc , bytes , false);
199
183
}
@@ -338,25 +322,8 @@ CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid) {
338
322
return str ;
339
323
}
340
324
341
- CFUUIDRef CFUUIDGetConstantUUIDWithBytes (CFAllocatorRef alloc , uint8_t byte0 , uint8_t byte1 , uint8_t byte2 , uint8_t byte3 , uint8_t byte4 , uint8_t byte5 , uint8_t byte6 , uint8_t byte7 , uint8_t byte8 , uint8_t byte9 , uint8_t byte10 , uint8_t byte11 , uint8_t byte12 , uint8_t byte13 , uint8_t byte14 , uint8_t byte15 ) {
342
- CFUUIDBytes bytes ;
343
- // CodeWarrior can't handle the structure assignment of bytes, so we must explode this - REW, 10/8/99
344
- bytes .byte0 = byte0 ;
345
- bytes .byte1 = byte1 ;
346
- bytes .byte2 = byte2 ;
347
- bytes .byte3 = byte3 ;
348
- bytes .byte4 = byte4 ;
349
- bytes .byte5 = byte5 ;
350
- bytes .byte6 = byte6 ;
351
- bytes .byte7 = byte7 ;
352
- bytes .byte8 = byte8 ;
353
- bytes .byte9 = byte9 ;
354
- bytes .byte10 = byte10 ;
355
- bytes .byte11 = byte11 ;
356
- bytes .byte12 = byte12 ;
357
- bytes .byte13 = byte13 ;
358
- bytes .byte14 = byte14 ;
359
- bytes .byte15 = byte15 ;
325
+ CFUUIDRef CFUUIDGetConstantUUIDWithBytes (CFAllocatorRef alloc , UInt8 byte0 , UInt8 byte1 , UInt8 byte2 , UInt8 byte3 , UInt8 byte4 , UInt8 byte5 , UInt8 byte6 , UInt8 byte7 , UInt8 byte8 , UInt8 byte9 , UInt8 byte10 , UInt8 byte11 , UInt8 byte12 , UInt8 byte13 , UInt8 byte14 , UInt8 byte15 ) {
326
+ CFUUIDBytes bytes = {byte0 , byte1 , byte2 , byte3 , byte4 , byte5 , byte6 , byte7 , byte8 , byte9 , byte10 , byte11 , byte12 , byte13 , byte14 , byte15 };
360
327
361
328
// The analyzer can't understand functions like __CFUUIDCreateWithBytesPrimitive which return retained objects based on a parameter.
362
329
#ifdef __clang_analyzer__
0 commit comments