Housekeeping - typecasts to avoid warnings and removal of redundant methods.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2870 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1998-07-29 09:22:18 +00:00
parent 9a7f58d597
commit 8f568c7e39
16 changed files with 34 additions and 61 deletions

View file

@ -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) ; \

View file

@ -632,11 +632,6 @@ static Class NSMutableArray_concrete_class;
/* The NSCopying Protocol */
- (id) copy
{
return [self copyWithZone:NSDefaultMallocZone()];
}
- copyWithZone: (NSZone*)zone
{
/* a deep copy */

View file

@ -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
{

View file

@ -24,6 +24,7 @@
#include <config.h>
#include <Foundation/NSBitmapCharSet.h>
#include <Foundation/NSException.h>
#include <Foundation/NSCoder.h>
@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

View file

@ -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;

View file

@ -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]

View file

@ -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 */

View file

@ -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];
}

View file

@ -415,12 +415,6 @@
}
// **************** do I need this?
- copy
{
return [self copyWithZone: NSDefaultMallocZone ()];
}
// **************** do I need this?
- mutableCopyWithZone: (NSZone*)zone
{

View file

@ -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];

View file

@ -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

View file

@ -46,7 +46,7 @@ NSString *NSPortTimeoutException
- copyWithZone: (NSZone*)aZone
{
return NSCopyObject(self, 0, zone);
return NSCopyObject(self, 0, aZone);
}
- delegate

View file

@ -743,9 +743,4 @@
return n;
}
- copy
{
return [self copyWithZone: [self zone]];
}
@end

View file

@ -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]

View file

@ -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 */

View file

@ -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);