Differences From Artifact [c460dbfe91]:
- File
src/OFString_UTF8.m
— part of check-in
[5e2ef97c35]
at
2016-03-13 11:19:13
on branch trunk
— Change of_string_utf8_decode() API
It now returns <= 0 on error, with negative values being the number of
bytes it would have needed * -1.This can be used to detect cut off and how many bytes are missing. (user: js, size: 28090) [annotate] [blame] [check-ins using]
To Artifact [f214cc2fb6]:
- File
src/OFString_UTF8.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: 28142) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
42 43 44 45 46 47 48 | extern const of_char16_t of_windows_1252[128]; extern const of_char16_t of_codepage_437[128]; static inline int memcasecmp(const char *first, const char *second, size_t length) { for (size_t i = 0; i < length; i++) { | | > | > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | extern const of_char16_t of_windows_1252[128]; extern const of_char16_t of_codepage_437[128]; static inline int memcasecmp(const char *first, const char *second, size_t length) { for (size_t i = 0; i < length; i++) { if (tolower((unsigned char)first[i]) > tolower((unsigned char)second[i])) return OF_ORDERED_DESCENDING; if (tolower((unsigned char)first[i]) < tolower((unsigned char)second[i])) return OF_ORDERED_ASCENDING; } return OF_ORDERED_SAME; } int |
︙ | ︙ |