mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Remove nested functions on broken compilers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10848 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0b92b19919
commit
6580f6f86d
8 changed files with 510 additions and 479 deletions
|
@ -595,14 +595,14 @@ static SEL rlSel;
|
|||
[self makeObjectsPerformSelector: aSelector withObject: argument];
|
||||
}
|
||||
|
||||
static int compare(id elem1, id elem2, void* context)
|
||||
{
|
||||
return (int)[elem1 performSelector: (SEL)context withObject: elem2];
|
||||
}
|
||||
|
||||
- (NSArray*) sortedArrayUsingSelector: (SEL)comparator
|
||||
{
|
||||
int compare(id elem1, id elem2, void* context)
|
||||
{
|
||||
return (int)[elem1 performSelector: comparator withObject: elem2];
|
||||
}
|
||||
|
||||
return [self sortedArrayUsingFunction: compare context: NULL];
|
||||
return [self sortedArrayUsingFunction: compare context: (void *)comparator];
|
||||
}
|
||||
|
||||
- (NSArray*) sortedArrayUsingFunction: (int(*)(id,id,void*))comparator
|
||||
|
@ -1293,12 +1293,7 @@ static NSString *indentStrings[] = {
|
|||
|
||||
- (void) sortUsingSelector: (SEL)comparator
|
||||
{
|
||||
int compare(id elem1, id elem2, void* context)
|
||||
{
|
||||
return (int)[elem1 performSelector: comparator withObject: elem2];
|
||||
}
|
||||
|
||||
[self sortUsingFunction: compare context: NULL];
|
||||
[self sortUsingFunction: compare context: (void *)comparator];
|
||||
}
|
||||
|
||||
- (void) sortUsingFunction: (int(*)(id,id,void*))compare
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue