Differences From Artifact [06108912c2]:
- File src/OFMessagePackExtension.m — part of check-in [fc17e7646a] at 2017-02-03 22:36:28 on branch trunk — OFMessagePackExtension: Only swap bytes if LE (user: js, size: 3800) [annotate] [blame] [check-ins using]
To Artifact [d56d43685b]:
- File
src/OFMessagePackExtension.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: 3804) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
22 23 24 25 26 27 28 | #import "OFInvalidArgumentException.h" @implementation OFMessagePackExtension @synthesize type = _type, data = _data; + (instancetype)extensionWithType: (int8_t)type | | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #import "OFInvalidArgumentException.h" @implementation OFMessagePackExtension @synthesize type = _type, data = _data; + (instancetype)extensionWithType: (int8_t)type data: (OFDataArray *)data { return [[[self alloc] initWithType: type data: data] autorelease]; } - init { OF_INVALID_INIT_METHOD } - initWithType: (int8_t)type data: (OFDataArray *)data { self = [super init]; @try { if (data == nil || [data itemSize] != 1) @throw [OFInvalidArgumentException exception]; |
︙ | ︙ | |||
59 60 61 62 63 64 65 | - (void)dealloc { [_data release]; [super dealloc]; } | | | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | - (void)dealloc { [_data release]; [super dealloc]; } - (OFDataArray *)messagePackRepresentation { OFDataArray *ret; uint8_t prefix; size_t count = [_data count]; if (count == 1) { ret = [OFDataArray dataArrayWithCapacity: 3]; |
︙ | ︙ | |||
146 147 148 149 150 151 152 | [ret addItems: [_data items] count: [_data count]]; return ret; } | | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | [ret addItems: [_data items] count: [_data count]]; return ret; } - (OFString *)description { return [OFString stringWithFormat: @"<OFMessagePackExtension: %d, %@>", _type, _data]; } - (bool)isEqual: (id)object { |
︙ | ︙ |