Differences From Artifact [3eca7b4ec4]:
- File
src/OFObject+KeyValueCoding.m
— part of check-in
[09a0d12bae]
at
2016-06-05 21:17:57
on branch trunk
— Always cast to unsigned char for to{upper,lower}()
This is required as passing something signed to it is an error on
NetBSD, but passing anything else than a char is undefined on Linux. (user: js, size: 5694) [annotate] [blame] [check-ins using]
To Artifact [3802a76383]:
- File
src/OFObject+KeyValueCoding.m
— part of check-in
[d9eb7b50b3]
at
2017-01-07 00:37:26
on branch trunk
— Add of_ascii_{to{upper,lower},is{alpha,alnum}}
These are independent of the locale and work on the ASCII character set.
Unlike the C ones, these are 8-bit safe, meaning if a character > 0x7F
is passed, is{alpha,alnum} returns false and to{upper,lower} returns the
original character. (user: js, size: 5682) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
60 61 62 63 64 65 66 | exceptionWithRequestedSize: keyLength + 3]; @try { memcpy(name, "is", 2); memcpy(name + 2, [key UTF8String], keyLength); name[keyLength + 2] = '\0'; | | | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | exceptionWithRequestedSize: keyLength + 3]; @try { memcpy(name, "is", 2); memcpy(name + 2, [key UTF8String], keyLength); name[keyLength + 2] = '\0'; name[2] = of_ascii_toupper(name[2]); selector = sel_registerName(name); } @finally { free(name); } typeEncoding = [self typeEncodingForSelector: selector]; |
︙ | ︙ | |||
142 143 144 145 146 147 148 | exceptionWithRequestedSize: keyLength + 5]; @try { memcpy(name, "set", 3); memcpy(name + 3, [key UTF8String], keyLength); memcpy(name + keyLength + 3, ":", 2); | | | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | exceptionWithRequestedSize: keyLength + 5]; @try { memcpy(name, "set", 3); memcpy(name + 3, [key UTF8String], keyLength); memcpy(name + keyLength + 3, ":", 2); name[3] = of_ascii_toupper(name[3]); selector = sel_registerName(name); } @finally { free(name); } typeEncoding = [self typeEncodingForSelector: selector]; |
︙ | ︙ |