Revert subtly broken change

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21391 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-07-01 17:31:07 +00:00
parent 9ac16024f5
commit 6d0751af3e
56 changed files with 333 additions and 444 deletions

View file

@ -1,3 +1,9 @@
2005-07-01 Richard Frith-Macdonald <rfm@gnu.org>
* The last change passed regression tests etc, but one program
I have has stopped working, so there is a bug somewhere.
Reverted change until I can isolate the problem and fix it.
2005-07-01 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSUserDefaults.h: Fix bad return type

View file

@ -252,7 +252,7 @@ GS_EXPORT NSString* const NSLocale;
- (NSString*) stringForKey: (NSString*)defaultName;
/* Returning the Search List */
- (NSArray*) searchList;
- (NSMutableArray*) searchList;
- (void) setSearchList: (NSArray*)newList;
#ifndef STRICT_OPENSTEP
- (void) addSuiteNamed: (NSString*)aName;

View file

@ -609,7 +609,7 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
lineLength -= 3;
}
}
else if (pos > 6 && strncmp((const char*)bytes, "begin ", 6) == 0)
else if (pos > 6 && strncmp(bytes, "begin ", 6) == 0)
{
unsigned off = 6;
unsigned end = pos;
@ -678,8 +678,8 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
/*
* The header is a line of the form 'begin mode filename'
*/
sprintf((char*)buf, "begin %03o ", mode);
[encoded appendBytes: buf length: strlen((const char*)buf)];
sprintf(buf, "begin %03o ", mode);
[encoded appendBytes: buf length: strlen(buf)];
[encoded appendData: [name dataUsingEncoding: NSASCIIStringEncoding]];
[encoded appendBytes: "\n" length: 1];

View file

@ -72,7 +72,7 @@ static Class documentClass = 0;
* Purpose - Convert 4 bytes in base64 encoding to 3 bytes raw data.
*/
static void
decodebase64(unsigned char *dst, const unsigned char *src)
decodebase64(unsigned char *dst, const char *src)
{
dst[0] = (src[0] << 2) | ((src[1] & 0x30) >> 4);
dst[1] = ((src[1] & 0x0F) << 4) | ((src[2] & 0x3C) >> 2);
@ -83,7 +83,7 @@ static char b64[]
= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static int
encodebase64(unsigned char *dst, const unsigned char *src, int length)
encodebase64(char *dst, const unsigned char *src, int length)
{
int dIndex = 0;
int sIndex;
@ -808,7 +808,7 @@ wordData(NSString *word)
if (buflen == 8)
{
buffer[8] = '\0';
if (strcasecmp((char*)buffer, "encoding") == 0)
if (strcasecmp(buffer, "encoding") == 0)
{
found = YES;
}
@ -1615,7 +1615,7 @@ wordData(NSString *word)
b[0] = '-';
b[1] = '-';
[tmp getCString: (char*)&b[2]];
[tmp getCString: &b[2]];
boundary = [[NSData alloc] initWithBytesNoCopy: b length: l];
}
@ -2235,7 +2235,7 @@ NSDebugMLLog(@"GSMime", @"Header parsed - %@", info);
*src = '\0';
s = [NSStringClass allocWithZone: NSDefaultMallocZone()];
s = [s initWithCString: (const char *)tmp];
s = [s initWithCString: tmp];
enc = [documentClass encodingFromCharset: s];
RELEASE(s);
@ -3318,8 +3318,8 @@ static NSCharacterSet *tokenSet = nil;
{
int length;
int declen ;
const unsigned char *src;
const unsigned char *end;
const signed char *src;
const signed char *end;
unsigned char *result;
unsigned char *dst;
unsigned char buf[4];
@ -3335,7 +3335,7 @@ static NSCharacterSet *tokenSet = nil;
return [NSData data];
}
declen = ((length + 3) * 3)/4;
src = (const unsigned char*)[source bytes];
src = (const char*)[source bytes];
end = &src[length];
result = (unsigned char*)NSZoneMalloc(NSDefaultMallocZone(), declen);

View file

@ -39,7 +39,6 @@
#include <Foundation/NSException.h>
#include <Foundation/NSLock.h>
#include <Foundation/NSMethodSignature.h>
#include <Foundation/NSNull.h>
#include <Foundation/NSObjCRuntime.h>
#include <Foundation/NSSet.h>
#include <Foundation/NSString.h>
@ -55,6 +54,8 @@
#include <string.h>
@class NSNull;
#ifdef NeXT_Foundation_LIBRARY
@interface NSObject (MissingFromMacOSX)
+ (IMP) methodForSelector: (SEL)aSelector;

View file

@ -107,11 +107,6 @@ static Class treeClass;
static IMP usImp;
static SEL usSel;
/*
* Macro to cast results to correct type for libxml2
*/
#define UTF8STRING(X) ((const unsigned char*)[X UTF8String])
inline static NSString*
UTF8Str(const unsigned char *bytes)
{
@ -349,7 +344,7 @@ static NSMapTable *attrNames = 0;
*/
+ (GSXMLDocument*) documentWithVersion: (NSString*)version
{
void *data = xmlNewDoc(UTF8STRING(version));
void *data = xmlNewDoc([version UTF8String]);
GSXMLDocument *document = nil;
if (data == 0)
@ -453,7 +448,7 @@ static NSMapTable *attrNames = 0;
GSXMLNode *n = [GSXMLNode alloc];
n = [n _initFrom:
xmlNewDocNode(lib, [ns lib], UTF8STRING(name), UTF8STRING(content))
xmlNewDocNode(lib, [ns lib], [name UTF8String], [content UTF8String])
parent: self];
return AUTORELEASE(n);
}
@ -1146,7 +1141,7 @@ static NSMapTable *nodeNames = 0;
{
void *l;
l = xmlNewProp((xmlNodePtr)[self lib], UTF8STRING(name), UTF8STRING(value));
l = xmlNewProp((xmlNodePtr)[self lib], [name cString], [value cString]);
return AUTORELEASE([[GSXMLAttribute alloc] _initFrom: l parent: self]);
}
@ -1187,7 +1182,7 @@ static NSMapTable *nodeNames = 0;
GSXMLNode *n = [GSXMLNode alloc];
n = [n _initFrom:
xmlNewTextChild(lib, [ns lib], UTF8STRING(name), UTF8STRING(content))
xmlNewTextChild(lib, [ns lib], [name UTF8String], [content UTF8String])
parent: self];
return AUTORELEASE(n);
}
@ -1209,7 +1204,7 @@ static NSMapTable *nodeNames = 0;
GSXMLNode *n = [GSXMLNode alloc];
n = [n _initFrom:
xmlAddChild((xmlNodePtr)lib, xmlNewText(UTF8STRING(content)))
xmlAddChild((xmlNodePtr)lib, xmlNewText([content UTF8String]))
parent: self];
return AUTORELEASE(n);
}
@ -1231,7 +1226,7 @@ static NSMapTable *nodeNames = 0;
GSXMLNode *n = [GSXMLNode alloc];
n = [n _initFrom:
xmlAddChild((xmlNodePtr)lib, xmlNewComment(UTF8STRING(content)))
xmlAddChild((xmlNodePtr)lib, xmlNewComment([content UTF8String]))
parent: self];
return AUTORELEASE(n);
}
@ -1244,7 +1239,7 @@ static NSMapTable *nodeNames = 0;
{
void *data;
data = xmlNewNs((xmlNodePtr)lib, UTF8STRING(href), UTF8STRING(prefix));
data = xmlNewNs((xmlNodePtr)lib, [href UTF8String], [prefix UTF8String]);
if (data == NULL)
{
NSLog(@"Can't create GSXMLNamespace object");
@ -1271,8 +1266,8 @@ static NSMapTable *nodeNames = 0;
GSXMLNode *n = [GSXMLNode alloc];
n = [n _initFrom:
xmlAddChild((xmlNodePtr)lib, xmlNewPI(UTF8STRING(name),
UTF8STRING(content))) parent: self];
xmlAddChild((xmlNodePtr)lib, xmlNewPI([name UTF8String],
[content UTF8String])) parent: self];
return AUTORELEASE(n);
}
@ -1528,7 +1523,7 @@ static NSMapTable *nodeNames = 0;
*/
- (void) setObject: (NSString*)value forKey: (NSString*)key
{
xmlSetProp(lib, UTF8STRING(key), UTF8STRING(value));
xmlSetProp(lib, [key UTF8String], [value UTF8String]);
}
/**
@ -1847,7 +1842,7 @@ static NSString *endMarker = @"At end of incremental parse";
// Stop incoming data being parsed.
ctxt->instate = XML_PARSER_EOF;
// Pretend we are at end of file (nul byte).
if (ctxt->input != NULL) ctxt->input->cur = (const unsigned char*)"";
if (ctxt->input != NULL) ctxt->input->cur = "";
}
}
@ -2275,7 +2270,7 @@ static NSString *endMarker = @"At end of incremental parse";
- (BOOL) _initLibXML
{
const char *file;
const unsigned char *file;
if ([src isKindOfClass: NSString_class])
{
@ -2841,7 +2836,7 @@ processingInstructionFunction(void *ctx, const unsigned char *target,
{
NSCAssert(ctx,@"No Context");
[HANDLER processInstruction: UTF8Str(target)
data: UTF8Str((const unsigned char*)data)];
data: UTF8Str(data)];
}
static void
@ -3603,7 +3598,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
- (NSString *) stringValue
{
xmlChar *string = ((xmlXPathObject*)_lib)->stringval;
return [NSString_class stringWithUTF8String: (const char*)string];
return [NSString_class stringWithUTF8String: string];
}
- (NSString *) description
{
@ -3717,7 +3712,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...)
xmlXPathObject *res;
GSXPathObject *result;
comp = xmlXPathCompile (UTF8STRING(XPathExpression));
comp = xmlXPathCompile ([XPathExpression UTF8String]);
if (comp == NULL)
{
/* Maybe an exception would be better ? */

View file

@ -1031,8 +1031,7 @@ int encode_cstrtoustr(unichar *dst, int dl, const char *src, int sl,
BOOL result;
unsigned int old = dl;
result = GSToUnicode(&dst, (unsigned int*)&dl, (unsigned char*)src,
sl, enc, 0, 0);
result = GSToUnicode(&dst, &dl, src, sl, enc, 0, 0);
if (result == NO)
{
return 0;

View file

@ -67,6 +67,7 @@ NSIndexSet.h \
NSInvocation.h \
NSKeyedArchiver.h \
NSKeyValueCoding.h \
NSKeyValueObserving.h \
NSLock.h \
NSMapTable.h \
NSMethodSignature.h \

View file

@ -192,6 +192,7 @@ NSInvocation.m \
NSKeyedArchiver.m \
NSKeyedUnarchiver.m \
NSKeyValueCoding.m \
NSKeyValueObserving.m \
NSLock.m \
NSLog.m \
NSMapTable.m \
@ -310,6 +311,7 @@ NSIndexSet.h \
NSInvocation.h \
NSKeyedArchiver.h \
NSKeyValueCoding.h \
NSKeyValueObserving.h \
NSLock.h \
NSMapTable.h \
NSMethodSignature.h \

View file

@ -40,19 +40,8 @@ static SEL oaiSel;
static Class GSInlineArrayClass;
@class GSArray;
@interface GSArrayEnumerator : NSEnumerator
{
GSArray *array;
unsigned pos;
}
- (id) initWithArray: (GSArray*)anArray;
@end
@interface GSArrayEnumeratorReverse : GSArrayEnumerator
@end
@class GSArrayEnumerator;
@class GSArrayEnumeratorReverse;
@interface GSArray : NSArray
{
@ -824,24 +813,28 @@ static Class GSInlineArrayClass;
- (NSEnumerator*) objectEnumerator
{
GSArrayEnumerator *enumerator;
enumerator = [GSArrayEnumerator allocWithZone: NSDefaultMallocZone()];
return AUTORELEASE([enumerator initWithArray: (GSArray*)self]);
return AUTORELEASE([[GSArrayEnumerator allocWithZone: NSDefaultMallocZone()]
initWithArray: self]);
}
- (NSEnumerator*) reverseObjectEnumerator
{
GSArrayEnumeratorReverse *enumerator;
enumerator = [GSArrayEnumeratorReverse allocWithZone: NSDefaultMallocZone()];
return AUTORELEASE([enumerator initWithArray: (GSArray*)self]);
return AUTORELEASE([[GSArrayEnumeratorReverse allocWithZone:
NSDefaultMallocZone()] initWithArray: self]);
}
@end
@interface GSArrayEnumerator : NSEnumerator
{
GSArray *array;
unsigned pos;
}
- (id) initWithArray: (GSArray*)anArray;
@end
@implementation GSArrayEnumerator
- (id) initWithArray: (GSArray*)anArray
@ -868,6 +861,9 @@ static Class GSInlineArrayClass;
@end
@interface GSArrayEnumeratorReverse : GSArrayEnumerator
@end
@implementation GSArrayEnumeratorReverse
- (id) initWithArray: (GSArray*)anArray

View file

@ -101,7 +101,7 @@
* method) then the count for that object is incremented rather
* than the new object being added.
*/
- (void) addObject: (id)anObject
- (void) addObject: (NSObject*)anObject
{
GSIMapNode node;
@ -301,7 +301,7 @@
* [-isEqual:] method) has been added to the set. If the count
* becomes zero, the object is removed from the set.
*/
- (void) removeObject: (id)anObject
- (void) removeObject: (NSObject*)anObject
{
GSIMapBucket bucket;

View file

@ -926,7 +926,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
#endif
SOCKET net;
struct sockaddr_in sin;
unsigned int size = sizeof(sin);
int size = sizeof(sin);
if (getAddr(a, s, p, &sin) == NO)
{
@ -2120,7 +2120,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
#else
int desc;
#endif
unsigned int blen = sizeof(buf);
int blen = sizeof(buf);
#if defined(__MINGW__)
desc = accept((SOCKET)_get_osfhandle(descriptor), (struct sockaddr*)&buf, &blen);
@ -2139,7 +2139,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{ // Accept attempt completed.
GSFileHandle *h;
struct sockaddr_in sin;
unsigned int size = sizeof(sin);
int size = sizeof(sin);
int status;
/*
@ -2238,7 +2238,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|| operation == GSSOCKSConnect)
{ // Connection attempt completed.
int result;
unsigned len = sizeof(result);
int len = sizeof(result);
#if defined(__MINGW__)
if (getsockopt((SOCKET)_get_osfhandle(descriptor), SOL_SOCKET, SO_ERROR,
@ -2496,7 +2496,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{
NSString *str = nil;
struct sockaddr_in sin;
unsigned size = sizeof(sin);
int size = sizeof(sin);
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
{
@ -2513,7 +2513,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
{
NSString *str = nil;
struct sockaddr_in sin;
unsigned size = sizeof(sin);
int size = sizeof(sin);
if (getsockname(descriptor, (struct sockaddr*)&sin, &size) == SOCKET_ERROR)
{

View file

@ -517,7 +517,7 @@ static Class mutableSetClass;
}
}
- (void) addObject: (id)anObject
- (void) addObject: (NSObject*)anObject
{
GSIMapNode node;
@ -665,7 +665,7 @@ static Class mutableSetClass;
GSIMapCleanMap(&map);
}
- (void) removeObject: (id)anObject
- (void) removeObject: (NSObject *)anObject
{
if (anObject == nil)
{

View file

@ -410,8 +410,7 @@ setup(void)
unichar *u = 0;
unsigned l = 0;
if (GSToUnicode(&u, &l, (const unsigned char*)chars, length, defEnc,
GSObjCZone(self), 0) == NO)
if (GSToUnicode(&u, &l, chars, length, defEnc, GSObjCZone(self), 0) == NO)
{
return nil;
}
@ -445,8 +444,7 @@ setup(void)
unichar *u = 0;
unsigned l = 0;
if (GSToUnicode(&u, &l, (const unsigned char*)chars, length, defEnc,
GSObjCZone(self), 0) == NO)
if (GSToUnicode(&u, &l, chars, length, defEnc, GSObjCZone(self), 0) == NO)
{
self = nil;
}
@ -694,7 +692,7 @@ UTF8String_c(GSStr self)
NSZoneFree(NSDefaultMallocZone(), u);
}
return (char*)r;
return r;
}
static inline char*
@ -717,7 +715,7 @@ UTF8String_u(GSStr self)
[NSException raise: NSCharacterConversionException
format: @"Can't get UTF8 from Unicode string."];
}
return (char*)r;
return r;
}
}
@ -753,7 +751,7 @@ boolValue_c(GSStr self)
memcpy(buf, self->_contents.c, len);
buf[len] = '\0';
return atoi((const char*)buf);
return atoi(buf);
}
}
}
@ -789,7 +787,7 @@ boolValue_u(GSStr self)
}
else
{
return atoi((const char*)buf);
return atoi(buf);
}
}
}
@ -985,7 +983,7 @@ cString_c(GSStr self, NSStringEncoding enc)
NSZoneFree(NSDefaultMallocZone(), u);
}
return (char*)r;
return r;
}
static inline char*
@ -1017,7 +1015,7 @@ cString_u(GSStr self, NSStringEncoding enc)
[NSException raise: NSCharacterConversionException
format: @"Can't get cString from Unicode string."];
}
return (char*)r;
return r;
}
}
@ -1397,7 +1395,7 @@ intValue_c(GSStr self)
memcpy(buf, self->_contents.c, len);
buf[len] = '\0';
return atol((const char*)buf);
return atol(buf);
}
}
@ -1415,7 +1413,7 @@ intValue_u(GSStr self)
unsigned char *b = buf;
GSFromUnicode(&b, &l, self->_contents.u, l, intEnc, 0, GSUniTerminate);
return atol((const char*)buf);
return atol(buf);
}
}
@ -1688,7 +1686,7 @@ static void GSStrMakeSpace(GSStr s, unsigned size)
static void GSStrWiden(GSStr s)
{
unichar *tmp = 0;
unsigned len = 0;
int len = 0;
NSCAssert(s->_flags.wide == 0, @"string is not wide");
@ -1949,7 +1947,7 @@ substring_c(GSStr self, NSRange aRange)
if (self->_flags.free == 1)
{
sub = NSAllocateObject(GSCSubStringClass, 0, NSDefaultMallocZone());
sub = [sub initWithCString: (char*)self->_contents.c + aRange.location
sub = [sub initWithCString: self->_contents.c + aRange.location
length: aRange.length
fromParent: (GSCString *)self];
}
@ -1957,7 +1955,7 @@ substring_c(GSStr self, NSRange aRange)
{
sub = NSAllocateObject(GSCInlineStringClass,
aRange.length, NSDefaultMallocZone());
sub = [sub initWithCString: (char*)self->_contents.c + aRange.location
sub = [sub initWithCString: self->_contents.c + aRange.location
length: aRange.length];
}
AUTORELEASE(sub);
@ -2281,7 +2279,7 @@ transmute(GSStr self, NSString *aString)
obj = (GSMutableString*)NSAllocateObject(GSMutableStringClass, 0,
NSDefaultMallocZone());
obj = [obj initWithCString: (char*)_contents.c length: _count];
obj = [obj initWithCString: _contents.c length: _count];
return obj;
}
@ -2290,7 +2288,7 @@ transmute(GSStr self, NSString *aString)
GSMutableString *obj;
obj = (GSMutableString*)NSAllocateObject(GSMutableStringClass, 0, z);
obj = [obj initWithCString: (char*)_contents.c length: _count];
obj = [obj initWithCString: _contents.c length: _count];
return obj;
}
@ -2348,7 +2346,7 @@ agree, create a new GSCInlineString otherwise.
NSString *obj;
obj = (NSString*)NSAllocateObject(GSCInlineStringClass, _count, z);
obj = [obj initWithCString: (char*)_contents.c length: _count];
obj = [obj initWithCString: _contents.c length: _count];
return obj;
}
else
@ -2372,7 +2370,7 @@ agree, create a new GSCInlineString otherwise.
format: @"re-initialisation of string"];
}
_count = length;
_contents.c = (unsigned char*)chars;
_contents.c = chars;
_flags.wide = 0;
if (flag == YES)
{
@ -2444,7 +2442,7 @@ agree, create a new GSCInlineString otherwise.
NSString *obj;
obj = (NSString*)NSAllocateObject(GSCInlineStringClass, _count, z);
obj = [obj initWithCString: (char*)_contents.c length: _count];
obj = [obj initWithCString: _contents.c length: _count];
return obj;
}
@ -2904,7 +2902,7 @@ agree, create a new GSUnicodeInlineString otherwise.
else
{
copy = (NSString*)NSAllocateObject(GSCInlineStringClass, _count, z);
copy = [copy initWithCString: (char*)_contents.c length: _count];
copy = [copy initWithCString: _contents.c length: _count];
}
return copy;
}
@ -3132,8 +3130,7 @@ agree, create a new GSUnicodeInlineString otherwise.
unichar *u = 0;
unsigned l = 0;
if (GSToUnicode(&u, &l, (unsigned char*)chars, length, defEnc,
GSObjCZone(self), 0) == NO)
if (GSToUnicode(&u, &l, chars, length, defEnc, GSObjCZone(self), 0) == NO)
{
DESTROY(self);
}
@ -3163,7 +3160,7 @@ agree, create a new GSUnicodeInlineString otherwise.
}
_count = length;
_capacity = length;
_contents.c = (unsigned char*)chars;
_contents.c = chars;
_flags.wide = 0;
return self;
@ -3273,7 +3270,7 @@ agree, create a new GSUnicodeInlineString otherwise.
if (_flags.wide == 1)
obj = [obj initWithCharacters: _contents.u length: _count];
else
obj = [obj initWithCString: (char*)_contents.c length: _count];
obj = [obj initWithCString: _contents.c length: _count];
return obj;
}
@ -3286,7 +3283,7 @@ agree, create a new GSUnicodeInlineString otherwise.
if (_flags.wide == 1)
obj = [obj initWithCharacters: _contents.u length: _count];
else
obj = [obj initWithCString: (char*)_contents.c length: _count];
obj = [obj initWithCString: _contents.c length: _count];
return obj;
}
@ -3396,7 +3393,7 @@ agree, create a new GSUnicodeInlineString otherwise.
{
unsigned char tmp = _contents.c[aRange.location + length];
[aString getCString: (char*)&_contents.c[aRange.location]
[aString getCString: &_contents.c[aRange.location]
maxLength: length];
_contents.c[aRange.location + length] = tmp;
}
@ -3409,7 +3406,7 @@ agree, create a new GSUnicodeInlineString otherwise.
if (l > 0)
{
[aString getCString: (char*)&_contents.c[aRange.location]
[aString getCString: &_contents.c[aRange.location]
maxLength: l];
}
u = [aString characterAtIndex: l];
@ -3478,7 +3475,7 @@ agree, create a new GSUnicodeInlineString otherwise.
l = len - 1;
if (l > 0)
{
[aString getCString: (char*)_contents.c maxLength: l];
[aString getCString: _contents.c maxLength: l];
}
_contents.c[l]
= encode_unitochar([aString characterAtIndex: l], intEnc);
@ -3517,7 +3514,7 @@ agree, create a new GSUnicodeInlineString otherwise.
{
sub = (NSString*)NSAllocateObject(GSCInlineStringClass,
_count, NSDefaultMallocZone());
sub = [sub initWithCString: (char*)self->_contents.c + aRange.location
sub = [sub initWithCString: self->_contents.c + aRange.location
length: aRange.length];
}
AUTORELEASE(sub);
@ -3543,7 +3540,7 @@ agree, create a new GSUnicodeInlineString otherwise.
sub = (NSString*)NSAllocateObject(GSCInlineStringClass,
aRange.length,
NSDefaultMallocZone());
sub = [sub initWithCString: (char*)self->_contents.c + aRange.location
sub = [sub initWithCString: self->_contents.c + aRange.location
length: aRange.length];
}
AUTORELEASE(sub);
@ -4008,7 +4005,7 @@ agree, create a new GSUnicodeInlineString otherwise.
- (const char*) cString
{
return (char*)_self->_contents.c;
return _self->_contents.c;
}
- (id) retain
@ -4215,13 +4212,13 @@ agree, create a new GSUnicodeInlineString otherwise.
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
count: count
at: chars];
self = [self initWithCStringNoCopy: (char*)chars
self = [self initWithCStringNoCopy: chars
length: count
freeWhenDone: YES];
}
else
{
self = [self initWithCStringNoCopy: (char*)0 length: 0 freeWhenDone: NO];
self = [self initWithCStringNoCopy: 0 length: 0 freeWhenDone: NO];
}
return self;
}
@ -4246,13 +4243,13 @@ agree, create a new GSUnicodeInlineString otherwise.
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
count: count
at: chars];
self = [self initWithCStringNoCopy: (char*)chars
self = [self initWithCStringNoCopy: chars
length: count
freeWhenDone: YES];
}
else
{
self = [self initWithCStringNoCopy: (char*)0 length: 0 freeWhenDone: NO];
self = [self initWithCStringNoCopy: 0 length: 0 freeWhenDone: NO];
}
return self;
}

View file

@ -394,7 +394,7 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
#if GSEQ_S == GSEQ_US
unichar *sBuf;
#else
unsigned char *sBuf;
char *sBuf;
#endif
#endif
#if GSEQ_O == GSEQ_NS
@ -404,7 +404,7 @@ GSEQ_STRCOMP(NSString *ss, NSString *os, unsigned mask, NSRange aRange)
#if GSEQ_O == GSEQ_US
unichar *oBuf;
#else
unsigned char *oBuf;
char *oBuf;
#endif
#endif

View file

@ -56,17 +56,6 @@ NSString * const NSInconsistentArchiveException =
#define PREFIX "GNUstep archive"
static SEL serSel;
static SEL tagSel;
static SEL xRefSel;
static SEL eObjSel;
static SEL eValSel;
@class NSMutableDataMalloc;
@interface NSMutableDataMalloc : NSObject // Help the compiler
@end
static Class NSMutableDataMallocClass;
/**
* <p>Implementation of [NSCoder] capable of creating sequential archives which
* must be read in the same order they were written. This class implements
@ -79,6 +68,15 @@ static Class NSMutableDataMallocClass;
*/
@implementation NSArchiver
static SEL serSel;
static SEL tagSel;
static SEL xRefSel;
static SEL eObjSel;
static SEL eValSel;
@class NSMutableDataMalloc;
static Class NSMutableDataMallocClass;
+ (void) initialize
{
if (self == [NSArchiver class])
@ -329,8 +327,8 @@ static Class NSMutableDataMallocClass;
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);

View file

@ -53,32 +53,13 @@
extern BOOL GSMacOSXCompatiblePropertyLists(void);
extern void GSPropertyListMake(id,NSDictionary*,BOOL,BOOL,unsigned,id*);
@interface NSArrayEnumerator : NSEnumerator
{
NSArray *array;
unsigned pos;
IMP get;
unsigned (*cnt)(NSArray*, SEL);
}
- (id) initWithArray: (NSArray*)anArray;
@end
@interface NSArrayEnumeratorReverse : NSArrayEnumerator
@end
@class NSArrayEnumerator;
@class NSArrayEnumeratorReverse;
@class GSArray;
@interface GSArray : NSObject // Help the compiler
@end
@class GSInlineArray;
@interface GSInlineArray : NSObject // Help the compiler
@end
@class GSMutableArray;
@interface GSMutableArray : NSObject // Help the compiler
@end
@class GSPlaceholderArray;
@interface GSPlaceholderArray : NSObject // Help the compiler
@end
static Class NSArrayClass;
static Class GSArrayClass;
@ -1917,6 +1898,16 @@ compare(id elem1, id elem2, void* context)
}
@end
@interface NSArrayEnumerator : NSEnumerator
{
NSArray *array;
unsigned pos;
IMP get;
unsigned (*cnt)(NSArray*, SEL);
}
- (id) initWithArray: (NSArray*)anArray;
@end
@implementation NSArrayEnumerator
- (id) initWithArray: (NSArray*)anArray
@ -1954,6 +1945,9 @@ compare(id elem1, id elem2, void* context)
@end
@interface NSArrayEnumeratorReverse : NSArrayEnumerator
@end
@implementation NSArrayEnumeratorReverse
- (id) initWithArray: (NSArray*)anArray

View file

@ -57,14 +57,8 @@
#include "Foundation/NSRange.h"
@class GSAttributedString;
@interface GSAttributedString : NSObject // Help the compiler
@end
@class GSMutableAttributedString;
@interface GSMutableAttributedString : NSObject // Help the compiler
@end
@class GSMutableDictionary;
@interface GSMutableDictionary : NSObject // Help the compiler
@end
static Class dictionaryClass = 0;
static SEL eqSel;

View file

@ -60,15 +60,7 @@
#define GREGORIAN_REFERENCE 730486
@class GSTimeZone;
@interface GSTimeZone : NSObject // Help the compiler
@end
@class GSAbsTimeZone;
@interface GSAbsTimeZone : NSObject // Help the compiler
@end
@class NSGDate;
@interface NSGDate : NSObject // Help the compiler
@end
static NSString *cformat = @"%Y-%m-%d %H:%M:%S %z";
@ -284,6 +276,8 @@ GSBreakTime(NSTimeInterval when, int *year, int *month, int *day,
*mil = (a - h - m - c) * 1000;
}
@class NSGDate;
/**
* An [NSDate] subclass which understands about timezones and provides
* methods for dealing with date and time information by calendar and
@ -1769,8 +1763,8 @@ static void Grow(DescriptionInfo *info, unsigned size)
unsigned char tmp[16];
int idx = 0;
sprintf((char*)tmp, "%d", v);
Grow(info, strlen((char*)tmp));
sprintf(tmp, "%d", v);
Grow(info, strlen(tmp));
while (tmp[idx] != '\0')
{
info->t[info->offset++] = tmp[idx++];

View file

@ -53,8 +53,6 @@
#endif
@class NSDataStatic;
@interface NSDataStatic : NSObject // Help the compiler
@end
@interface NSBitmapCharSet : NSCharacterSet
{

View file

@ -1814,7 +1814,7 @@ static void retEncoder (DOContext *ctxt)
NSParameterAssert(type);
NSParameterAssert(*type);
ctxt.encoder = [self _makeOutRmc: 0 generate: (int*)&ctxt.seq reply: YES];
ctxt.encoder = [self _makeOutRmc: 0 generate: &ctxt.seq reply: YES];
if (debug_connection > 4)
NSLog(@"building packet seq %d", ctxt.seq);
@ -1951,7 +1951,7 @@ static void retEncoder (DOContext *ctxt)
memset(&ctxt, 0, sizeof(ctxt));
ctxt.connection = self;
op = [self _makeOutRmc: 0 generate: (int*)&ctxt.seq reply: YES];
op = [self _makeOutRmc: 0 generate: &ctxt.seq reply: YES];
if (debug_connection > 4)
NSLog(@"building packet seq %d", ctxt.seq);
@ -2635,7 +2635,7 @@ static void callEncoder (DOContext *ctxt)
* while we run the NSRunLoop. Raise exception if we don't get anything
* before timing out.
*/
- (NSPortCoder*) _getReplyRmc: (int)sn
- _getReplyRmc: (int)sn
{
NSPortCoder *rmc;
GSIMapNode node = 0;

View file

@ -37,8 +37,6 @@
#include "Foundation/NSObjCRuntime.h"
@class GSCountedSet;
@interface GSCountedSet : NSObject // Help the compiler
@end
/*
* Class variables for uniquing objects;

View file

@ -1206,8 +1206,8 @@ failure:
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);
@ -2063,8 +2063,8 @@ failure:
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);
@ -2524,8 +2524,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);
@ -3328,8 +3328,8 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);

View file

@ -43,30 +43,6 @@
#include "GNUstepBase/GSCategories.h"
#include "GSPrivate.h"
@class GSDictionary;
@interface GSDictionary : NSObject // Help the compiler
@end
@class GSMutableDictionary;
@interface GSMutableDictionary : NSObject // Help the compiler
@end
extern BOOL GSMacOSXCompatiblePropertyLists(void);
extern void GSPropertyListMake(id,NSDictionary*,BOOL,BOOL,unsigned,id*);
static Class NSArray_class;
static Class NSDictionaryClass;
static Class NSMutableDictionaryClass;
static Class GSDictionaryClass;
static Class GSMutableDictionaryClass;
static SEL eqSel;
static SEL nxtSel;
static SEL objSel;
static SEL remSel;
static SEL setSel;
static SEL appSel;
/**
* <p>This class and its subclasses store key-value pairs, where the key and
* the value are objects. A great many utility methods for working with
@ -91,6 +67,26 @@ static SEL appSel;
*/
@implementation NSDictionary
@class GSDictionary;
@class GSMutableDictionary;
extern BOOL GSMacOSXCompatiblePropertyLists(void);
extern void GSPropertyListMake(id,NSDictionary*,BOOL,BOOL,unsigned,id*);
static Class NSArray_class;
static Class NSDictionaryClass;
static Class NSMutableDictionaryClass;
static Class GSDictionaryClass;
static Class GSMutableDictionaryClass;
static SEL eqSel;
static SEL nxtSel;
static SEL objSel;
static SEL remSel;
static SEL setSel;
static SEL appSel;
+ (void) initialize
{
if (self == [NSDictionary class])

View file

@ -115,7 +115,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
* equivalent to calling +notificationCenterForType: with
* <code>NSLocalNotificationCenterType</code> as its argument.
*/
+ (NSNotificationCenter*) defaultCenter
+ (id) defaultCenter
{
return [self notificationCenterForType: NSLocalNotificationCenterType];
}
@ -132,7 +132,7 @@ static NSDistributedNotificationCenter *netCenter = nil;
* a notificatiuon center used by processes on the local network.<br />
* MacOS-X supports only <code>NSLocalNotificationCenterType</code>.
*/
+ (NSNotificationCenter*) notificationCenterForType: (NSString*)type
+ (id) notificationCenterForType: (NSString*)type
{
if ([type isEqual: NSLocalNotificationCenterType] == YES)
{

View file

@ -3075,7 +3075,7 @@ static NSSet *fileKeys = nil;
return [GSAttrDictionaryEnumerator enumeratorFor: self];
}
- (id) objectForKey: (id)key
- (id) objectForKey: (NSString*)key
{
int count = 0;

View file

@ -170,8 +170,8 @@ typedef struct {
} GSPortMsgHeader;
typedef struct {
unsigned char version;
unsigned char addr[0]; /* name of the socket in the port directory */
char version;
char addr[0]; /* name of the socket in the port directory */
} GSPortInfo;
/*
@ -271,14 +271,14 @@ newDataWithEncodedPort(NSMessagePort *port)
unsigned plen;
const unsigned char *name = [port _name];
plen = 2 + strlen((char*)name);
plen = 2 + strlen(name);
data = [[NSMutableData alloc] initWithLength: sizeof(GSPortItemHeader)+plen];
pih = (GSPortItemHeader*)[data mutableBytes];
pih->type = GSSwapHostI32ToBig(GSP_PORT);
pih->length = GSSwapHostI32ToBig(plen);
pi = (GSPortInfo*)&pih[1];
strcpy((char*)pi->addr, (char*)name);
strcpy(pi->addr, name);
NSDebugFLLog(@"NSMessagePort", @"Encoded port as '%s'", pi->addr);
@ -409,7 +409,7 @@ static Class runLoopClass;
name = [aPort _name];
memset(&sockAddr, '\0', sizeof(sockAddr));
sockAddr.sun_family = AF_LOCAL;
strncpy(sockAddr.sun_path, (char*)name, sizeof(sockAddr.sun_path));
strncpy(sockAddr.sun_path, name, sizeof(sockAddr.sun_path));
if (connect(desc, (struct sockaddr*)&sockAddr, SUN_LEN(&sockAddr)) < 0)
{
@ -927,8 +927,8 @@ static Class runLoopClass;
{
if (state == GS_H_TRYCON) /* Connection attempt. */
{
int res = 0;
unsigned len = sizeof(res);
int res = 0;
int len = sizeof(res);
if (getsockopt(desc, SOL_SOCKET, SO_ERROR, (char*)&res, &len) == 0
&& res != 0)
@ -1216,8 +1216,8 @@ static int unique_index = 0;
[[NSProcessInfo processInfo] processIdentifier], unique_index++]];
M_UNLOCK(messagePortLock);
return RETAIN([self _portWithName:
(unsigned char*)[path fileSystemRepresentation] listener: YES]);
return RETAIN([self _portWithName: [path fileSystemRepresentation]
listener: YES]);
}
/*
@ -1233,7 +1233,7 @@ static int unique_index = 0;
NSData *theName;
theName = [[NSData alloc] initWithBytes: socketName
length: strlen((char*)socketName)+1];
length: strlen(socketName)+1];
M_LOCK(messagePortLock);
@ -1263,8 +1263,7 @@ static int unique_index = 0;
*/
memset(&sockaddr, '\0', sizeof(sockaddr));
sockaddr.sun_family = AF_LOCAL;
strncpy(sockaddr.sun_path, (char*)socketName,
sizeof(sockaddr.sun_path));
strncpy(sockaddr.sun_path, socketName, sizeof(sockaddr.sun_path));
/*
* Need size of buffer for getsockbyname() later.
@ -1626,7 +1625,7 @@ static int unique_index = 0;
if (desc == listener)
{
struct sockaddr_un sockAddr;
unsigned size = sizeof(sockAddr);
int size = sizeof(sockAddr);
desc = accept(listener, (struct sockaddr*)&sockAddr, &size);
if (desc < 0)

View file

@ -251,7 +251,7 @@ static void clean_up_names(void)
NSDebugLLog(@"NSMessagePort", @"got %s", socket_path);
return [NSMessagePort _portWithName: (unsigned char*)socket_path
return [NSMessagePort _portWithName: socket_path
listener: NO];
}
@ -290,10 +290,10 @@ static void clean_up_names(void)
socket_name = [(NSMessagePort *)port _name];
write(fd, (char*)socket_name, strlen((char*)socket_name));
write(fd, socket_name, strlen(socket_name));
write(fd, "\n", 1);
sprintf((char*)buf, "%i\n", getpid());
write(fd, (char*)buf, strlen((char*)buf));
sprintf(buf, "%i\n", getpid());
write(fd, buf, strlen(buf));
close(fd);
@ -376,7 +376,7 @@ static void clean_up_names(void)
port_path = [(NSMessagePort *)port _name];
if (!strcmp((char*)socket_path, (char*)port_path))
if (!strcmp(socket_path, port_path))
{
unlink([path fileSystemRepresentation]);
}

View file

@ -46,8 +46,8 @@
return nil;
}
newMs = AUTORELEASE([NSMethodSignature alloc]);
newMs->_methodTypes = mframe_build_signature(t, (int*)&newMs->_argFrameLength,
(int*)&newMs->_numArgs, 0);
newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength,
&newMs->_numArgs, 0);
return newMs;
}

View file

@ -29,10 +29,6 @@
#include "Foundation/NSCoder.h"
#include "Foundation/NSString.h"
@class GSNotification;
@interface GSNotification : NSObject // Help the compiler
@end
/**
* <p>Represents a notification for posting to an [NSNotificationCenter].
* Consists of a name, an object, and an optional dictionary. The
@ -47,7 +43,9 @@
static Class abstractClass = 0;
static Class concreteClass = 0;
+ (id) allocWithZone: (NSZone*)z
@class GSNotification;
+ (NSNotification*) allocWithZone: (NSZone*)z
{
if (self == abstractClass)
{

View file

@ -31,7 +31,6 @@
#include <objc/Protocol.h>
#include "Foundation/NSMethodSignature.h"
#include "Foundation/NSInvocation.h"
#include "Foundation/NSLock.h"
#include "Foundation/NSAutoreleasePool.h"
#include "Foundation/NSString.h"
#include "Foundation/NSArray.h"
@ -76,16 +75,6 @@ static Class NSConstantStringClass;
@class NSDataMalloc;
@class NSMutableDataMalloc;
@interface NSZombie
{
Class isa;
}
- (Class) class;
- (retval_t) forward:(SEL)aSel :(arglist_t)argFrame;
- (void) forwardInvocation: (NSInvocation*)anInvocation;
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
@end
/*
* allocationLock is needed when running multi-threaded for retain/release
* to work reliably.
@ -1524,7 +1513,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
/**
* This method is called automatically to handle a message sent to
* the receiver for which the receivers class has no method.<br />
* The default implementation calls -doesNotRecognizeSelector:
* The default implemnentation calls -doesNotRecognizeSelector:
*/
- (void) forwardInvocation: (NSInvocation*)anInvocation
{
@ -2432,11 +2421,13 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
@interface NSZombie
- (retval_t) forward:(SEL)aSel :(arglist_t)argFrame;
- (void) forwardInvocation: (NSInvocation*)anInvocation;
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
@end
@implementation NSZombie
- (Class) class
{
return object_get_class(self);
}
- (retval_t) forward:(SEL)aSel :(arglist_t)argFrame
{
if (aSel == 0)

View file

@ -103,7 +103,7 @@
/**
* Returns the file handle for reading from the pipe.
*/
- (NSFileHandle*) fileHandleForReading
- (id) fileHandleForReading
{
return readHandle;
}
@ -111,7 +111,7 @@
/**
* Returns the file handle for writing to the pipe.
*/
- (NSFileHandle*) fileHandleForWriting
- (id) fileHandleForWriting
{
return writeHandle;
}

View file

@ -46,10 +46,6 @@
#include "Foundation/NSPort.h"
#include "Foundation/NSString.h"
@class NSMutableDataMalloc;
@interface NSMutableDataMalloc : NSObject // Help the compiler
@end
/*
* Setup for inline operation of pointer map tables.
*/
@ -299,6 +295,8 @@ typeCheck(char t1, char t2)
@implementation NSPortCoder
@class NSMutableDataMalloc;
static Class connectionClass;
static Class mutableArrayClass;
static Class mutableDataClass;
@ -744,8 +742,8 @@ static IMP _xRefImp; /* Serialize a crossref. */
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);
@ -1349,8 +1347,8 @@ static IMP _xRefImp; /* Serialize a crossref. */
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);

View file

@ -49,12 +49,10 @@
extern BOOL GSScanDouble(unichar*, unsigned, double*);
@class GSString;
@class GSMutableString;
@class GSMutableArray;
@interface GSMutableArray : NSObject // Help the compiler
@end
@class GSMutableDictionary;
@interface GSMutableDictionary : NSObject // Help the compiler
@end
@interface GSBinaryPLParser : NSObject
{
@ -2752,8 +2750,8 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
else if ((next >= 0x50) && (next < 0x5F))
{
// Short string
unsigned len = next - 0x50;
char buffer[len+1];
unsigned len = next - 0x50;
unsigned char buffer[len+1];
[data getBytes: buffer range: NSMakeRange(counter, len)];
buffer[len] = '\0';

View file

@ -73,11 +73,11 @@ NSRangeFromString(NSString *aString)
if ((*scanStringImp)(scanner, scanStringSel, @"{", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"location", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"=", NULL)
&& (*scanIntImp)(scanner, scanIntSel, (int*)&range.location)
&& (*scanIntImp)(scanner, scanIntSel, &range.location)
&& (*scanStringImp)(scanner, scanStringSel, @",", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"length", NULL)
&& (*scanStringImp)(scanner, scanStringSel, @"=", NULL)
&& (*scanIntImp)(scanner, scanIntSel, (int*)&range.length)
&& (*scanIntImp)(scanner, scanIntSel, &range.length)
&& (*scanStringImp)(scanner, scanStringSel, @"}", NULL))
return range;
else

View file

@ -51,17 +51,26 @@
#define ULONG_LONG_MAX ULLONG_MAX
#endif
/**
* <p>
* The <code>NSScanner</code> class cluster (currently a single class in
* GNUstep) provides a mechanism to parse the contents of a string into
* number and string values by making a sequence of scan operations to
* step through the string retrieving successive items.
* </p>
* <p>
* You can tell the scanner whether its scanning is supposed to be
* case sensitive or not, and you can specify a set of characters
* to be skipped before each scanning operation (by default,
* whitespace and newlines).
* </p>
*/
@implementation NSScanner
@class GSCString;
@interface GSCString : NSObject // Help the compiler
@end
@class GSUnicodeString;
@interface GSUnicodeString : NSObject // Help the compiler
@end
@class GSMutableString;
@class GSPlaceholderString;
@interface GSPlaceholderString : NSObject // Help the compiler
@end
static Class NSStringClass;
static Class GSCStringClass;
@ -97,22 +106,6 @@ typedef struct {
(_scanLocation >= myLength()) ? NO : YES;\
})
/**
* <p>
* The <code>NSScanner</code> class cluster (currently a single class in
* GNUstep) provides a mechanism to parse the contents of a string into
* number and string values by making a sequence of scan operations to
* step through the string retrieving successive items.
* </p>
* <p>
* You can tell the scanner whether its scanning is supposed to be
* case sensitive or not, and you can specify a set of characters
* to be skipped before each scanning operation (by default,
* whitespace and newlines).
* </p>
*/
@implementation NSScanner
+ (void) initialize
{
if (self == [NSScanner class])
@ -202,9 +195,8 @@ typedef struct {
else
{
_isUnicode = NO;
_string = [_holder initWithCString:
(char*)((ivars)aString)->_contents.c
length: ((ivars)aString)->_count];
_string = [_holder initWithCString: ((ivars)aString)->_contents.c
length: ((ivars)aString)->_count];
}
}
else if (c == NSConstantStringClass)

View file

@ -43,25 +43,13 @@
@class GSDictionary;
@class GSMutableDictionary;
@interface GSMutableDictionary : NSObject // Help the compiler
@end
@class NSDataMalloc;
@interface NSDataMalloc : NSObject // Help the compiler
@end
@class GSInlineArray;
@class GSMutableArray;
@interface GSMutableArray : NSObject // Help the compiler
@end
@class GSCString;
@interface GSCString : NSObject // Help the compiler
@end
@class GSCBufferString;
@interface GSCBufferString : NSObject // Help the compiler
@end
@class GSUnicodeString;
@class GSUnicodeBufferString;
@interface GSUnicodeBufferString : NSObject // Help the compiler
@end
@class GSMutableString;
/*

View file

@ -39,11 +39,7 @@
#include "GSPrivate.h"
@class GSSet;
@interface GSSet : NSObject // Help the compiler
@end
@class GSMutableSet;
@interface GSMutableSet : NSObject // Help the compiler
@end
/**
* <code>NSSet</code> maintains an unordered collection of unique objects

View file

@ -1076,7 +1076,7 @@ static Class runLoopClass;
if (state == GS_H_TRYCON) /* Connection attempt. */
{
int res = 0;
unsigned len = sizeof(res);
int len = sizeof(res);
if (getsockopt(desc, SOL_SOCKET, SO_ERROR, (char*)&res, &len) == 0
&& res != 0)
@ -2117,7 +2117,7 @@ static unsigned wordAlign;
#endif
{
struct sockaddr_in sockAddr;
unsigned size = sizeof(sockAddr);
int size = sizeof(sockAddr);
desc = accept(listener, (struct sockaddr*)&sockAddr, &size);
if (desc == INVALID_SOCKET)

View file

@ -483,7 +483,7 @@ typedef enum {
msg.ptype = GDO_TCP_GDO; /* Port is TCP port for GNU DO */
msg.port = 0;
msg.nsize = [name cStringLength];
[name getCString: (char*)msg.name];
[name getCString: msg.name];
TEST_RELEASE(data);
data = [NSMutableData dataWithBytes: (void*)&msg length: sizeof(msg)];
IF_NO_GC(RETAIN(data));
@ -495,7 +495,7 @@ typedef enum {
msg.rtype = GDO_REGISTER; /* Register a port. */
msg.ptype = GDO_TCP_GDO; /* Port is TCP port for GNU DO */
msg.nsize = [name cStringLength];
[name getCString: (char*)msg.name];
[name getCString: msg.name];
msg.port = GSSwapHostI32ToBig(portNumber);
TEST_RELEASE(data);
data = [NSMutableData dataWithBytes: (void*)&msg length: sizeof(msg)];
@ -514,7 +514,7 @@ typedef enum {
else
{
msg.nsize = [name cStringLength];
[name getCString: (char*)msg.name];
[name getCString: msg.name];
}
msg.port = GSSwapHostI32ToBig(portNumber);
TEST_RELEASE(data);

View file

@ -89,16 +89,8 @@ extern BOOL GSScanDouble(unichar*, unsigned, double*);
@class GSString;
@class GSMutableString;
@class GSPlaceholderString;
@interface GSPlaceholderString : NSObject // Help the compiler
@end
@class GSMutableArray;
@class GSMutableDictionary;
@class NSImmutableString;
@interface NSImmutableString : NSObject // Help the compiler
@end
@class GSImmutableString;
@interface GSImmutableString : NSObject // Help the compiler
@end
/*
@ -1152,8 +1144,8 @@ handle_printf_atsign (FILE *stream,
unichar *buf = 0;
unsigned int l = 0;
if (GSToUnicode(&buf, &l, (unsigned char*)byteString, length,
_DefaultStringEncoding, [self zone], 0) == NO)
if (GSToUnicode(&buf, &l, byteString, length, _DefaultStringEncoding,
[self zone], 0) == NO)
{
DESTROY(self);
}
@ -1287,8 +1279,8 @@ handle_printf_atsign (FILE *stream,
unichar *u = 0;
unsigned int l = 0;
if (GSToUnicode(&u, &l, (unsigned char*)bytes, length,
NSUTF8StringEncoding, GSObjCZone(self), 0) == NO)
if (GSToUnicode(&u, &l, bytes, length, NSUTF8StringEncoding,
GSObjCZone(self), 0) == NO)
{
DESTROY(self);
}
@ -1404,7 +1396,7 @@ handle_printf_atsign (FILE *stream,
}
else
{
self = [self initWithCString: (char*)f._contents.c length: f._count];
self = [self initWithCString: f._contents.c length: f._count];
}
/*
@ -1483,7 +1475,7 @@ handle_printf_atsign (FILE *stream,
if (i == len)
{
self = [self initWithCString: (char*)bytes length: len];
self = [self initWithCString: bytes length: len];
}
else
{
@ -3348,7 +3340,7 @@ handle_printf_atsign (FILE *stream,
else
{
unsigned char *b = 0;
unsigned l = 0;
int l = 0;
unichar *u;
u = (unichar*)NSZoneMalloc(NSDefaultMallocZone(), len*sizeof(unichar));
@ -4870,7 +4862,7 @@ static NSFileManager *fm = nil;
else if (enc == NSASCIIStringEncoding
|| enc == _DefaultStringEncoding)
{
char *chars;
unsigned char *chars;
chars = NSZoneMalloc(zone, count+1);
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
@ -4889,7 +4881,7 @@ static NSFileManager *fm = nil;
count: count
at: chars];
chars[count] = '\0';
self = [self initWithUTF8String: (char*)chars];
self = [self initWithUTF8String: chars];
NSZoneFree(zone, chars);
}
else
@ -5049,7 +5041,7 @@ static NSFileManager *fm = nil;
/**
* Constructs an empty string.
*/
+ (id) string
+ (NSMutableString*) string
{
return AUTORELEASE([[GSMutableStringClass allocWithZone:
NSDefaultMallocZone()] initWithCapacity: 0]);
@ -5068,8 +5060,8 @@ static NSFileManager *fm = nil;
* Create a string of unicode characters.
*/
// Inefficient implementation.
+ (id) stringWithCharacters: (const unichar*)characters
length: (unsigned int)length
+ (NSString*) stringWithCharacters: (const unichar*)characters
length: (unsigned int)length
{
return AUTORELEASE([[GSMutableStringClass allocWithZone:
NSDefaultMallocZone()] initWithCharacters: characters length: length]);
@ -5091,7 +5083,7 @@ static NSFileManager *fm = nil;
* null-terminated and encoded in the default C string encoding. (Characters
* will be converted to unicode representation internally.)
*/
+ (id) stringWithCString: (const char*)byteString
+ (NSString*) stringWithCString: (const char*)byteString
{
return AUTORELEASE([[GSMutableStringClass allocWithZone:
NSDefaultMallocZone()] initWithCString: byteString]);
@ -5102,8 +5094,8 @@ static NSFileManager *fm = nil;
* null bytes and should be encoded in the default C string encoding.
* (Characters will be converted to unicode representation internally.)
*/
+ (id) stringWithCString: (const char*)byteString
length: (unsigned int)length
+ (NSString*) stringWithCString: (const char*)byteString
length: (unsigned int)length
{
return AUTORELEASE([[GSMutableStringClass allocWithZone:
NSDefaultMallocZone()] initWithCString: byteString length: length]);
@ -5114,7 +5106,7 @@ static NSFileManager *fm = nil;
* be a constant format string, like '<code>@"float val = %f"</code>', remaining
* arguments should be the variables to print the values of, comma-separated.
*/
+ (id) stringWithFormat: (NSString*)format, ...
+ (NSString*) stringWithFormat: (NSString*)format, ...
{
va_list ap;
va_start(ap, format);
@ -5313,6 +5305,8 @@ static NSFileManager *fm = nil;
* The methods in this category are not available in MacOS-X
*/
@implementation NSMutableString (GNUstep)
@class NSImmutableString;
@class GSImmutableString;
/**
* Returns a proxy to the receiver which will allow access to the

View file

@ -53,55 +53,13 @@
#include "Foundation/NSConnection.h"
#include "Foundation/NSInvocation.h"
@class GSPerformHolder;
typedef struct { @defs(NSThread) } NSThread_ivars;
static Class threadClass = Nil;
static NSNotificationCenter *nc = nil;
/**
* This class performs a dual function ...
* <p>
* As a class, it is responsible for handling incoming events from
* the main runloop on a special inputFd. This consumes any bytes
* written to wake the main runloop.<br />
* During initialisation, the default runloop is set up to watch
* for data arriving on inputFd.
* </p>
* <p>
* As instances, each instance retains perform receiver and argument
* values as long as they are needed, and handles locking to support
* mthods which want to block until an action has been performed.
* </p>
* <p>
* The initialize method of this class is called before any new threads
* run.
* </p>
*/
@interface GSPerformHolder : NSObject
{
id receiver;
id argument;
SEL selector;
NSArray *modes;
NSConditionLock *lock; // Not retained.
}
+ (BOOL) isValid;
+ (GSPerformHolder*) newForReceiver: (id)r
argument: (id)a
selector: (SEL)s
modes: (NSArray*)m
lock: (NSConditionLock*)l;
+ (void) receivedEvent: (void*)data
type: (RunLoopEventType)type
extra: (void*)extra
forMode: (NSString*)mode;
+ (NSDate*) timedOutEvent: (void*)data
type: (RunLoopEventType)type
forMode: (NSString*)mode;
- (void) fire;
@end
/**
* Sleep until the current date/time is the specified time interval
* past the reference date/time.<br />
@ -790,6 +748,49 @@ gnustep_base_thread_callback(void)
/**
* This class performs a dual function ...
* <p>
* As a class, it is responsible for handling incoming events from
* the main runloop on a special inputFd. This consumes any bytes
* written to wake the main runloop.<br />
* During initialisation, the default runloop is set up to watch
* for data arriving on inputFd.
* </p>
* <p>
* As instances, each instance retains perform receiver and argument
* values as long as they are needed, and handles locking to support
* mthods which want to block until an action has been performed.
* </p>
* <p>
* The initialize method of this class is called before any new threads
* run.
* </p>
*/
@interface GSPerformHolder : NSObject
{
id receiver;
id argument;
SEL selector;
NSArray *modes;
NSConditionLock *lock; // Not retained.
}
+ (BOOL) isValid;
+ (GSPerformHolder*) newForReceiver: (id)r
argument: (id)a
selector: (SEL)s
modes: (NSArray*)m
lock: (NSConditionLock*)l;
+ (void) receivedEvent: (void*)data
type: (RunLoopEventType)type
extra: (void*)extra
forMode: (NSString*)mode;
+ (NSDate*) timedOutEvent: (void*)data
type: (RunLoopEventType)type
forMode: (NSString*)mode;
- (void) fire;
@end
@implementation GSPerformHolder
static NSLock *subthreadsLock = nil;

View file

@ -2250,7 +2250,7 @@ newDetailInZoneForType(GSTimeZone *zone, TypeInfo *type)
types[i].offset = decode(ptr->offset);
pos += sizeof(struct ttinfo);
}
abbr = (unsigned char*)(bytes + pos);
abbr = (char*)(bytes + pos);
{
id abbrevs[charcnt];
@ -2261,8 +2261,7 @@ newDetailInZoneForType(GSTimeZone *zone, TypeInfo *type)
if (abbrevs[loc] == nil)
{
abbrevs[loc]
= [[NSString alloc] initWithCString: (char*)abbr + loc];
abbrevs[loc] = [[NSString alloc] initWithCString: abbr + loc];
}
else
{

View file

@ -34,8 +34,6 @@
#include "Foundation/NSInvocation.h"
@class NSGDate;
@interface NSGDate : NSObject // Help the compiler
@end
static Class NSDate_class;
/**
@ -331,7 +329,7 @@ static Class NSDate_class;
/**
* Compares timers based on the date at which they should next fire.
*/
- (NSComparisonResult) compare: (id)anotherTimer
- (NSComparisonResult) compare: (NSTimer*)anotherTimer
{
if (anotherTimer == self)
{
@ -344,7 +342,7 @@ static Class NSDate_class;
}
else
{
return [_date compare: ((NSTimer*)anotherTimer)->_date];
return [_date compare: anotherTimer->_date];
}
return 0;
}

View file

@ -38,20 +38,9 @@
#include "Foundation/NSRunLoop.h"
#include "Foundation/NSFileManager.h"
@class GSFileURLHandle;
@class GSFTPURLHandle;
@interface GSFTPURLHandle : NSObject // Help the compiler
@end
@class GSHTTPURLHandle;
@interface GSHTTPURLHandle : NSObject // Help the compiler
@end
@interface GSFileURLHandle : NSURLHandle
{
NSString *_path;
NSMutableDictionary *_attributes;
}
@end
/*
* Keys for NSURLHandle
@ -604,6 +593,13 @@ static Class NSURLHandleClass = 0;
@end
@interface GSFileURLHandle : NSURLHandle
{
NSString *_path;
NSMutableDictionary *_attributes;
}
@end
/**
* <p>
* This is a <em>PRIVATE</em> subclass of NSURLHandle.

View file

@ -51,10 +51,6 @@
#include "Foundation/NSString.h"
#include "Foundation/NSArray.h"
@class NSDataMalloc;
@interface NSDataMalloc : NSObject // Help the compiler
@end
static const char*
typeToName1(char type)
{
@ -345,6 +341,7 @@ mapClassName(NSUnarchiverObjectInfo *info)
*/
@implementation NSUnarchiver
@class NSDataMalloc;
static Class NSDataMallocClass;
+ (void) initialize
@ -806,8 +803,8 @@ static Class NSDataMallocClass;
objc_layout_structure (type, &layout);
while (objc_layout_structure_next_member (&layout))
{
unsigned offset;
unsigned align;
int offset;
int align;
const char *ftype;
objc_layout_structure_get_info (&layout, &offset, &align, &ftype);

View file

@ -36,7 +36,6 @@
#include "Foundation/NSArchiver.h"
#include "Foundation/NSArray.h"
#include "Foundation/NSBundle.h"
#include "Foundation/NSData.h"
#include "Foundation/NSDate.h"
#include "Foundation/NSDictionary.h"
#include "Foundation/NSDistributedLock.h"

View file

@ -42,30 +42,12 @@
@end
@class GSValue;
@interface GSValue : NSObject // Help the compiler
@end
@class GSNonretainedObjectValue;
@interface GSNonretainedObjectValue : NSObject // Help the compiler
@end
@class GSPointValue;
@interface GSPointValue : NSObject // Help the compiler
@end
@class GSPointerValue;
@interface GSPointerValue : NSObject // Help the compiler
@end
@class GSRangeValue;
@interface GSRangeValue : NSObject // Help the compiler
@end
@class GSRectValue;
@interface GSRectValue : NSObject // Help the compiler
@end
@class GSSizeValue;
@interface GSSizeValue : NSObject // Help the compiler
@end
@class NSDataStatic; // Needed for decoding.
@interface NSDataStatic : NSObject // Help the compiler
@end
static Class abstractClass;
static Class concreteClass;
@ -404,6 +386,8 @@ static NSLock *placeholderLock;
RELEASE(d);
}
@class NSDataStatic; // Neede for decoding.
- (id) initWithCoder: (NSCoder *)coder
{
char type[64];

View file

@ -1573,7 +1573,7 @@ mframe_destroy_argframe(const char *types, arglist_t argframe)
BOOL
mframe_decode_return (const char *type, void* buffer, void* retframe)
{
unsigned int size = 0;
int size = 0;
type = objc_skip_type_qualifiers(type);
NSGetSizeAndAlignment(type, &size, 0);

View file

@ -54,6 +54,7 @@ CHECKABLE_TOOLS = \
nshost \
nsindexset \
nsinvocation \
nskvo \
nsmaptable \
nsmethodsignature \
nsnotification \
@ -113,6 +114,7 @@ nshashtable_OBJC_FILES = nshashtable.m
nshost_OBJC_FILES = nshost.m
nsindexset_OBJC_FILES = nsindexset.m
nsinvocation_OBJC_FILES = nsinvocation.m
nskvo_OBJC_FILES = nskvo.m
nsmaptable_OBJC_FILES = nsmaptable.m
nsmethodsignature_OBJC_FILES = nsmethodsignature.m
nsnotification_OBJC_FILES = nsnotification.m

View file

@ -399,15 +399,13 @@ static NSString *mainFont = nil;
else if (classname != nil && category == nil)
{
NSArray *catNames;
NSDictionary *d;
/*
* For a class, we want to list methods in any associated
* categories as well as those of the class itself.
*/
d = [refs objectForKey: @"categories"];
d = [d objectForKey: classname];
catNames = [d allKeys];
catNames = [[[refs objectForKey: @"categories"]
objectForKey: classname] allKeys];
if ((c = [catNames count]) > 0)
{
NSMutableDictionary *m = [dict mutableCopy];

View file

@ -487,14 +487,10 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
//PENDING, should we worry about not overriding entries?
while ((name = [pnames nextObject]) != nil)
{
NSMutableDictionary *d;
d = [refs objectForKey: @"category"];
file = [d objectForKey: name];
file = [[refs objectForKey: @"category"] objectForKey: name];
if (file != nil)
{
d = [refs objectForKey: @"protocol"];
[d setObject: file forKey: name];
[[refs objectForKey: @"protocol"] setObject: file forKey: name];
}
else
{
@ -665,7 +661,7 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
/**
* Return a list of source files for the header.
*/
- (NSMutableArray*) sourcesForHeader: (NSString*)h
- (NSArray*) sourcesForHeader: (NSString*)h
{
NSDictionary *dict = [refs objectForKey: @"source"];
NSArray *array = [dict objectForKey: h];

View file

@ -756,11 +756,8 @@ static BOOL snuggleStart(NSString *t)
while (i-- > 0)
{
NSString *n;
NSDictionary *d;
NSString *n = [[aa objectAtIndex: i] objectForKey: @"Name"];
d = [aa objectAtIndex: i];
n = [d objectForKey: @"Name"];
if (n != nil)
{
[tmp addObject: n];

View file

@ -179,7 +179,7 @@ static void init_iface();
static void load_iface(const char* from);
static void init_ports();
static void init_probe();
static void queue_msg(struct sockaddr_in* a, uptr d, unsigned l);
static void queue_msg(struct sockaddr_in* a, uptr d, int l);
static void queue_pop();
static void queue_probe(struct in_addr* to, struct in_addr *from,
int num_extras, struct in_addr* extra, int is_reply);
@ -575,7 +575,7 @@ static int udp_pending = 0;
* on the UDP socket.
*/
static void
queue_msg(struct sockaddr_in* a, uptr d, unsigned l)
queue_msg(struct sockaddr_in* a, uptr d, int l)
{
struct u_data* entry = (struct u_data*)malloc(sizeof(struct u_data));
@ -657,7 +657,7 @@ map_add(uptr n, unsigned char l, unsigned int p, unsigned char t)
int i;
m->port = p;
m->name = (unsigned char*)malloc(l);
m->name = (char*)malloc(l);
m->size = l;
m->net = (t & GDO_NET_MASK);
m->svc = (t & GDO_SVC_MASK);
@ -1258,7 +1258,7 @@ init_iface()
if (addr != 0) free(addr);
addr = (struct in_addr*)malloc((MAX_IFACE+1)*IASIZE);
if (bcok != 0) free(bcok);
bcok = (unsigned char*)malloc((MAX_IFACE+1)*sizeof(char));
bcok = (char*)malloc((MAX_IFACE+1)*sizeof(char));
if (bcst != 0) free(bcst);
bcst = (struct in_addr*)malloc((MAX_IFACE+1)*IASIZE);
if (mask != 0) free(mask);
@ -1469,7 +1469,7 @@ load_iface(const char* from)
num_iface++;
addr = (struct in_addr*)malloc((num_iface+1)*IASIZE);
mask = (struct in_addr*)malloc((num_iface+1)*IASIZE);
bcok = (unsigned char*)malloc((num_iface+1)*sizeof(char));
bcok = (char*)malloc((num_iface+1)*sizeof(char));
bcst = (struct in_addr*)malloc((num_iface+1)*IASIZE);
addr[interfaces].s_addr = inet_addr("127.0.0.1");
@ -2151,7 +2151,7 @@ static void
handle_accept()
{
struct sockaddr_in sa;
unsigned len = sizeof(sa);
int len = sizeof(sa);
int desc;
desc = accept(tcp_desc, (void*)&sa, &len);
@ -2478,7 +2478,7 @@ handle_recv()
RInfo *ri;
uptr ptr;
struct sockaddr_in* addr;
unsigned len = sizeof(struct sockaddr_in);
int len = sizeof(struct sockaddr_in);
int r;
ri = getRInfo(udp_desc, 0);
@ -2543,7 +2543,7 @@ handle_request(int desc)
size = ri->buf.r.nsize;
ptype = ri->buf.r.ptype;
port = ntohl(ri->buf.r.port);
buf = (unsigned char*)ri->buf.r.name;
buf = ri->buf.r.name;
FD_CLR(desc, &read_fds);
FD_SET(desc, &write_fds);
@ -3147,7 +3147,7 @@ handle_request(int desc)
*/
if (desc == udp_desc)
{
queue_msg(&ri->addr, (unsigned char*)wi->buf, wi->len);
queue_msg(&ri->addr, wi->buf, wi->len);
clear_chan(desc);
}
}
@ -3892,8 +3892,7 @@ nameServer(const char* name, const char* host, int op, int ptype, struct sockadd
continue;
}
if (tryHost(GDO_LOOKUP, len, (unsigned char*)name,
ptype, &sin, &port, 0)==0)
if (tryHost(GDO_LOOKUP, len, name, ptype, &sin, &port, 0)==0)
{
if (port != 0)
{
@ -3924,7 +3923,7 @@ nameServer(const char* name, const char* host, int op, int ptype, struct sockadd
{
port = (unsigned short)pnum;
}
rval = tryHost(op, len, (unsigned char*)name, ptype, &sin, &port, 0);
rval = tryHost(op, len, name, ptype, &sin, &port, 0);
if (rval != 0 && host == local_hostname)
{
sprintf(ebuf, "failed to contact gdomap on %s(%s) - %s",

View file

@ -212,7 +212,7 @@ typedef struct {
unsigned char ptype; /* Type of port registered. */
unsigned char dummy;
unsigned int port;
unsigned char name[GDO_NAME_MAX_LEN+1];
char name[GDO_NAME_MAX_LEN+1];
} gdo_req;
#define GDO_REQ_SIZE sizeof(gdo_req) /* Size of a request packet. */

View file

@ -347,17 +347,17 @@ static int ParseFile(const char *filename,NSMutableDictionary *tables)
NSString *key,*comment,*table;
/* TODO: let user specify source file encoding */
key=[NSString stringWithCString: (char*)args[lf->key_index]];
key=[NSString stringWithCString: args[lf->key_index]];
if (lf->comment_index==-1 || !arg_len[lf->comment_index])
comment=nil;
else
comment=[NSString stringWithCString: (char*)args[lf->comment_index]];
comment=[NSString stringWithCString: args[lf->comment_index]];
if (lf->table_index==-1)
table=@"Localizable"; /* TODO: customizable? */
else
table=[NSString stringWithCString: (char*)args[lf->table_index]];
table=[NSString stringWithCString: args[lf->table_index]];
e=[[SourceEntry alloc] initWithKey: key comment: comment file: filenamestr line: cur_line];
[tables addEntry: e toTable: table];