Differences From Artifact [3f36b9543e]:
- File src/OFString.m — part of check-in [7aa23887d0] at 2020-11-07 10:38:49 on branch trunk — Make GCC happy again (user: js, size: 65932) [annotate] [blame] [check-ins using] [more...]
To Artifact [8c96d0cf6e]:
- File
src/OFString.m
— part of check-in
[627511b032]
at
2020-11-14 12:23:55
on branch trunk
— Rename of_malloc and of_calloc
The new names should be more accurate. (user: js, size: 65922) [annotate] [blame] [check-ins using] [more...]
︙ | |||
1017 1018 1019 1020 1021 1022 1023 | 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 | - + | /* * We need one extra byte for the terminating zero if we want * to use -[initWithUTF8StringNoCopy:length:freeWhenDone:]. */ if (SIZE_MAX - (size_t)fileSize < 1) @throw [OFOutOfRangeException exception]; |
︙ | |||
1378 1379 1380 1381 1382 1383 1384 | 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 | - + | { size_t length = self.length; char *cString; size_t cStringLength; switch (encoding) { case OF_STRING_ENCODING_UTF_8: |
︙ | |||
1411 1412 1413 1414 1415 1416 1417 | 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 | - + | case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: case OF_STRING_ENCODING_CODEPAGE_858: case OF_STRING_ENCODING_MAC_ROMAN: case OF_STRING_ENCODING_KOI8_R: case OF_STRING_ENCODING_KOI8_U: |
︙ | |||
1865 1866 1867 1868 1869 1870 1871 | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 | - + | if (range.length > SIZE_MAX / sizeof(of_unichar_t)) @throw [OFOutOfRangeException exception]; pool = objc_autoreleasePoolPush(); searchCharacters = string.characters; |
︙ | |||
1933 1934 1935 1936 1937 1938 1939 | 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 | - + | if (range.length == 0) return OF_NOT_FOUND; if (range.length > SIZE_MAX / sizeof(of_unichar_t)) @throw [OFOutOfRangeException exception]; |
︙ | |||
2176 2177 2178 2179 2180 2181 2182 | 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 | - + | of_unichar_t *tmp; size_t prefixLength; bool hasPrefix; if ((prefixLength = prefix.length) > self.length) return false; |
︙ | |||
2206 2207 2208 2209 2210 2211 2212 | 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 | - + | bool hasSuffix; if ((suffixLength = suffix.length) > self.length) return false; length = self.length; |
︙ | |||
2499 2500 2501 2502 2503 2504 2505 | 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 | - + | } - (const of_unichar_t *)characters { size_t length = self.length; of_unichar_t *buffer; |
︙ | |||
2529 2530 2531 2532 2533 2534 2535 | 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 | - + | const of_unichar_t *characters = self.characters; size_t length = self.length; of_char16_t *buffer; size_t j; bool swap = (byteOrder != OF_BYTE_ORDER_NATIVE); /* Allocate memory for the worst case */ |
︙ | |||
2601 2602 2603 2604 2605 2606 2607 | 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 | - + | } - (const of_char32_t *)UTF32StringWithByteOrder: (of_byte_order_t)byteOrder { size_t length = self.length; of_char32_t *buffer; |
︙ |