mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
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:
parent
86dbd2aa63
commit
fa0f1a19ca
16 changed files with 34 additions and 61 deletions
|
@ -93,7 +93,7 @@ gnustep/base: FORCE
|
||||||
# Make necessary links to source headers if compiling in seperate dir
|
# Make necessary links to source headers if compiling in seperate dir
|
||||||
# These are separate directories because one contains the .h files
|
# These are separate directories because one contains the .h files
|
||||||
# generated during the build; the other contains the unchanged sources.
|
# 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; \
|
||||||
mkdir srcdir-include/gnustep; \
|
mkdir srcdir-include/gnustep; \
|
||||||
(cd srcdir-include/gnustep; $(LN_S) ../../$(srcdir)/include ./base) ; \
|
(cd srcdir-include/gnustep; $(LN_S) ../../$(srcdir)/include ./base) ; \
|
||||||
|
|
|
@ -632,11 +632,6 @@ static Class NSMutableArray_concrete_class;
|
||||||
|
|
||||||
/* The NSCopying Protocol */
|
/* The NSCopying Protocol */
|
||||||
|
|
||||||
- (id) copy
|
|
||||||
{
|
|
||||||
return [self copyWithZone:NSDefaultMallocZone()];
|
|
||||||
}
|
|
||||||
|
|
||||||
- copyWithZone: (NSZone*)zone
|
- copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
/* a deep copy */
|
/* a deep copy */
|
||||||
|
|
|
@ -124,12 +124,6 @@ static Class NSMutableAttributedString_concrete_class;
|
||||||
return [[[self class] allocWithZone:zone] initWithAttributedString:self];
|
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
|
//NSMutableCopying protocol
|
||||||
- mutableCopyWithZone: (NSZone*)zone
|
- mutableCopyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
|
@ -137,12 +131,6 @@ static Class NSMutableAttributedString_concrete_class;
|
||||||
initWithAttributedString:self];
|
initWithAttributedString:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Should this one be here? The compiler complains if it's not
|
|
||||||
- mutableCopy
|
|
||||||
{
|
|
||||||
return [self mutableCopyWithZone: NSDefaultMallocZone ()];
|
|
||||||
}
|
|
||||||
|
|
||||||
//Creating an NSAttributedString
|
//Creating an NSAttributedString
|
||||||
- (id)init
|
- (id)init
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <Foundation/NSBitmapCharSet.h>
|
#include <Foundation/NSBitmapCharSet.h>
|
||||||
#include <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
|
#include <Foundation/NSCoder.h>
|
||||||
|
|
||||||
@implementation NSBitmapCharSet
|
@implementation NSBitmapCharSet
|
||||||
|
|
||||||
|
@ -50,6 +51,20 @@
|
||||||
return ISSET(data[aCharacter/8], aCharacter % 8);
|
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
|
@end
|
||||||
|
|
||||||
@implementation NSMutableBitmapCharSet
|
@implementation NSMutableBitmapCharSet
|
||||||
|
|
|
@ -307,6 +307,17 @@ static NSLock* cache_lock = nil;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
|
{
|
||||||
|
[self subclassResponsibility:_cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) initWithCoder: (NSCoder*)aCoder
|
||||||
|
{
|
||||||
|
[self subclassResponsibility:_cmd];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSCharacterSet *)invertedSet
|
- (NSCharacterSet *)invertedSet
|
||||||
{
|
{
|
||||||
int i, length;
|
int i, length;
|
||||||
|
|
|
@ -737,11 +737,6 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len)
|
||||||
intBuffer[i] = NSSwapBigIntToHost (intBuffer[i]);
|
intBuffer[i] = NSSwapBigIntToHost (intBuffer[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) copy
|
|
||||||
{
|
|
||||||
return [self copyWithZone: NSDefaultMallocZone()];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) copyWithZone: (NSZone*)zone
|
- (id) copyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
if (NSShouldRetainWithZone(self, zone) &&
|
if (NSShouldRetainWithZone(self, zone) &&
|
||||||
|
@ -752,11 +747,6 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len)
|
||||||
initWithBytes: [self bytes] length: [self length]];
|
initWithBytes: [self bytes] length: [self length]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) mutableCopy
|
|
||||||
{
|
|
||||||
return [self mutableCopyWithZone: NSDefaultMallocZone()];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id) mutableCopyWithZone: (NSZone*)zone
|
- (id) mutableCopyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
return [[NSMutableDataMalloc allocWithZone: zone]
|
return [[NSMutableDataMalloc allocWithZone: zone]
|
||||||
|
|
|
@ -365,11 +365,6 @@ compareIt(id o1, id o2, void* context)
|
||||||
return [[self description] writeToFile:path atomically:useAuxiliaryFile];
|
return [[self description] writeToFile:path atomically:useAuxiliaryFile];
|
||||||
}
|
}
|
||||||
|
|
||||||
- copy
|
|
||||||
{
|
|
||||||
return [self copyWithZone: [self zone]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- copyWithZone: (NSZone*)z
|
- copyWithZone: (NSZone*)z
|
||||||
{
|
{
|
||||||
/* a deep copy */
|
/* a deep copy */
|
||||||
|
|
|
@ -166,7 +166,7 @@ _NSFoundationUncaughtExceptionHandler(NSException *exception)
|
||||||
if (NSShouldRetainWithZone(self, zone))
|
if (NSShouldRetainWithZone(self, zone))
|
||||||
return [self retain];
|
return [self retain];
|
||||||
else
|
else
|
||||||
return [NSCopyObject(self, 0, zone) deepen];
|
return [(NSException*)NSCopyObject(self, 0, zone) deepen];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -415,12 +415,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// **************** do I need this?
|
|
||||||
- copy
|
|
||||||
{
|
|
||||||
return [self copyWithZone: NSDefaultMallocZone ()];
|
|
||||||
}
|
|
||||||
|
|
||||||
// **************** do I need this?
|
// **************** do I need this?
|
||||||
- mutableCopyWithZone: (NSZone*)zone
|
- mutableCopyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
|
|
|
@ -114,7 +114,7 @@ static NSMutableDictionary *_hostCache = nil;
|
||||||
memcpy((void *)&in.s_addr, (const void *)ptr,
|
memcpy((void *)&in.s_addr, (const void *)ptr,
|
||||||
entry->h_length);
|
entry->h_length);
|
||||||
[addresses addObject:[NSString
|
[addresses addObject:[NSString
|
||||||
stringWithCString:inet_ntoa(in)]];
|
stringWithCString:(char*)inet_ntoa(in)]];
|
||||||
}
|
}
|
||||||
|
|
||||||
[_hostCacheLock lock];
|
[_hostCacheLock lock];
|
||||||
|
|
|
@ -157,7 +157,7 @@ extraRefCount (id anObject)
|
||||||
|
|
||||||
- (id) copy
|
- (id) copy
|
||||||
{
|
{
|
||||||
return [(id)self copyWithZone: NSDefaultMallocZone()];
|
return [(id)self copyWithZone: NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
@ -179,7 +179,7 @@ extraRefCount (id anObject)
|
||||||
|
|
||||||
- (id) mutableCopy
|
- (id) mutableCopy
|
||||||
{
|
{
|
||||||
return [(id)self mutableCopyWithZone: NSDefaultMallocZone()];
|
return [(id)self mutableCopyWithZone: NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (Class) superclass
|
+ (Class) superclass
|
||||||
|
|
|
@ -46,7 +46,7 @@ NSString *NSPortTimeoutException
|
||||||
|
|
||||||
- copyWithZone: (NSZone*)aZone
|
- copyWithZone: (NSZone*)aZone
|
||||||
{
|
{
|
||||||
return NSCopyObject(self, 0, zone);
|
return NSCopyObject(self, 0, aZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
- delegate
|
- delegate
|
||||||
|
|
|
@ -743,9 +743,4 @@
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
- copy
|
|
||||||
{
|
|
||||||
return [self copyWithZone: [self zone]];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -2607,16 +2607,6 @@ else
|
||||||
we don't get String's Collection implementation.
|
we don't get String's Collection implementation.
|
||||||
When we separate Core from NonCore methods, this problem will
|
When we separate Core from NonCore methods, this problem will
|
||||||
go away. */
|
go away. */
|
||||||
- copy
|
|
||||||
{
|
|
||||||
return [self copyWithZone: NSDefaultMallocZone ()];
|
|
||||||
}
|
|
||||||
|
|
||||||
- mutableCopy
|
|
||||||
{
|
|
||||||
return [self mutableCopyWithZone: NSDefaultMallocZone ()];
|
|
||||||
}
|
|
||||||
|
|
||||||
- mutableCopyWithZone: (NSZone*)zone
|
- mutableCopyWithZone: (NSZone*)zone
|
||||||
{
|
{
|
||||||
return [[[[self class] _mutableConcreteClass] allocWithZone:zone]
|
return [[[[self class] _mutableConcreteClass] allocWithZone:zone]
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
if (NSShouldRetainWithZone(self, zone))
|
if (NSShouldRetainWithZone(self, zone))
|
||||||
return [self retain];
|
return [self retain];
|
||||||
else
|
else
|
||||||
return [NSCopyObject(self, 0, zone) deepen];
|
return [(NSValue*)NSCopyObject(self, 0, zone) deepen];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the concrete class associated with the type encoding */
|
/* Returns the concrete class associated with the type encoding */
|
||||||
|
|
|
@ -1967,7 +1967,7 @@ static NSMapTable *out_port_bag = NULL;
|
||||||
|
|
||||||
/* Write the packet on the socket. */
|
/* Write the packet on the socket. */
|
||||||
#ifdef GDOMAP
|
#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
|
#else
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
c = send (s, [data bytes], prefix + eof_position, 0);
|
c = send (s, [data bytes], prefix + eof_position, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue