diff --git a/Source/Makefile.postamble b/Source/Makefile.postamble index 5c885571d..628ef0dd8 100644 --- a/Source/Makefile.postamble +++ b/Source/Makefile.postamble @@ -93,7 +93,7 @@ gnustep/base: FORCE # Make necessary links to source headers if compiling in seperate dir # These are separate directories because one contains the .h files # generated during the build; the other contains the unchanged sources. - if [ ! -r ./include/Collection.h ]; then \ + if [ ! -r ./srcdir-include/Foundation/NSObject.h ]; then \ mkdir srcdir-include; \ mkdir srcdir-include/gnustep; \ (cd srcdir-include/gnustep; $(LN_S) ../../$(srcdir)/include ./base) ; \ diff --git a/Source/NSArray.m b/Source/NSArray.m index 50d8a0cc2..3ca04cab6 100644 --- a/Source/NSArray.m +++ b/Source/NSArray.m @@ -632,11 +632,6 @@ static Class NSMutableArray_concrete_class; /* The NSCopying Protocol */ -- (id) copy -{ - return [self copyWithZone:NSDefaultMallocZone()]; -} - - copyWithZone: (NSZone*)zone { /* a deep copy */ diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index d8717c3f3..1472fa27b 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -124,12 +124,6 @@ static Class NSMutableAttributedString_concrete_class; return [[[self class] allocWithZone:zone] initWithAttributedString:self]; } -//FIXME: Should this one be here? The compiler complains if it's not -- copy -{ - return [self copyWithZone: NSDefaultMallocZone ()]; -} - //NSMutableCopying protocol - mutableCopyWithZone: (NSZone*)zone { @@ -137,12 +131,6 @@ static Class NSMutableAttributedString_concrete_class; initWithAttributedString:self]; } -//FIXME: Should this one be here? The compiler complains if it's not -- mutableCopy -{ - return [self mutableCopyWithZone: NSDefaultMallocZone ()]; -} - //Creating an NSAttributedString - (id)init { diff --git a/Source/NSBitmapCharSet.m b/Source/NSBitmapCharSet.m index 9741ceff4..5662363ce 100644 --- a/Source/NSBitmapCharSet.m +++ b/Source/NSBitmapCharSet.m @@ -24,6 +24,7 @@ #include #include #include +#include @implementation NSBitmapCharSet @@ -50,6 +51,20 @@ return ISSET(data[aCharacter/8], aCharacter % 8); } +- (void) encodeWithCoder: (NSCoder*)aCoder +{ + [aCoder encodeObject: [self bitmapRepresentation]]; +} + +- (id) initWithCoder: (NSCoder*)aCoder +{ + NSData *rep; + + rep = [aCoder decodeObject]; + self = [self initWithBitmap: rep]; + return self; +} + @end @implementation NSMutableBitmapCharSet diff --git a/Source/NSCharacterSet.m b/Source/NSCharacterSet.m index ab03f0e39..d7cdbaa81 100644 --- a/Source/NSCharacterSet.m +++ b/Source/NSCharacterSet.m @@ -307,6 +307,17 @@ static NSLock* cache_lock = nil; return 0; } +- (void) encodeWithCoder: (NSCoder*)aCoder +{ + [self subclassResponsibility:_cmd]; +} + +- (id) initWithCoder: (NSCoder*)aCoder +{ + [self subclassResponsibility:_cmd]; + return nil; +} + - (NSCharacterSet *)invertedSet { int i, length; diff --git a/Source/NSData.m b/Source/NSData.m index d4e0d19ed..69ca38c10 100644 --- a/Source/NSData.m +++ b/Source/NSData.m @@ -737,11 +737,6 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len) intBuffer[i] = NSSwapBigIntToHost (intBuffer[i]); } -- (id) copy -{ - return [self copyWithZone: NSDefaultMallocZone()]; -} - - (id) copyWithZone: (NSZone*)zone { if (NSShouldRetainWithZone(self, zone) && @@ -752,11 +747,6 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len) initWithBytes: [self bytes] length: [self length]]; } -- (id) mutableCopy -{ - return [self mutableCopyWithZone: NSDefaultMallocZone()]; -} - - (id) mutableCopyWithZone: (NSZone*)zone { return [[NSMutableDataMalloc allocWithZone: zone] diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index 77790f28d..d1f183329 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -365,11 +365,6 @@ compareIt(id o1, id o2, void* context) return [[self description] writeToFile:path atomically:useAuxiliaryFile]; } -- copy -{ - return [self copyWithZone: [self zone]]; -} - - copyWithZone: (NSZone*)z { /* a deep copy */ diff --git a/Source/NSException.m b/Source/NSException.m index 7106e4f44..9ae9836d6 100644 --- a/Source/NSException.m +++ b/Source/NSException.m @@ -166,7 +166,7 @@ _NSFoundationUncaughtExceptionHandler(NSException *exception) if (NSShouldRetainWithZone(self, zone)) return [self retain]; else - return [NSCopyObject(self, 0, zone) deepen]; + return [(NSException*)NSCopyObject(self, 0, zone) deepen]; } diff --git a/Source/NSGSequence.m b/Source/NSGSequence.m index 599dc847f..8b229ca62 100644 --- a/Source/NSGSequence.m +++ b/Source/NSGSequence.m @@ -415,12 +415,6 @@ } -// **************** do I need this? -- copy -{ - return [self copyWithZone: NSDefaultMallocZone ()]; -} - // **************** do I need this? - mutableCopyWithZone: (NSZone*)zone { diff --git a/Source/NSHost.m b/Source/NSHost.m index cb49cf5c5..e240e638b 100644 --- a/Source/NSHost.m +++ b/Source/NSHost.m @@ -114,7 +114,7 @@ static NSMutableDictionary *_hostCache = nil; memcpy((void *)&in.s_addr, (const void *)ptr, entry->h_length); [addresses addObject:[NSString - stringWithCString:inet_ntoa(in)]]; + stringWithCString:(char*)inet_ntoa(in)]]; } [_hostCacheLock lock]; diff --git a/Source/NSObject.m b/Source/NSObject.m index b581539d2..f5903aabc 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -157,7 +157,7 @@ extraRefCount (id anObject) - (id) copy { - return [(id)self copyWithZone: NSDefaultMallocZone()]; + return [(id)self copyWithZone: NULL]; } - (void) dealloc @@ -179,7 +179,7 @@ extraRefCount (id anObject) - (id) mutableCopy { - return [(id)self mutableCopyWithZone: NSDefaultMallocZone()]; + return [(id)self mutableCopyWithZone: NULL]; } + (Class) superclass diff --git a/Source/NSPort.m b/Source/NSPort.m index 436181e1d..a0035a978 100644 --- a/Source/NSPort.m +++ b/Source/NSPort.m @@ -46,7 +46,7 @@ NSString *NSPortTimeoutException - copyWithZone: (NSZone*)aZone { - return NSCopyObject(self, 0, zone); + return NSCopyObject(self, 0, aZone); } - delegate diff --git a/Source/NSScanner.m b/Source/NSScanner.m index 7d6dbb72e..a6f8eb327 100644 --- a/Source/NSScanner.m +++ b/Source/NSScanner.m @@ -743,9 +743,4 @@ return n; } -- copy -{ - return [self copyWithZone: [self zone]]; -} - @end diff --git a/Source/NSString.m b/Source/NSString.m index e376e91d2..90dee52de 100644 --- a/Source/NSString.m +++ b/Source/NSString.m @@ -2607,16 +2607,6 @@ else we don't get String's Collection implementation. When we separate Core from NonCore methods, this problem will go away. */ -- copy -{ - return [self copyWithZone: NSDefaultMallocZone ()]; -} - -- mutableCopy -{ - return [self mutableCopyWithZone: NSDefaultMallocZone ()]; -} - - mutableCopyWithZone: (NSZone*)zone { return [[[[self class] _mutableConcreteClass] allocWithZone:zone] diff --git a/Source/NSValue.m b/Source/NSValue.m index 678bf4c79..c56e46001 100644 --- a/Source/NSValue.m +++ b/Source/NSValue.m @@ -98,7 +98,7 @@ if (NSShouldRetainWithZone(self, zone)) return [self retain]; else - return [NSCopyObject(self, 0, zone) deepen]; + return [(NSValue*)NSCopyObject(self, 0, zone) deepen]; } /* Returns the concrete class associated with the type encoding */ diff --git a/Source/TcpPort.m b/Source/TcpPort.m index d9df7fc7a..8482d031f 100644 --- a/Source/TcpPort.m +++ b/Source/TcpPort.m @@ -1967,7 +1967,7 @@ static NSMapTable *out_port_bag = NULL; /* Write the packet on the socket. */ #ifdef GDOMAP - c = tryWrite (s, (int)timeout, [data bytes], prefix + eof_position); + c = tryWrite (s, (int)timeout, (unsigned char*)[data bytes], prefix + eof_position); #else #ifdef __WIN32__ c = send (s, [data bytes], prefix + eof_position, 0);