Differences From Artifact [e2512a1c1d]:
- File src/OFMutableUTF8String.m — part of check-in [4fbdca698c] at 2020-11-07 20:23:04 on branch trunk — OFObject: Remove -[allocMemoryWithSize:] (user: js, size: 19762) [annotate] [blame] [check-ins using] [more...]
To Artifact [32655d5053]:
- File
src/OFMutableUTF8String.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: 19759) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
97 98 99 100 101 102 103 | _s->cString[i] = t; } return; } unicodeLen = self.length; | | | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | _s->cString[i] = t; } return; } unicodeLen = self.length; unicodeString = of_alloc(unicodeLen, sizeof(of_unichar_t)); i = j = 0; newCStringLength = 0; while (i < _s->cStringLength) { const of_unichar_t *const *table; size_t tableSize; |
︙ | ︙ | |||
151 152 153 154 155 156 157 | @throw [OFInvalidEncodingException exception]; } i += cLen; } @try { | | | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | @throw [OFInvalidEncodingException exception]; } i += cLen; } @try { newCString = of_alloc(newCStringLength + 1, 1); } @catch (id e) { free(unicodeString); @throw e; } j = 0; |
︙ | ︙ | |||
371 372 373 374 375 376 377 | } else _s->isUTF8 = true; } - (void)appendCharacters: (const of_unichar_t *)characters length: (size_t)length { | | | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | } else _s->isUTF8 = true; } - (void)appendCharacters: (const of_unichar_t *)characters length: (size_t)length { char *tmp = of_alloc((length * 4) + 1, 1); @try { size_t j = 0; bool isUTF8 = false; for (size_t i = 0; i < length; i++) { size_t len = of_string_utf8_encode(characters[i], |
︙ | ︙ |