Differences From Artifact [ce18d3e849]:
- File
src/OFCountedSet_hashtable.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 5129) [annotate] [blame] [check-ins using]
To Artifact [4ab3538671]:
- File
src/OFCountedSet_hashtable.m
— part of check-in
[3d16a30f41]
at
2013-06-22 12:12:36
on branch trunk
— Rework exceptions.
This mostly removes the argument for the class in which the exception
occurred. As backtraces were recently added for all platforms, the
passed class does not give any extra information on where the exception
occurred anymore.This also removes a few other arguments which were not too helpful. In
the past, the idea was to pass as many arguments as possible so that it
is easier to find the origin of the exception. However, as backtraces
are a much better way to find the origin, those are not useful anymore
and just make the exception more cumbersome to use. The rule is now to
only pass arguments that might help in recovering from the exception or
provide information that is otherwise not easily accessible. (user: js, size: 4996) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
140 141 142 143 144 145 146 | void *pool = objc_autoreleasePoolPush(); OFArray *objects; OFEnumerator *enumerator; OFXMLElement *objectElement; if (![[element name] isEqual: @"OFCountedSet"] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) | | < < | < | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | void *pool = objc_autoreleasePoolPush(); OFArray *objects; OFEnumerator *enumerator; OFXMLElement *objectElement; if (![[element name] isEqual: @"OFCountedSet"] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exception]; objects = [element elementsForName: @"object" namespace: OF_SERIALIZATION_NS]; enumerator = [objects objectEnumerator]; while ((objectElement = [enumerator nextObject]) != nil) { void *pool2 = objc_autoreleasePoolPush(); OFXMLElement *object; OFXMLAttribute *count_; size_t count; object = [[objectElement elementsForNamespace: OF_SERIALIZATION_NS] firstObject]; count_ = [objectElement attributeForName: @"count"]; if (object == nil || count_ == nil) @throw [OFInvalidFormatException exception]; count = (size_t)[[count_ stringValue] decimalValue]; [_mapTable setValue: (void*)(uintptr_t)count forKey: [object objectByDeserializing]]; objc_autoreleasePoolPop(pool2); |
︙ | ︙ | |||
195 196 197 198 199 200 201 | @try { [_mapTable enumerateKeysAndValuesUsingBlock: ^ (void *key, void *value, bool *stop) { block(key, (size_t)(uintptr_t)value, stop); }]; } @catch (OFEnumerationMutationException *e) { @throw [OFEnumerationMutationException | < | | | 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | @try { [_mapTable enumerateKeysAndValuesUsingBlock: ^ (void *key, void *value, bool *stop) { block(key, (size_t)(uintptr_t)value, stop); }]; } @catch (OFEnumerationMutationException *e) { @throw [OFEnumerationMutationException exceptionWithObject: self]; } } #endif - (void)addObject: (id)object { size_t count = (size_t)(uintptr_t)[_mapTable valueForKey: object]; if (SIZE_MAX - count < 1 || UINTPTR_MAX - count < 1) @throw [OFOutOfRangeException exception]; [_mapTable setValue: (void*)(uintptr_t)(count + 1) forKey: object]; } - (void)removeObject: (id)object { |
︙ | ︙ |