Comment: | Add of_char{16,32}_t.
For ObjC++, these are defined to char{16,32}_t if C++11 is used. This For C11, this is not necessary, as char{16,32}_t are just typedef'd to |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
545b6f740e6e0ed8ac26392db6abb2cd |
User & Date: | js on 2013-01-13 13:07:52 |
Other Links: | manifest | tags |
2013-01-13
| ||
14:59 | Make it possible to stop run loops. check-in: 3c6ad38d92 user: js tags: trunk | |
13:07 | Add of_char{16,32}_t. check-in: 545b6f740e user: js tags: trunk | |
03:17 | OFBigDataArray: Always keep at least one page. check-in: 9c421b6ff0 user: js tags: trunk | |
Modified src/OFMutableString.m from [086c316216] to [bfd221d698].
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + - + - + - + - + - + - + - + | - initWithCharacters: (const of_unichar_t*)characters length: (size_t)length { return (id)[[OFMutableString_UTF8 alloc] initWithCharacters: characters length: length]; } |
︙ |
Modified src/OFString.h from [208c62cea3] to [0efe0688a9].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | + + + + + + + - + | #import "OFObject.h" #import "OFSerialization.h" #import "OFJSONRepresentation.h" @class OFConstantString; #if defined(__cplusplus) && __cplusplus >= 201103L typedef char16_t of_char16_t; typedef char32_t of_char32_t; #else typedef uint_least16_t of_char16_t; typedef uint_least32_t of_char32_t; #endif |
︙ | |||
150 151 152 153 154 155 156 | 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | - + - + - + - + - + - + - + - + | /*! * @brief Creates a new OFString from a UTF-16 encoded string. * * @param string The UTF-16 string * @return A new autoreleased OFString */ |
︙ | |||
379 380 381 382 383 384 385 | 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 | - + - + - + - + - + - + - + - + | /*! * @brief Initializes an already allocated OFString with a UTF-16 string. * * @param string The UTF-16 string * @return An initialized OFString */ |
︙ | |||
945 946 947 948 949 950 951 | 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 | - + - + - + - + | * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @return The string in UTF-16 encoding with native byte order */ |
︙ | |||
1027 1028 1029 1030 1031 1032 1033 | 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 | - - + + | #endif #ifdef __cplusplus extern "C" { #endif extern size_t of_string_utf8_encode(of_unichar_t, char*); extern size_t of_string_utf8_decode(const char*, size_t, of_unichar_t*); |
Modified src/OFString.m from [cb1b20524f] to [3b195e39ec].
︙ | |||
139 140 141 142 143 144 145 | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | - + - + | return 4; } return 0; } size_t |
︙ | |||
310 311 312 313 314 315 316 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | - + - + - + - + - + - + - + - + | - initWithCharacters: (const of_unichar_t*)string length: (size_t)length { return (id)[[OFString_UTF8 alloc] initWithCharacters: string length: length]; } |
︙ | |||
528 529 530 531 532 533 534 | 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | - + - + - + - + - + - + - + - + | + (instancetype)stringWithCharacters: (const of_unichar_t*)string length: (size_t)length { return [[[self alloc] initWithCharacters: string length: length] autorelease]; } |
︙ | |||
714 715 716 717 718 719 720 | 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 | - + - + - + - + - + - + - + - + | abort(); } @catch (id e) { [self release]; @throw e; } } |
︙ | |||
2118 2119 2120 2121 2122 2123 2124 | 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 | - + - + - + - + | count: length]; [self getCharacters: ret inRange: of_range(0, length)]; return ret; } |
︙ | |||
2166 2167 2168 2169 2170 2171 2172 | 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 | - + | ret[j++] = c; } } ret[j] = 0; @try { ret = [object resizeMemory: ret |
︙ | |||
2191 2192 2193 2194 2195 2196 2197 | 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 | - + - + - + - + | for (i = 0; i < length; i++) if (characters[i] > 0xFFFF) UTF16StringLength++; return UTF16StringLength; } |
︙ |
Modified src/OFString_UTF8.m from [c16c78a6d7] to [5a1fe9d9fc].
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - - + + | #import "OFOutOfRangeException.h" #import "autorelease.h" #import "macros.h" #import "of_asprintf.h" #import "unicode.h" |
︙ | |||
209 210 211 212 213 214 215 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + | encoding: (of_string_encoding_t)encoding length: (size_t)cStringLength { self = [super init]; @try { size_t i, j; |
︙ | |||
462 463 464 465 466 467 468 | 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - + | [self release]; @throw e; } return self; } |
︙ | |||
500 501 502 503 504 505 506 | 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | - + | /* Missing high surrogate */ if ((character & 0xFC00) == 0xDC00) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; if ((character & 0xFC00) == 0xD800) { |
︙ | |||
574 575 576 577 578 579 580 | 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - + | [self release]; @throw e; } return self; } |
︙ | |||
1344 1345 1346 1347 1348 1349 1350 | 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 | - + - + | ret[j++] = c; i += cLen; } return ret; } |
︙ |
Modified src/iso_8859_15.m from [5b72ca9d52] to [7addba02f3].
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + - + | * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ |
︙ |
Modified src/windows_1252.m from [a34be62b96] to [03d37613d5].
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | - + - + | * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ |
︙ |