Differences From Artifact [1eb966f163]:
- File
src/OFDataArray+MessagePackValue.m
— part of check-in
[44f45c2e35]
at
2017-01-09 17:36:36
on branch trunk
— Update copyright
Forgot to add 2017, even though I already did quite some changes in
2017. (user: js, size: 11510) [annotate] [blame] [check-ins using]
To Artifact [d21c98d61f]:
- File
src/OFDataArray+MessagePackValue.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 11516) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
25 26 27 28 29 30 31 | #import "OFDictionary.h" #import "OFMessagePackExtension.h" #import "OFInvalidFormatException.h" int _OFDataArray_MessagePackValue_reference; | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #import "OFDictionary.h" #import "OFMessagePackExtension.h" #import "OFInvalidFormatException.h" int _OFDataArray_MessagePackValue_reference; static size_t parseObject(const uint8_t *, size_t, id *); static uint16_t readUInt16(const uint8_t *buffer) { return ((uint16_t)buffer[0] << 8) | buffer[1]; } |
︙ | ︙ | |||
161 162 163 164 165 166 167 | if ((buffer[0] & 0xE0) == 0xA0) { count = buffer[0] & 0x1F; if (length < count + 1) goto error; *object = [OFString | | | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | if ((buffer[0] & 0xE0) == 0xA0) { count = buffer[0] & 0x1F; if (length < count + 1) goto error; *object = [OFString stringWithUTF8String: (const char *)buffer + 1 length: count]; return count + 1; } /* fixarray */ if ((buffer[0] & 0xF0) == 0x90) return parseArray(buffer + 1, length - 1, object, |
︙ | ︙ | |||
491 492 493 494 495 496 497 | count = buffer[1]; if (length < count + 2) goto error; *object = [OFString | | | | | 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | count = buffer[1]; if (length < count + 2) goto error; *object = [OFString stringWithUTF8String: (const char *)buffer + 2 length: count]; return count + 2; case 0xDA: /* str 16 */ if (length < 3) goto error; count = readUInt16(buffer + 1); if (length < count + 3) goto error; *object = [OFString stringWithUTF8String: (const char *)buffer + 3 length: count]; return count + 3; case 0xDB: /* str 32 */ if (length < 5) goto error; count = readUInt32(buffer + 1); if (length < count + 5) goto error; *object = [OFString stringWithUTF8String: (const char *)buffer + 5 length: count]; return count + 5; /* Arrays */ case 0xDC: /* array 16 */ if (length < 3) goto error; |
︙ | ︙ |