Differences From Artifact [f9c7af6229]:
- File
src/OFString+JSONValue.m
— part of check-in
[13ee56edf3]
at
2014-06-21 21:43:43
on branch trunk
— Move all macros from OFObject.h to macros.h
This means that OFObject.h imports macros.h now, making it unnecessary
to manually import macros.h in almost every file. And while at it, also
import autorelease.h in OFObject.h, so that this doesn't need to be
manually imported in almost every file as well. (user: js, size: 13070) [annotate] [blame] [check-ins using]
To Artifact [2d16a6d32f]:
- File
src/OFString+JSONValue.m
— part of check-in
[b5c8b62533]
at
2014-07-06 11:04:57
on branch trunk
— OFString+*.m: Add a few missing autorelease pools
Those were only a problem if the user created its own OFString subclass,
as calls to -[UTF8String] could then create a new, autoreleased C
string. As OFString_UTF8 simply returns the internal C string, this
hasn't been a problem when not subclassing OFString. (user: js, size: 13178) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | - (id)JSONValue { return [self JSONValueWithDepthLimit: 32]; } - (id)JSONValueWithDepthLimit: (size_t)depthLimit { const char *pointer = [self UTF8String]; const char *stop = pointer + [self UTF8StringLength]; id object; size_t line = 1; object = nextObject(&pointer, stop, &line, 0, depthLimit); skipWhitespacesAndComments(&pointer, stop, &line); if (pointer < stop || object == nil) @throw [OFInvalidJSONException exceptionWithString: self line: line]; | > | | > > > > | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | - (id)JSONValue { return [self JSONValueWithDepthLimit: 32]; } - (id)JSONValueWithDepthLimit: (size_t)depthLimit { void *pool = objc_autoreleasePoolPush(); const char *pointer = [self UTF8String]; const char *stop = pointer + [self UTF8StringLength]; id object; size_t line = 1; object = nextObject(&pointer, stop, &line, 0, depthLimit); skipWhitespacesAndComments(&pointer, stop, &line); if (pointer < stop || object == nil) @throw [OFInvalidJSONException exceptionWithString: self line: line]; [object retain]; objc_autoreleasePoolPop(pool); return [object autorelease]; } @end |