Clean compilation

This commit is contained in:
Gregory John Casamento 2019-05-20 04:01:20 -04:00
parent 9a516999c8
commit d4428e8d6c
3 changed files with 75 additions and 66 deletions

View file

@ -66,8 +66,8 @@ extern "C" {
+ (instancetype) orderedSetWithObjects:(GS_GENERIC_TYPE(ElementT))firstObject, ...; + (instancetype) orderedSetWithObjects:(GS_GENERIC_TYPE(ElementT))firstObject, ...;
+ (instancetype) orderedSetWithObjects:(const GS_GENERIC_TYPE(ElementT)[])objects + (instancetype) orderedSetWithObjects:(const GS_GENERIC_TYPE(ElementT)[])objects
count:(NSUInteger) count; count:(NSUInteger) count;
+ (instancetype) orderedSetWithOrderedSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet; + (instancetype) orderedSetWithOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet;
+ (instancetype) orderedSetWithOrderedSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet + (instancetype) orderedSetWithOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet
count:(NSUInteger) count; count:(NSUInteger) count;
+ (instancetype) orderedSetWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet; + (instancetype) orderedSetWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet;
+ (instancetype) orderedSetWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet + (instancetype) orderedSetWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet
@ -83,10 +83,10 @@ extern "C" {
- (instancetype) initWithObjects:(GS_GENERIC_TYPE(ElementT))firstObject, ...; - (instancetype) initWithObjects:(GS_GENERIC_TYPE(ElementT))firstObject, ...;
- (instancetype) initWithObjects:(const GS_GENERIC_TYPE(ElementT)[])objects - (instancetype) initWithObjects:(const GS_GENERIC_TYPE(ElementT)[])objects
count:(NSUInteger)count; count:(NSUInteger)count;
- (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet; - (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet;
- (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSArray, ElementT)*)objects - (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet
copyItems:(BOOL)flag; copyItems:(BOOL)flag;
- (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSArray, ElementT)*)objects - (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet
range: (NSRange)range range: (NSRange)range
copyItems:(BOOL)flag; copyItems:(BOOL)flag;
- (instancetype) initWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet; - (instancetype) initWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet;
@ -164,7 +164,7 @@ extern "C" {
// Describing a set // Describing a set
- (NSString *) description; - (NSString *) description;
- (NSString *) descriptionWithLocale: (NSLocale *)locale; - (NSString *) descriptionWithLocale: (NSLocale *)locale;
- (NSString *) descriptionWithLocale: (id)locale indent: (BOOL)flag; - (NSString *) descriptionWithLocale: (NSLocale *)locale indent: (BOOL)flag;
@end @end
// Mutable Ordered Set // Mutable Ordered Set
@ -204,11 +204,11 @@ extern "C" {
options:(NSSortOptions)options options:(NSSortOptions)options
usingComparator: (NSComparator)comparator; usingComparator: (NSComparator)comparator;
- (void) intersectOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet; - (void) intersectOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet;
- (void) intersectSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet; - (void) intersectSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet;
- (void) minusOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet; - (void) minusOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet;
- (void) minusSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet; - (void) minusSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet;
- (void) unionOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet; - (void) unionOrderedSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet;
- (void) unionSet:(GS_GENERIC_CLASS(NSOrderedSet, ElementT)*)aSet; - (void) unionSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet;
- (instancetype) initWithCoder: (NSCoder *)coder; - (instancetype) initWithCoder: (NSCoder *)coder;
@end @end

View file

@ -521,7 +521,7 @@ static Class mutableSetClass;
- (NSEnumerator*) objectEnumerator - (NSEnumerator*) objectEnumerator
{ {
return AUTORELEASE([[GSOrderedSetEnumerator alloc] initWithSet: self]); return AUTORELEASE([[GSOrderedSetEnumerator alloc] initWithOrderedSet: self]);
} }
- (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState*)state - (NSUInteger) countByEnumeratingWithState: (NSFastEnumerationState*)state
@ -614,7 +614,7 @@ static Class mutableSetClass;
{ {
NSOrderedSet *copy = [setClass allocWithZone: z]; NSOrderedSet *copy = [setClass allocWithZone: z];
return [copy initWithSet: self copyItems: NO]; return [copy initWithOrderedSet: self copyItems: NO];
} }
- (id) init - (id) init
@ -744,20 +744,13 @@ static Class mutableSetClass;
- (void) minusSet: (NSSet*) other - (void) minusSet: (NSSet*) other
{ {
if (other == self) NSEnumerator *e = [other objectEnumerator];
id anObject;
while ((anObject = [e nextObject]) != nil)
{ {
GSIMapCleanMap(&map); GSIMapRemoveKey(&map, (GSIMapKey)anObject);
} _version++;
else
{
NSEnumerator *e = [other objectEnumerator];
id anObject;
while ((anObject = [e nextObject]) != nil)
{
GSIMapRemoveKey(&map, (GSIMapKey)anObject);
_version++;
}
} }
} }
@ -779,26 +772,23 @@ static Class mutableSetClass;
- (void) unionSet: (NSSet*) other - (void) unionSet: (NSSet*) other
{ {
if (other != self) NSEnumerator *e = [other objectEnumerator];
if (e != nil)
{ {
NSEnumerator *e = [other objectEnumerator]; id anObject;
SEL sel = @selector(nextObject);
if (e != nil) IMP imp = [e methodForSelector: sel];
while ((anObject = (*imp)(e, sel)) != nil)
{ {
id anObject; GSIMapNode node;
SEL sel = @selector(nextObject);
IMP imp = [e methodForSelector: sel]; node = GSIMapNodeForKey(&map, (GSIMapKey)anObject);
if (node == 0)
while ((anObject = (*imp)(e, sel)) != nil)
{ {
GSIMapNode node; GSIMapAddKey(&map, (GSIMapKey)anObject);
_version++;
node = GSIMapNodeForKey(&map, (GSIMapKey)anObject);
if (node == 0)
{
GSIMapAddKey(&map, (GSIMapKey)anObject);
_version++;
}
} }
} }
} }

View file

@ -33,7 +33,10 @@
#import "Foundation/NSKeyValueCoding.h" #import "Foundation/NSKeyValueCoding.h"
#import "Foundation/NSValue.h" #import "Foundation/NSValue.h"
#import "Foundation/NSException.h" #import "Foundation/NSException.h"
// #import "GNUstepBase/GNUstep.h"
// For private method _decodeArrayOfObjectsForKey: // For private method _decodeArrayOfObjectsForKey:
#import "Foundation/NSKeyedArchiver.h" #import "Foundation/NSKeyedArchiver.h"
#import "GSPrivate.h" #import "GSPrivate.h"
#import "GSFastEnumeration.h" #import "GSFastEnumeration.h"
@ -75,6 +78,11 @@ static Class NSMutableOrderedSet_concrete_class;
} }
} }
- (Class) classForCoder
{
return NSOrderedSet_abstract_class;
}
// NSCoding // NSCoding
- (instancetype) initWithCoder: (NSCoder *)coder - (instancetype) initWithCoder: (NSCoder *)coder
{ {
@ -223,49 +231,59 @@ static Class NSMutableOrderedSet_concrete_class;
+ (instancetype) orderedSetWithArray:(NSArray *)objects + (instancetype) orderedSetWithArray:(NSArray *)objects
{ {
return nil; return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
initWithArray: objects]);
} }
+ (instancetype) orderedSetWithArray:(NSArray *)objects + (instancetype) orderedSetWithArray:(NSArray *)objects
range: (NSRange)range range:(NSRange)range
copyItems:(BOOL)flag copyItems:(BOOL)flag
{ {
return nil; return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
initWithArray: objects
range: range
copyItems: flag]);
} }
+ (instancetype) orderedSetWithObject:(GS_GENERIC_TYPE(ElementT))anObject + (instancetype) orderedSetWithObject:(id)anObject
{ {
return nil; return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
initWithObject: anObject]);
} }
+ (instancetype) orderedSetWithObjects:(GS_GENERIC_TYPE(ElementT))firstObject, ... + (instancetype) orderedSetWithObjects:(id)firstObject, ...
{ {
return nil; id set;
}
GS_USEIDLIST(firstObject,
set = [[self allocWithZone: NSDefaultMallocZone()]
initWithObjects: __objects count: __count]);
return AUTORELEASE(set);
}
+ (instancetype) orderedSetWithObjects:(const GS_GENERIC_TYPE(ElementT)[])objects + (instancetype) orderedSetWithObjects:(const id [])objects
count:(NSUInteger) count count:(NSUInteger) count
{ {
return nil; return nil;
} }
+ (instancetype) orderedSetWithOrderedSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet + (instancetype) orderedSetWithOrderedSet:(NSOrderedSet *)aSet
{ {
return nil; return nil;
} }
+ (instancetype) orderedSetWithOrderedSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet + (instancetype) orderedSetWithOrderedSet:(NSOrderedSet *)aSet
count:(NSUInteger) count count:(NSUInteger) count
{ {
return nil; return nil;
} }
+ (instancetype) orderedSetWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet + (instancetype) orderedSetWithSet:(NSSet *)aSet
{ {
return nil; return nil;
} }
+ (instancetype) orderedSetWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet + (instancetype) orderedSetWithSet:(NSSet *)aSet
copyItems:(BOOL)flag copyItems:(BOOL)flag
{ {
return nil; return nil;
@ -294,41 +312,41 @@ static Class NSMutableOrderedSet_concrete_class;
return nil; return nil;
} }
- (instancetype) initWithObjects:(GS_GENERIC_TYPE(ElementT))firstObject, ... - (instancetype) initWithObjects:(id)firstObject, ...
{ {
return nil; return nil;
} }
- (instancetype) initWithObjects:(const GS_GENERIC_TYPE(ElementT)[])objects - (instancetype) initWithObjects:(const id [])objects
count:(NSUInteger)count count:(NSUInteger)count
{ {
return nil; return nil;
} }
- (instancetype) initWithOrderedSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet - (instancetype) initWithOrderedSet:(NSOrderedSet *)aSet
{ {
return nil; return nil;
} }
- (instancetype) initWithOrderedSet:(NSArray *)objects - (instancetype) initWithOrderedSet:(NSOrderedSet *)objects
copyItems:(BOOL)flag copyItems:(BOOL)flag
{ {
return nil; return nil;
} }
- (instancetype) initWithOrderedSet:(NSArray *)objects - (instancetype) initWithOrderedSet:(NSOrderedSet *)objects
range: (NSRange)range range:(NSRange)range
copyItems:(BOOL)flag copyItems:(BOOL)flag
{ {
return nil; return nil;
} }
- (instancetype) initWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet - (instancetype) initWithSet:(NSSet *)aSet
{ {
return nil; return nil;
} }
- (instancetype) initWithSet:(GS_GENERIC_CLASS(NSSet, ElementT)*)aSet copyItems:(BOOL)flag - (instancetype) initWithSet:(NSSet *)aSet copyItems:(BOOL)flag
{ {
return nil; return nil;
} }
@ -343,7 +361,7 @@ static Class NSMutableOrderedSet_concrete_class;
return 0; return 0;
} }
- (BOOL)containsObject:(GS_GENERIC_TYPE(ElementT))anObject - (BOOL)containsObject:(id)anObject
{ {
return NO; return NO;
} }
@ -354,7 +372,7 @@ static Class NSMutableOrderedSet_concrete_class;
{ {
} }
- (void) enumerateObjectsUsingBlock: (GSEnumeratorBlock)aBlock - (void) enumerateObjectsUsingBlock:(GSEnumeratorBlock)aBlock
{ {
} }
@ -578,8 +596,9 @@ static Class NSMutableOrderedSet_concrete_class;
} }
- (NSString *) descriptionWithLocale: (NSLocale *)locale - (NSString *) descriptionWithLocale: (NSLocale *)locale
{ {
return [[self allObjects] descriptionWithLocale: locale]; NSArray *allObjects = [self sortedArrayUsingDescriptors: nil];
return [allObjects descriptionWithLocale: locale];
} }
- (NSString*) descriptionWithLocale: (NSLocale *)locale indent: (BOOL)flag - (NSString*) descriptionWithLocale: (NSLocale *)locale indent: (BOOL)flag