Skip to content

Commit 3ad6c00

Browse files
committed
Remove comment and error from 1999
Remove the same warning from CFUUIDGetConstantUUIDWithBytes We can do this as it's the same function as CreateWithBytes, except a different value for the third parameter is passed to __CFUUIDCreateWithBytesPrimitive
1 parent de5f7ed commit 3ad6c00

File tree

1 file changed

+5
-44
lines changed

1 file changed

+5
-44
lines changed

CoreFoundation/Base.subproj/CFUUID.c

+5-44
Original file line numberDiff line numberDiff line change
@@ -175,25 +175,8 @@ CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc) {
175175
return (retval == 0) ? __CFUUIDCreateWithBytesPrimitive(alloc, bytes, false) : NULL;
176176
}
177177

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;
178+
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) {
179+
CFUUIDBytes bytes = {byte0, byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15};
197180

198181
return __CFUUIDCreateWithBytesPrimitive(alloc, bytes, false);
199182
}
@@ -338,32 +321,10 @@ CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid) {
338321
return str;
339322
}
340323

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;
360-
361-
// The analyzer can't understand functions like __CFUUIDCreateWithBytesPrimitive which return retained objects based on a parameter.
362-
#ifdef __clang_analyzer__
363-
return NULL;
364-
#else
324+
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) {
325+
CFUUIDBytes bytes = {byte0, byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15};
326+
365327
return __CFUUIDCreateWithBytesPrimitive(alloc, bytes, true);
366-
#endif
367328
}
368329

369330
CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid) {

0 commit comments

Comments
 (0)