Index: src/OFConstantString.m ================================================================== --- src/OFConstantString.m +++ src/OFConstantString.m @@ -177,11 +177,11 @@ [self finishInitialization]; return [self mutableCopy]; } /* From protocol OFComparing, but overridden in OFString */ -- (of_comparison_result_t)compare: (OFString *)string +- (OFComparisonResult)compare: (OFString *)string { [self finishInitialization]; return [self compare: string]; } @@ -243,11 +243,11 @@ { [self finishInitialization]; return [self cStringLengthWithEncoding: encoding]; } -- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)string +- (OFComparisonResult)caseInsensitiveCompare: (OFString *)string { [self finishInitialization]; return [self caseInsensitiveCompare: string]; } Index: src/OFData.h ================================================================== --- src/OFData.h +++ src/OFData.h @@ -274,11 +274,11 @@ * @brief Compares the data to other data. * * @param data Data to compare the data to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (OFData *)data; +- (OFComparisonResult)compare: (OFData *)data; /** * @brief Returns a specific item of the OFData. * * @param index The number of the item to return Index: src/OFData.m ================================================================== --- src/OFData.m +++ src/OFData.m @@ -447,11 +447,11 @@ return false; return true; } -- (of_comparison_result_t)compare: (OFData *)data +- (OFComparisonResult)compare: (OFData *)data { int comparison; size_t count, minCount; if (![data isKindOfClass: [OFData class]]) @@ -464,21 +464,21 @@ minCount = (_count > count ? count : _count); if ((comparison = memcmp(_items, data.items, minCount * _itemSize)) == 0) { if (_count > count) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (_count < count) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; - return OF_ORDERED_SAME; + return OFOrderedSame; } if (comparison > 0) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; else - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; } - (unsigned long)hash { uint32_t hash; Index: src/OFDate.h ================================================================== --- src/OFDate.h +++ src/OFDate.h @@ -271,11 +271,11 @@ * @brief Compares the date to another date. * * @param date The date to compare the date to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (OFDate *)date; +- (OFComparisonResult)compare: (OFDate *)date; /** * @brief Creates a string of the date with the specified format. * * See the man page for `strftime` for information on the format. Index: src/OFDate.m ================================================================== --- src/OFDate.m +++ src/OFDate.m @@ -563,21 +563,21 @@ - (id)copy { return [self retain]; } -- (of_comparison_result_t)compare: (OFDate *)date +- (OFComparisonResult)compare: (OFDate *)date { if (![date isKindOfClass: [OFDate class]]) @throw [OFInvalidArgumentException exception]; if (self.timeIntervalSince1970 < date.timeIntervalSince1970) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; if (self.timeIntervalSince1970 > date.timeIntervalSince1970) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; - return OF_ORDERED_SAME; + return OFOrderedSame; } - (OFString *)description { return [self dateStringWithFormat: @"%Y-%m-%dT%H:%M:%SZ"]; @@ -861,11 +861,11 @@ - (OFDate *)earlierDate: (OFDate *)otherDate { if (otherDate == nil) return self; - if ([self compare: otherDate] == OF_ORDERED_DESCENDING) + if ([self compare: otherDate] == OFOrderedDescending) return otherDate; return self; } @@ -872,11 +872,11 @@ - (OFDate *)laterDate: (OFDate *)otherDate { if (otherDate == nil) return self; - if ([self compare: otherDate] == OF_ORDERED_ASCENDING) + if ([self compare: otherDate] == OFOrderedAscending) return otherDate; return self; } Index: src/OFHTTPClient.m ================================================================== --- src/OFHTTPClient.m +++ src/OFHTTPClient.m @@ -319,11 +319,11 @@ else keepAlive = true; } else { if (connectionHeader != nil) keepAlive = ([connectionHeader caseInsensitiveCompare: - @"keep-alive"] == OF_ORDERED_SAME); + @"keep-alive"] == OFOrderedSame); else keepAlive = false; } if (keepAlive) { @@ -346,20 +346,20 @@ newURL = [OFURL URLWithString: location relativeToURL: URL]; newURLScheme = newURL.scheme; if ([newURLScheme caseInsensitiveCompare: @"http"] != - OF_ORDERED_SAME && + OFOrderedSame && [newURLScheme caseInsensitiveCompare: @"https"] != - OF_ORDERED_SAME) + OFOrderedSame) follow = false; if (!_client->_allowsInsecureRedirects && [URL.scheme caseInsensitiveCompare: @"https"] == - OF_ORDERED_SAME && + OFOrderedSame && [newURLScheme caseInsensitiveCompare: @"http"] == - OF_ORDERED_SAME) + OFOrderedSame) follow = false; if (follow && [_client->_delegate respondsToSelector: @selector( client:shouldFollowRedirect:statusCode:request:response:)]) follow = [_client->_delegate client: _client @@ -699,11 +699,11 @@ OFNumber *URLPort; [_client close]; if ([URL.scheme caseInsensitiveCompare: @"https"] == - OF_ORDERED_SAME) { + OFOrderedSame) { if (of_tls_socket_class == Nil) @throw [OFUnsupportedProtocolException exceptionWithURL: URL]; sock = [[[of_tls_socket_class alloc] init] autorelease]; @@ -1238,12 +1238,12 @@ { void *pool = objc_autoreleasePoolPush(); OFURL *URL = request.URL; OFString *scheme = URL.scheme; - if ([scheme caseInsensitiveCompare: @"http"] != OF_ORDERED_SAME && - [scheme caseInsensitiveCompare: @"https"] != OF_ORDERED_SAME) + if ([scheme caseInsensitiveCompare: @"http"] != OFOrderedSame && + [scheme caseInsensitiveCompare: @"https"] != OFOrderedSame) @throw [OFUnsupportedProtocolException exceptionWithURL: URL]; if (_inProgress) /* TODO: Find a better exception */ @throw [OFAlreadyConnectedException exception]; Index: src/OFHTTPCookie.m ================================================================== --- src/OFHTTPCookie.m +++ src/OFHTTPCookie.m @@ -183,11 +183,11 @@ * meaning RFC 6265 contradicts RFC 2616. * Solve this by special casing this. */ if (characters[i] == ',' && [name caseInsensitiveCompare: @"expires"] == - OF_ORDERED_SAME && value.length == 3 && + OFOrderedSame && value.length == 3 && ([value isEqual: @"Mon"] || [value isEqual: @"Tue"] || [value isEqual: @"Wed"] || [value isEqual: @"Thu"] || [value isEqual: @"Fri"] || Index: src/OFHTTPCookieManager.m ================================================================== --- src/OFHTTPCookieManager.m +++ src/OFHTTPCookieManager.m @@ -61,11 +61,11 @@ if (![cookie.path hasPrefix: @"/"]) cookie.path = @"/"; if (cookie.secure && - [URL.scheme caseInsensitiveCompare: @"https"] != OF_ORDERED_SAME) { + [URL.scheme caseInsensitiveCompare: @"https"] != OFOrderedSame) { objc_autoreleasePoolPop(pool); return; } cookieDomain = cookie.domain.lowercaseString; @@ -119,11 +119,11 @@ expires = cookie.expires; if (expires != nil && expires.timeIntervalSinceNow <= 0) continue; if (cookie.secure && [URL.scheme caseInsensitiveCompare: - @"https"] != OF_ORDERED_SAME) + @"https"] != OFOrderedSame) continue; pool = objc_autoreleasePoolPush(); cookieDomain = cookie.domain.lowercaseString; Index: src/OFLocale.m ================================================================== --- src/OFLocale.m +++ src/OFLocale.m @@ -195,20 +195,20 @@ else if ([token isEqual: @"!="]) var = [OFNumber numberWithBool: ![first isEqual: second]]; else if ([token isEqual: @"<"]) var = [OFNumber numberWithBool: [first - compare: second] == OF_ORDERED_ASCENDING]; + compare: second] == OFOrderedAscending]; else if ([token isEqual: @"<="]) var = [OFNumber numberWithBool: [first - compare: second] != OF_ORDERED_DESCENDING]; + compare: second] != OFOrderedDescending]; else if ([token isEqual: @">"]) var = [OFNumber numberWithBool: [first - compare: second] == OF_ORDERED_DESCENDING]; + compare: second] == OFOrderedDescending]; else if ([token isEqual: @">="]) var = [OFNumber numberWithBool: [first - compare: second] != OF_ORDERED_ASCENDING]; + compare: second] != OFOrderedAscending]; else if ([token isEqual: @"+"]) var = [OFNumber numberWithDouble: [first doubleValue] + [second doubleValue]]; else if ([token isEqual: @"%"]) var = [OFNumber numberWithLongLong: Index: src/OFMutableArray.m ================================================================== --- src/OFMutableArray.m +++ src/OFMutableArray.m @@ -32,32 +32,32 @@ } placeholder; @interface OFMutableArrayPlaceholder: OFMutableArray @end -static of_comparison_result_t +static OFComparisonResult compare(id left, id right, SEL selector) { - of_comparison_result_t (*comparator)(id, SEL, id) = - (of_comparison_result_t (*)(id, SEL, id)) + OFComparisonResult (*comparator)(id, SEL, id) = + (OFComparisonResult (*)(id, SEL, id)) [left methodForSelector: selector]; return comparator(left, selector, right); } static void quicksort(OFMutableArray *array, size_t left, size_t right, SEL selector, int options) { - of_comparison_result_t ascending, descending; + OFComparisonResult ascending, descending; if (options & OF_ARRAY_SORT_DESCENDING) { - ascending = OF_ORDERED_DESCENDING; - descending = OF_ORDERED_ASCENDING; + ascending = OFOrderedDescending; + descending = OFOrderedAscending; } else { - ascending = OF_ORDERED_ASCENDING; - descending = OF_ORDERED_DESCENDING; + ascending = OFOrderedAscending; + descending = OFOrderedDescending; } while (left < right) { size_t i = left; size_t j = right - 1; @@ -92,18 +92,18 @@ #ifdef OF_HAVE_BLOCKS static void quicksortWithBlock(OFMutableArray *array, size_t left, size_t right, of_comparator_t comparator, int options) { - of_comparison_result_t ascending, descending; + OFComparisonResult ascending, descending; if (options & OF_ARRAY_SORT_DESCENDING) { - ascending = OF_ORDERED_DESCENDING; - descending = OF_ORDERED_ASCENDING; + ascending = OFOrderedDescending; + descending = OFOrderedAscending; } else { - ascending = OF_ORDERED_ASCENDING; - descending = OF_ORDERED_DESCENDING; + ascending = OFOrderedAscending; + descending = OFOrderedDescending; } while (left < right) { size_t i = left; size_t j = right - 1; Index: src/OFNumber.h ================================================================== --- src/OFNumber.h +++ src/OFNumber.h @@ -366,14 +366,14 @@ * @brief Compares the number to another number. * * @param number The number to compare the number to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (OFNumber *)number; +- (OFComparisonResult)compare: (OFNumber *)number; @end OF_ASSUME_NONNULL_END #if !defined(NSINTEGER_DEFINED) && !__has_feature(modules) /* Required for number literals to work */ @compatibility_alias NSNumber OFNumber; #endif Index: src/OFNumber.m ================================================================== --- src/OFNumber.m +++ src/OFNumber.m @@ -940,45 +940,45 @@ return (number.longLongValue == self.longLongValue); return (number.unsignedLongLongValue == self.unsignedLongLongValue); } -- (of_comparison_result_t)compare: (OFNumber *)number +- (OFComparisonResult)compare: (OFNumber *)number { if (![number isKindOfClass: [OFNumber class]]) @throw [OFInvalidArgumentException exception]; if (isFloat(self) || isFloat(number)) { double double1 = self.doubleValue; double double2 = number.doubleValue; if (double1 > double2) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (double1 < double2) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; - return OF_ORDERED_SAME; + return OFOrderedSame; } else if (isSigned(self) || isSigned(number)) { long long int1 = self.longLongValue; long long int2 = number.longLongValue; if (int1 > int2) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (int1 < int2) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; - return OF_ORDERED_SAME; + return OFOrderedSame; } else { unsigned long long uint1 = self.unsignedLongLongValue; unsigned long long uint2 = number.unsignedLongLongValue; if (uint1 > uint2) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (uint1 < uint2) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; - return OF_ORDERED_SAME; + return OFOrderedSame; } } - (unsigned long)hash { Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -54,26 +54,26 @@ /** * @brief A result of a comparison. */ typedef enum { /** The left object is smaller than the right */ - OF_ORDERED_ASCENDING = -1, + OFOrderedAscending = -1, /** Both objects are equal */ - OF_ORDERED_SAME = 0, + OFOrderedSame = 0, /** The left object is bigger than the right */ - OF_ORDERED_DESCENDING = 1 -} of_comparison_result_t; + OFOrderedDescending = 1 +} OFComparisonResult; #ifdef OF_HAVE_BLOCKS /** * @brief A comparator to compare two objects. * * @param left The left object * @param right The right object * @return The order of the objects */ -typedef of_comparison_result_t (^of_comparator_t)(id _Nonnull left, +typedef OFComparisonResult (^of_comparator_t)(id _Nonnull left, id _Nonnull right); #endif /** * @brief An enum for storing endianess. @@ -1225,11 +1225,11 @@ * @brief Compares the object to another object. * * @param object An object to compare the object to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (id )object; +- (OFComparisonResult)compare: (id )object; @end #endif #ifdef __cplusplus extern "C" { Index: src/OFSortedList.m ================================================================== --- src/OFSortedList.m +++ src/OFSortedList.m @@ -43,13 +43,13 @@ - (of_list_object_t *)insertObject: (id )object { of_list_object_t *iter; for (iter = _lastListObject; iter != NULL; iter = iter->previous) { - if ([object compare: iter->object] != OF_ORDERED_ASCENDING) + if ([object compare: iter->object] != OFOrderedAscending) return [super insertObject: object afterListObject: iter]; } return [super prependObject: object]; } @end Index: src/OFString.h ================================================================== --- src/OFString.h +++ src/OFString.h @@ -887,19 +887,19 @@ * @brief Compares the string to another string. * * @param string The string to compare the string to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (OFString *)string; +- (OFComparisonResult)compare: (OFString *)string; /** * @brief Compares the string to another string without caring about the case. * * @param string The string to compare the string to * @return The result of the comparison */ -- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)string; +- (OFComparisonResult)caseInsensitiveCompare: (OFString *)string; /** * @brief Returns the Unicode character at the specified index. * * @param index The index of the Unicode character to return Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -1554,18 +1554,18 @@ - (id)mutableCopy { return [[OFMutableString alloc] initWithString: self]; } -- (of_comparison_result_t)compare: (OFString *)string +- (OFComparisonResult)compare: (OFString *)string { void *pool; const of_unichar_t *characters, *otherCharacters; size_t minimumLength; if (string == self) - return OF_ORDERED_SAME; + return OFOrderedSame; if (![string isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; minimumLength = (self.length > string.length @@ -1577,37 +1577,37 @@ otherCharacters = string.characters; for (size_t i = 0; i < minimumLength; i++) { if (characters[i] > otherCharacters[i]) { objc_autoreleasePoolPop(pool); - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; } if (characters[i] < otherCharacters[i]) { objc_autoreleasePoolPop(pool); - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; } } objc_autoreleasePoolPop(pool); if (self.length > string.length) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (self.length < string.length) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; - return OF_ORDERED_SAME; + return OFOrderedSame; } -- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)string +- (OFComparisonResult)caseInsensitiveCompare: (OFString *)string { void *pool = objc_autoreleasePoolPush(); const of_unichar_t *characters, *otherCharacters; size_t length, otherLength, minimumLength; if (string == self) - return OF_ORDERED_SAME; + return OFOrderedSame; characters = self.characters; otherCharacters = string.characters; length = self.length; otherLength = string.length; @@ -1638,26 +1638,26 @@ oc = of_ascii_toupper(oc); #endif if (c > oc) { objc_autoreleasePoolPop(pool); - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; } if (c < oc) { objc_autoreleasePoolPop(pool); - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; } } objc_autoreleasePoolPop(pool); if (length > otherLength) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (length < otherLength) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; - return OF_ORDERED_SAME; + return OFOrderedSame; } - (unsigned long)hash { const of_unichar_t *characters = self.characters; @@ -2419,19 +2419,19 @@ - (float)floatValue { void *pool = objc_autoreleasePoolPush(); OFString *stripped = self.stringByDeletingEnclosingWhitespaces; - if ([stripped caseInsensitiveCompare: @"INF"] == OF_ORDERED_SAME || - [stripped caseInsensitiveCompare: @"INFINITY"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"INF"] == OFOrderedSame || + [stripped caseInsensitiveCompare: @"INFINITY"] == OFOrderedSame) return INFINITY; - if ([stripped caseInsensitiveCompare: @"-INF"] == OF_ORDERED_SAME || - [stripped caseInsensitiveCompare: @"-INFINITY"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"-INF"] == OFOrderedSame || + [stripped caseInsensitiveCompare: @"-INFINITY"] == OFOrderedSame) return -INFINITY; - if ([stripped caseInsensitiveCompare: @"NAN"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"NAN"] == OFOrderedSame) return NAN; - if ([stripped caseInsensitiveCompare: @"-NAN"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame) return -NAN; #ifdef HAVE_STRTOF_L const char *UTF8String = self.UTF8String; #else @@ -2472,19 +2472,19 @@ - (double)doubleValue { void *pool = objc_autoreleasePoolPush(); OFString *stripped = self.stringByDeletingEnclosingWhitespaces; - if ([stripped caseInsensitiveCompare: @"INF"] == OF_ORDERED_SAME || - [stripped caseInsensitiveCompare: @"INFINITY"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"INF"] == OFOrderedSame || + [stripped caseInsensitiveCompare: @"INFINITY"] == OFOrderedSame) return INFINITY; - if ([stripped caseInsensitiveCompare: @"-INF"] == OF_ORDERED_SAME || - [stripped caseInsensitiveCompare: @"-INFINITY"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"-INF"] == OFOrderedSame || + [stripped caseInsensitiveCompare: @"-INFINITY"] == OFOrderedSame) return -INFINITY; - if ([stripped caseInsensitiveCompare: @"NAN"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"NAN"] == OFOrderedSame) return NAN; - if ([stripped caseInsensitiveCompare: @"-NAN"] == OF_ORDERED_SAME) + if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame) return -NAN; #ifdef HAVE_STRTOD_L const char *UTF8String = self.UTF8String; #else Index: src/OFTimer.h ================================================================== --- src/OFTimer.h +++ src/OFTimer.h @@ -457,11 +457,11 @@ * @brief Compares the timer to another timer. * * @param timer The timer to compare the string to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (OFTimer *)timer; +- (OFComparisonResult)compare: (OFTimer *)timer; /** * @brief Fires the timer, meaning it will execute the specified selector on the * target. */ Index: src/OFTimer.m ================================================================== --- src/OFTimer.m +++ src/OFTimer.m @@ -504,11 +504,11 @@ #endif [super dealloc]; } -- (of_comparison_result_t)compare: (OFTimer *)timer +- (OFComparisonResult)compare: (OFTimer *)timer { if (![timer isKindOfClass: [OFTimer class]]) @throw [OFInvalidArgumentException exception]; return [_fireDate compare: timer->_fireDate]; Index: src/OFUTF8String.m ================================================================== --- src/OFUTF8String.m +++ src/OFUTF8String.m @@ -71,16 +71,16 @@ f = of_ascii_toupper(f); s = of_ascii_toupper(s); if (f > s) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (f < s) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; } - return OF_ORDERED_SAME; + return OFOrderedSame; } int of_string_utf8_check(const char *UTF8String, size_t UTF8Length, size_t *length) { @@ -797,17 +797,17 @@ return false; return true; } -- (of_comparison_result_t)compare: (OFString *)string +- (OFComparisonResult)compare: (OFString *)string { size_t otherCStringLength, minimumCStringLength; int compare; if (string == self) - return OF_ORDERED_SAME; + return OFOrderedSame; if (![string isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; otherCStringLength = string.UTF8StringLength; @@ -815,33 +815,33 @@ ? otherCStringLength : _s->cStringLength); if ((compare = memcmp(_s->cString, string.UTF8String, minimumCStringLength)) == 0) { if (_s->cStringLength > otherCStringLength) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (_s->cStringLength < otherCStringLength) - return OF_ORDERED_ASCENDING; - return OF_ORDERED_SAME; + return OFOrderedAscending; + return OFOrderedSame; } if (compare > 0) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; else - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; } -- (of_comparison_result_t)caseInsensitiveCompare: (OFString *)string +- (OFComparisonResult)caseInsensitiveCompare: (OFString *)string { const char *otherCString; size_t otherCStringLength, minimumCStringLength; #ifdef OF_HAVE_UNICODE_TABLES size_t i, j; #endif int compare; if (string == self) - return OF_ORDERED_SAME; + return OFOrderedSame; otherCString = string.UTF8String; otherCStringLength = string.UTF8StringLength; #ifdef OF_HAVE_UNICODE_TABLES @@ -851,20 +851,20 @@ ? otherCStringLength : _s->cStringLength); if ((compare = memcasecmp(_s->cString, otherCString, minimumCStringLength)) == 0) { if (_s->cStringLength > otherCStringLength) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (_s->cStringLength < otherCStringLength) - return OF_ORDERED_ASCENDING; - return OF_ORDERED_SAME; + return OFOrderedAscending; + return OFOrderedSame; } if (compare > 0) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; else - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; #ifdef OF_HAVE_UNICODE_TABLES } i = j = 0; @@ -895,25 +895,25 @@ if (tc) c2 = tc; } if (c1 > c2) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; if (c1 < c2) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; i += l1; j += l2; } if (_s->cStringLength - i > otherCStringLength - j) - return OF_ORDERED_DESCENDING; + return OFOrderedDescending; else if (_s->cStringLength - i < otherCStringLength - j) - return OF_ORDERED_ASCENDING; + return OFOrderedAscending; #endif - return OF_ORDERED_SAME; + return OFOrderedSame; } - (unsigned long)hash { uint32_t hash; Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -497,11 +497,11 @@ if (data.length == 0) data = nil; } else target = PI; - if ([target caseInsensitiveCompare: @"xml"] == OF_ORDERED_SAME) + if ([target caseInsensitiveCompare: @"xml"] == OFOrderedSame) if (!parseXMLProcessingInstruction(self, data)) @throw [OFMalformedXMLException exceptionWithParser: self]; if ([self->_delegate respondsToSelector: @selector( Index: tests/OFDataTests.m ================================================================== --- tests/OFDataTests.m +++ tests/OFDataTests.m @@ -61,14 +61,14 @@ (mutable = [[immutable mutableCopy] autorelease]) && [mutable isEqual: immutable]) TEST(@"-[compare]", [mutable compare: immutable] == 0 && R([mutable removeLastItem]) && - [immutable compare: mutable] == OF_ORDERED_DESCENDING && - [mutable compare: immutable] == OF_ORDERED_ASCENDING && + [immutable compare: mutable] == OFOrderedDescending && + [mutable compare: immutable] == OFOrderedAscending && [[OFData dataWithItems: "aa" count: 2] compare: - [OFData dataWithItems: "z" count: 1]] == OF_ORDERED_ASCENDING) + [OFData dataWithItems: "z" count: 1]] == OFOrderedAscending) TEST(@"-[hash]", immutable.hash == 0x634A529F) mutable = [OFMutableData dataWithItems: "abcdef" count: 6]; Index: tests/OFDateTests.m ================================================================== --- tests/OFDateTests.m +++ tests/OFDateTests.m @@ -78,11 +78,11 @@ TEST(@"-[isEqual:]", [d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0]] && ![d1 isEqual: [OFDate dateWithTimeIntervalSince1970: 0.0000001]]) - TEST(@"-[compare:]", [d1 compare: d2] == OF_ORDERED_ASCENDING) + TEST(@"-[compare:]", [d1 compare: d2] == OFOrderedAscending) TEST(@"-[second]", d1.second == 0 && d2.second == 5) TEST(@"-[microsecond]", d1.microsecond == 0 && d2.microsecond == 2) Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -233,34 +233,34 @@ s[2] = [[s[0] copy] autorelease]; TEST(@"-[isEqual:]", [s[0] isEqual: s[2]] && ![s[0] isEqual: [[[OFObject alloc] init] autorelease]]) - TEST(@"-[compare:]", [s[0] compare: s[2]] == OF_ORDERED_SAME && - [s[0] compare: @""] != OF_ORDERED_SAME && - [C(@"") compare: @"a"] == OF_ORDERED_ASCENDING && - [C(@"a") compare: @"b"] == OF_ORDERED_ASCENDING && - [C(@"cd") compare: @"bc"] == OF_ORDERED_DESCENDING && - [C(@"ä") compare: @"ö"] == OF_ORDERED_ASCENDING && - [C(@"€") compare: @"ß"] == OF_ORDERED_DESCENDING && - [C(@"aa") compare: @"z"] == OF_ORDERED_ASCENDING) + TEST(@"-[compare:]", [s[0] compare: s[2]] == OFOrderedSame && + [s[0] compare: @""] != OFOrderedSame && + [C(@"") compare: @"a"] == OFOrderedAscending && + [C(@"a") compare: @"b"] == OFOrderedAscending && + [C(@"cd") compare: @"bc"] == OFOrderedDescending && + [C(@"ä") compare: @"ö"] == OFOrderedAscending && + [C(@"€") compare: @"ß"] == OFOrderedDescending && + [C(@"aa") compare: @"z"] == OFOrderedAscending) #ifdef OF_HAVE_UNICODE_TABLES TEST(@"-[caseInsensitiveCompare:]", - [C(@"a") caseInsensitiveCompare: @"A"] == OF_ORDERED_SAME && - [C(@"Ä") caseInsensitiveCompare: @"ä"] == OF_ORDERED_SAME && - [C(@"я") caseInsensitiveCompare: @"Я"] == OF_ORDERED_SAME && - [C(@"€") caseInsensitiveCompare: @"ß"] == OF_ORDERED_DESCENDING && - [C(@"ß") caseInsensitiveCompare: @"→"] == OF_ORDERED_ASCENDING && - [C(@"AA") caseInsensitiveCompare: @"z"] == OF_ORDERED_ASCENDING && + [C(@"a") caseInsensitiveCompare: @"A"] == OFOrderedSame && + [C(@"Ä") caseInsensitiveCompare: @"ä"] == OFOrderedSame && + [C(@"я") caseInsensitiveCompare: @"Я"] == OFOrderedSame && + [C(@"€") caseInsensitiveCompare: @"ß"] == OFOrderedDescending && + [C(@"ß") caseInsensitiveCompare: @"→"] == OFOrderedAscending && + [C(@"AA") caseInsensitiveCompare: @"z"] == OFOrderedAscending && [[stringClass stringWithUTF8String: "ABC"] caseInsensitiveCompare: [stringClass stringWithUTF8String: "AbD"]] == [C(@"abc") compare: @"abd"]) #else TEST(@"-[caseInsensitiveCompare:]", - [C(@"a") caseInsensitiveCompare: @"A"] == OF_ORDERED_SAME && - [C(@"AA") caseInsensitiveCompare: @"z"] == OF_ORDERED_ASCENDING && + [C(@"a") caseInsensitiveCompare: @"A"] == OFOrderedSame && + [C(@"AA") caseInsensitiveCompare: @"z"] == OFOrderedAscending && [[stringClass stringWithUTF8String: "ABC"] caseInsensitiveCompare: [stringClass stringWithUTF8String: "AbD"]] == [C(@"abc") compare: @"abd"]) #endif