Differences From Artifact [d974e2e6b6]:
- File
src/OFString.m
— part of check-in
[b6ee372b98]
at
2020-08-11 19:45:36
on branch trunk
— OFString: Rework number parsing API
This solves the old signed vs. unsigned problem and allows for more
bases than just 8, 10 and 16, as well as auto-detection of the base (if
base is 0). (user: js, size: 65344) [annotate] [blame] [check-ins using]
To Artifact [a680f97b80]:
- File
src/OFString.m
— part of check-in
[d74f244ab7]
at
2020-08-12 20:56:32
on branch trunk
— Avoid using (u)intmax_t in methods
It is not guaranteed that a type encoding for it exists. (user: js, size: 65352) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
987 988 989 990 991 992 993 | encoding: OF_STRING_ENCODING_UTF_8]; } - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; | | | | 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 | encoding: OF_STRING_ENCODING_UTF_8]; } - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding { char *tmp; unsigned long long fileSize; @try { void *pool = objc_autoreleasePoolPush(); OFFile *file = nil; @try { fileSize = [[OFFileManager defaultManager] attributesOfItemAtPath: path].fileSize; } @catch (OFRetrieveItemAttributesFailedException *e) { @throw [OFOpenItemFailedException exceptionWithPath: path mode: @"r" errNo: e.errNo]; } objc_autoreleasePoolPop(pool); # if ULLONG_MAX > SIZE_MAX if (fileSize > SIZE_MAX) @throw [OFOutOfRangeException exception]; #endif /* * We need one extra byte for the terminating zero if we want * to use -[initWithUTF8StringNoCopy:length:freeWhenDone:]. |
︙ | ︙ |