git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39997 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-07-15 10:07:50 +00:00
parent 25df4a6efb
commit f56e1bdd0c

View file

@ -126,16 +126,16 @@ static BOOL initialized = NO;
+ (id) sortDescriptorWithKey: (NSString *)aKey ascending: (BOOL)ascending
{
return AUTORELEASE([[self alloc] initWithKey: aKey ascending: ascending]);
return AUTORELEASE([[self alloc] initWithKey: aKey ascending: ascending]);
}
+ (id) sortDescriptorWithKey: (NSString *)aKey
ascending: (BOOL)ascending
selector: (SEL)aSelector
{
return AUTORELEASE([[self alloc] initWithKey: aKey
ascending: ascending
selector: aSelector]);
return AUTORELEASE([[self alloc] initWithKey: aKey
ascending: ascending
selector: aSelector]);
}
- (id) initWithKey: (NSString *) key ascending: (BOOL) ascending
@ -347,7 +347,7 @@ GSSortUnstableConcurrent(id* buffer, NSRange range, id descriptorOrComparator,
@implementation NSArray (NSSortDescriptorSorting)
- (NSArray *) sortedArrayUsingDescriptors: (NSArray *) sortDescriptors
- (NSArray *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors
{
NSMutableArray *sortedArray = [GSMutableArray arrayWithArray: self];
@ -364,19 +364,19 @@ GSSortUnstableConcurrent(id* buffer, NSRange range, id descriptorOrComparator,
*/
static void
SortRange(id *objects, NSRange range, id *descriptors,
unsigned numDescriptors)
NSUInteger numDescriptors)
{
NSSortDescriptor *sd = (NSSortDescriptor*)descriptors[0];
GSSortUnstable(objects, range, sd, GSComparisonTypeSortDescriptor, NULL);
if (numDescriptors > 1)
{
unsigned start = range.location;
unsigned finish = NSMaxRange(range);
NSUInteger start = range.location;
NSUInteger finish = NSMaxRange(range);
while (start < finish)
{
unsigned pos = start + 1;
NSUInteger pos = start + 1;
/* Find next range of adjacent objects.
*/
@ -403,8 +403,8 @@ SortRange(id *objects, NSRange range, id *descriptors,
- (void) sortUsingDescriptors: (NSArray *)sortDescriptors
{
unsigned count = [self count];
unsigned numDescriptors = [sortDescriptors count];
NSUInteger count = [self count];
NSUInteger numDescriptors = [sortDescriptors count];
if (count > 1 && numDescriptors > 0)
{
@ -415,7 +415,7 @@ SortRange(id *objects, NSRange range, id *descriptors,
[self getObjects: objects];
if ([sortDescriptors isProxy])
{
unsigned i;
NSUInteger i;
for (i = 0; i < numDescriptors; i++)
{
@ -440,7 +440,7 @@ SortRange(id *objects, NSRange range, id *descriptors,
- (void) sortUsingDescriptors: (NSArray *)sortDescriptors
{
unsigned dCount = [sortDescriptors count];
NSUInteger dCount = [sortDescriptors count];
if (_count > 1 && dCount > 0)
{
@ -448,7 +448,7 @@ SortRange(id *objects, NSRange range, id *descriptors,
if ([sortDescriptors isProxy])
{
unsigned i;
NSUInteger i;
for (i = 0; i < dCount; i++)
{