Differences From Artifact [27e43ba467]:
- File
src/OFDataArray.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 14593) [annotate] [blame] [check-ins using]
To Artifact [c249bb8623]:
- File src/OFDataArray.m — part of check-in [e0b9167693] at 2016-02-21 15:37:42 on branch trunk — Make use of C99-style for loops (user: js, size: 14583) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
265 266 267 268 269 270 271 | } #endif - initWithStringRepresentation: (OFString*)string { @try { const char *cString; | | | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | } #endif - initWithStringRepresentation: (OFString*)string { @try { const char *cString; size_t count; count = [string cStringLengthWithEncoding: OF_STRING_ENCODING_ASCII]; if (count % 2 != 0) @throw [OFInvalidFormatException exception]; count /= 2; self = [self initWithCapacity: count]; cString = [string cStringWithEncoding: OF_STRING_ENCODING_ASCII]; for (size_t i = 0; i < count; i++) { uint8_t c1 = cString[2 * i]; uint8_t c2 = cString[2 * i + 1]; uint8_t byte; if (c1 >= '0' && c1 <= '9') byte = (c1 - '0') << 4; else if (c1 >= 'a' && c1 <= 'f') |
︙ | ︙ | |||
567 568 569 570 571 572 573 | else return OF_ORDERED_ASCENDING; } - (uint32_t)hash { uint32_t hash; | < | < | < < | < | | | 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | else return OF_ORDERED_ASCENDING; } - (uint32_t)hash { uint32_t hash; OF_HASH_INIT(hash); for (size_t i = 0; i < _count * _itemSize; i++) OF_HASH_ADD(hash, ((uint8_t*)_items)[i]); OF_HASH_FINALIZE(hash); return hash; } - (OFString*)description { OFMutableString *ret = [OFMutableString stringWithString: @"<"]; for (size_t i = 0; i < _count; i++) { if (i > 0) [ret appendString: @" "]; for (size_t j = 0; j < _itemSize; j++) [ret appendFormat: @"%02x", _items[i * _itemSize + j]]; } [ret appendString: @">"]; [ret makeImmutable]; return ret; } - (OFString*)stringRepresentation { OFMutableString *ret = [OFMutableString string]; for (size_t i = 0; i < _count; i++) for (size_t j = 0; j < _itemSize; j++) [ret appendFormat: @"%02x", _items[i * _itemSize + j]]; [ret makeImmutable]; return ret; } - (OFString*)stringByBase64Encoding |
︙ | ︙ |