OLD | NEW |
1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 - (void)dealloc { | 60 - (void)dealloc { |
61 [mutableVarintList_ release]; | 61 [mutableVarintList_ release]; |
62 [mutableFixed32List_ release]; | 62 [mutableFixed32List_ release]; |
63 [mutableFixed64List_ release]; | 63 [mutableFixed64List_ release]; |
64 [mutableLengthDelimitedList_ release]; | 64 [mutableLengthDelimitedList_ release]; |
65 [mutableGroupList_ release]; | 65 [mutableGroupList_ release]; |
66 | 66 |
67 [super dealloc]; | 67 [super dealloc]; |
68 } | 68 } |
69 | 69 |
70 // Direct access is use for speed, to avoid even internally declaring things | |
71 // read/write, etc. The warning is enabled in the project to ensure code calling | |
72 // protos can turn on -Wdirect-ivar-access without issues. | |
73 #pragma clang diagnostic push | |
74 #pragma clang diagnostic ignored "-Wdirect-ivar-access" | |
75 | |
76 - (id)copyWithZone:(NSZone *)zone { | 70 - (id)copyWithZone:(NSZone *)zone { |
77 GPBUnknownField *result = | 71 GPBUnknownField *result = |
78 [[GPBUnknownField allocWithZone:zone] initWithNumber:number_]; | 72 [[GPBUnknownField allocWithZone:zone] initWithNumber:number_]; |
79 result->mutableFixed32List_ = [mutableFixed32List_ copyWithZone:zone]; | 73 result->mutableFixed32List_ = [mutableFixed32List_ copyWithZone:zone]; |
80 result->mutableFixed64List_ = [mutableFixed64List_ copyWithZone:zone]; | 74 result->mutableFixed64List_ = [mutableFixed64List_ copyWithZone:zone]; |
81 result->mutableLengthDelimitedList_ = | 75 result->mutableLengthDelimitedList_ = |
82 [mutableLengthDelimitedList_ copyWithZone:zone]; | 76 [mutableLengthDelimitedList_ copyWithZone:zone]; |
83 result->mutableVarintList_ = [mutableVarintList_ copyWithZone:zone]; | 77 result->mutableVarintList_ = [mutableVarintList_ copyWithZone:zone]; |
84 if (mutableGroupList_.count) { | 78 if (mutableGroupList_.count) { |
85 result->mutableGroupList_ = [[NSMutableArray allocWithZone:zone] | 79 result->mutableGroupList_ = [[NSMutableArray allocWithZone:zone] |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 316 } |
323 | 317 |
324 - (void)addGroup:(GPBUnknownFieldSet *)value { | 318 - (void)addGroup:(GPBUnknownFieldSet *)value { |
325 if (mutableGroupList_ == nil) { | 319 if (mutableGroupList_ == nil) { |
326 mutableGroupList_ = [[NSMutableArray alloc] initWithObjects:&value count:1]; | 320 mutableGroupList_ = [[NSMutableArray alloc] initWithObjects:&value count:1]; |
327 } else { | 321 } else { |
328 [mutableGroupList_ addObject:value]; | 322 [mutableGroupList_ addObject:value]; |
329 } | 323 } |
330 } | 324 } |
331 | 325 |
332 #pragma clang diagnostic pop | |
333 | |
334 @end | 326 @end |
OLD | NEW |