From d6e2e012d9d125ac15967c3bb4ba22465dfa7b8c Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 10 Nov 1998 20:16:33 +0000 Subject: [PATCH] Tidied for STRICT_OPENSTEP and STRICT_MACOS_X git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3194 72102866-910b-0410-8b05-ffd578937521 --- Headers/gnustep/base/NSArchiver.h | 4 ++++ Headers/gnustep/base/NSArray.h | 26 ++++++----------------- Headers/gnustep/base/NSAttributedString.h | 3 +++ Headers/gnustep/base/NSAutoreleasePool.h | 3 ++- Headers/gnustep/base/NSCharacterSet.h | 3 +++ Source/NSCharacterSet.m | 13 +++++++++++- Source/NSGArray.m | 2 +- 7 files changed, 31 insertions(+), 23 deletions(-) diff --git a/Headers/gnustep/base/NSArchiver.h b/Headers/gnustep/base/NSArchiver.h index 4d18c9b84..4137e40b1 100644 --- a/Headers/gnustep/base/NSArchiver.h +++ b/Headers/gnustep/base/NSArchiver.h @@ -76,9 +76,11 @@ - (void) encodeClassName: (NSString*)trueName intoClassName: (NSString*)inArchiveName; +#ifndef STRICT_OPENSTEP /* Substituting Objects */ - (void) replaceObject: (id)object withObject: (id)newObject; +#endif @end #ifndef NO_GNUSTEP @@ -197,8 +199,10 @@ - (void) decodeClassName: (NSString*)nameInArchive asClassName: (NSString*)trueName; +#ifndef STRICT_OPENSTEP /* Substituting objects */ - (void) replaceObject: (id)anObject withObject: (id)replacement; +#endif @end #ifndef NO_GNUSTEP diff --git a/Headers/gnustep/base/NSArray.h b/Headers/gnustep/base/NSArray.h index b25d6a4a1..ae52c2199 100644 --- a/Headers/gnustep/base/NSArray.h +++ b/Headers/gnustep/base/NSArray.h @@ -64,11 +64,15 @@ - firstObjectCommonWithArray: (NSArray*) otherArray; - (BOOL) isEqualToArray: (NSArray*)otherArray; +#ifndef STRICT_MACOS_X - (void) makeObjectsPerform: (SEL) aSelector; - (void) makeObjectsPerform: (SEL)aSelector withObject: argument; +#endif +#ifndef STRICT_OPENSTEP - (void) makeObjectsPerformSelector: (SEL) aSelector; - (void) makeObjectsPerformSelector: (SEL)aSelector withObject: argument; - +#endif + - (NSData*) sortedArrayHint; - (NSArray*) sortedArrayUsingFunction: (int (*)(id, id, void*))comparator context: (void*)context; @@ -94,7 +98,7 @@ @interface NSMutableArray : NSArray -- initWithCapacity: (unsigned)numItems; +- (id) initWithCapacity: (unsigned)numItems; - (void) addObject: anObject; - (void) replaceObjectAtIndex: (unsigned)index withObject: anObject; - (void) insertObject: anObject atIndex: (unsigned)index; @@ -131,22 +135,4 @@ @end -#ifndef NO_GNUSTEP - -#include - -/* Eventually we'll make a Constant version of this protocol. */ -@interface NSArray (GNU) -@end - -@interface NSMutableArray (GNU) -+ (unsigned) defaultCapacity; -+ (unsigned) defaultGrowFactor; -- setCapacity: (unsigned)newCapacity; -- (unsigned) growFactor; -- setGrowFactor: (unsigned)aNum; -@end - -#endif /* NO_GNUSTEP */ - #endif /* __NSArray_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/gnustep/base/NSAttributedString.h b/Headers/gnustep/base/NSAttributedString.h index cbb11b5fd..73d2abe67 100644 --- a/Headers/gnustep/base/NSAttributedString.h +++ b/Headers/gnustep/base/NSAttributedString.h @@ -48,6 +48,7 @@ #ifndef _NSXKit_H_NSAttributedString #define _NSXKit_H_NSAttributedString +#ifndef STRICT_OPENSTEP #include #include #include @@ -111,5 +112,7 @@ @end //NSMutableAttributedString +#endif //STRICT_OPENSTEP + #endif //_NSXKit_H_NSAttributedString diff --git a/Headers/gnustep/base/NSAutoreleasePool.h b/Headers/gnustep/base/NSAutoreleasePool.h index 7f51a979f..cc8d390d5 100644 --- a/Headers/gnustep/base/NSAutoreleasePool.h +++ b/Headers/gnustep/base/NSAutoreleasePool.h @@ -86,12 +86,13 @@ struct autorelease_array_list + (void)addObject: anObject; - (void)addObject: anObject; +#ifndef NO_GNUSTEP + (void) enableRelease: (BOOL)enable; + (void) setPoolCountThreshhold: (unsigned)c; + (unsigned) autoreleaseCountForObject: anObject; + (void) resetTotalAutoreleasedObjects; + (unsigned) totalAutoreleasedObjects; - +#endif @end #endif /* __NSAutoreleasePool_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Headers/gnustep/base/NSCharacterSet.h b/Headers/gnustep/base/NSCharacterSet.h index e5641592e..79b7d89e9 100644 --- a/Headers/gnustep/base/NSCharacterSet.h +++ b/Headers/gnustep/base/NSCharacterSet.h @@ -52,6 +52,9 @@ - (BOOL)characterIsMember:(unichar)aCharacter; - (NSCharacterSet *)invertedSet; +#ifndef STRICT_MACOS_X ++ (NSCharacterSet*) characterSetWithContentsOfFile: (NSString*)file; +#endif @end @interface NSMutableCharacterSet : NSCharacterSet diff --git a/Source/NSCharacterSet.m b/Source/NSCharacterSet.m index 359b1aa11..e46fd1df1 100644 --- a/Source/NSCharacterSet.m +++ b/Source/NSCharacterSet.m @@ -1,5 +1,5 @@ /* NSCharacterSet - Character set holder - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Written by: Adam Fedor Date: Apr 1995 @@ -295,6 +295,17 @@ static NSLock* cache_lock = nil; return [self characterSetWithBitmapRepresentation:bitmap]; } ++ (NSCharacterSet *)characterSetWithContentsOfFile: (NSString *)aFile +{ + if ([@"bitmap" isEqual: [aFile pathExtension]]) + { + NSData *bitmap = [NSData dataWithContentsOfFile: aFile]; + return [self characterSetWithBitmapRepresentation: bitmap]; + } + else + return nil; +} + - (NSData *)bitmapRepresentation { [self subclassResponsibility:_cmd]; diff --git a/Source/NSGArray.m b/Source/NSGArray.m index 0f99f52bd..b84c2b313 100644 --- a/Source/NSGArray.m +++ b/Source/NSGArray.m @@ -189,7 +189,7 @@ } } -- (void) getObjects: (id*)aBuffer range: (IndexRange)aRange +- (void) getObjects: (id*)aBuffer range: (NSRange)aRange { unsigned i, j = 0, e = aRange.location + aRange.length;