mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-26 10:11:03 +00:00
Minor fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10674 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a0ef32c1ec
commit
7d4e3075ea
3 changed files with 131 additions and 108 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2001-08-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSDistantObject.m: Tidy method lookup code.
|
||||||
|
* Source/NSString.m: Handle nil content when parsing xml elements.
|
||||||
|
|
||||||
2001-08-06 Willem Rein Oudshoorn <wim@xs4all.nl>
|
2001-08-06 Willem Rein Oudshoorn <wim@xs4all.nl>
|
||||||
|
|
||||||
* Source/GSFFCallInvocation.m: Forwarding:
|
* Source/GSFFCallInvocation.m: Forwarding:
|
||||||
|
|
|
@ -773,6 +773,24 @@ enum
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Evil hack to prevent recursion - if we are asking a remote
|
||||||
|
* object for a method signature, we can't ask it for the
|
||||||
|
* signature of methodSignatureForSelector:, so we hack in
|
||||||
|
* the signature required manually :-(
|
||||||
|
*/
|
||||||
|
if (sel_eq(aSelector, _cmd))
|
||||||
|
{
|
||||||
|
static NSMethodSignature *sig = nil;
|
||||||
|
|
||||||
|
if (sig == nil)
|
||||||
|
{
|
||||||
|
sig = [NSMethodSignature signatureWithObjCTypes: "@@::"];
|
||||||
|
RETAIN(sig);
|
||||||
|
}
|
||||||
|
return sig;
|
||||||
|
}
|
||||||
|
|
||||||
if (_protocol != nil)
|
if (_protocol != nil)
|
||||||
{
|
{
|
||||||
const char *types = 0;
|
const char *types = 0;
|
||||||
|
@ -799,28 +817,10 @@ enum
|
||||||
id m;
|
id m;
|
||||||
const char *types;
|
const char *types;
|
||||||
#ifdef USE_FFCALL
|
#ifdef USE_FFCALL
|
||||||
/*
|
id inv;
|
||||||
* Evil hack to prevent recursion - if we are asking a remote
|
id sig;
|
||||||
* object for a method signature, we can't ask it for the
|
|
||||||
* signature of methodSignatureForSelector:, so we hack in
|
|
||||||
* the signature required manually :-(
|
|
||||||
*/
|
|
||||||
if (sel_eq(aSelector, _cmd))
|
|
||||||
{
|
|
||||||
static NSMethodSignature *sig = nil;
|
|
||||||
|
|
||||||
if (sig == nil)
|
|
||||||
{
|
|
||||||
sig = [NSMethodSignature signatureWithObjCTypes: "@@::"];
|
|
||||||
RETAIN(sig);
|
|
||||||
}
|
|
||||||
return sig;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
id inv, sig;
|
|
||||||
DO_FORWARD_INVOCATION(methodSignatureForSelector:, aSelector);
|
DO_FORWARD_INVOCATION(methodSignatureForSelector:, aSelector);
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
arglist_t args;
|
arglist_t args;
|
||||||
void *retframe;
|
void *retframe;
|
||||||
|
@ -838,7 +838,6 @@ enum
|
||||||
m = retframe_id(retframe);
|
m = retframe_id(retframe);
|
||||||
#endif
|
#endif
|
||||||
types = [m methodType];
|
types = [m methodType];
|
||||||
|
|
||||||
return [NSMethodSignature signatureWithObjCTypes: types];
|
return [NSMethodSignature signatureWithObjCTypes: types];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4369,6 +4369,12 @@ nodeToObject(GSXMLNode* node)
|
||||||
|
|
||||||
if ([name isEqualToString: @"string"]
|
if ([name isEqualToString: @"string"]
|
||||||
|| [name isEqualToString: @"key"])
|
|| [name isEqualToString: @"key"])
|
||||||
|
{
|
||||||
|
if (content == nil)
|
||||||
|
{
|
||||||
|
content = @"";
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
NSRange r;
|
NSRange r;
|
||||||
|
|
||||||
|
@ -4476,6 +4482,7 @@ nodeToObject(GSXMLNode* node)
|
||||||
}
|
}
|
||||||
content = [NSString stringWithCharacters: buf length: len];
|
content = [NSString stringWithCharacters: buf length: len];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
else if ([name isEqualToString: @"true"])
|
else if ([name isEqualToString: @"true"])
|
||||||
|
@ -4488,14 +4495,26 @@ nodeToObject(GSXMLNode* node)
|
||||||
}
|
}
|
||||||
else if ([name isEqualToString: @"integer"])
|
else if ([name isEqualToString: @"integer"])
|
||||||
{
|
{
|
||||||
|
if (content == nil)
|
||||||
|
{
|
||||||
|
content = @"0";
|
||||||
|
}
|
||||||
return [NSNumber numberWithInt: [content intValue]];
|
return [NSNumber numberWithInt: [content intValue]];
|
||||||
}
|
}
|
||||||
else if ([name isEqualToString: @"real"])
|
else if ([name isEqualToString: @"real"])
|
||||||
{
|
{
|
||||||
|
if (content == nil)
|
||||||
|
{
|
||||||
|
content = @"0.0";
|
||||||
|
}
|
||||||
return [NSNumber numberWithDouble: [content doubleValue]];
|
return [NSNumber numberWithDouble: [content doubleValue]];
|
||||||
}
|
}
|
||||||
else if ([name isEqualToString: @"date"])
|
else if ([name isEqualToString: @"date"])
|
||||||
{
|
{
|
||||||
|
if (content == nil)
|
||||||
|
{
|
||||||
|
content = @"";
|
||||||
|
}
|
||||||
return [NSCalendarDate dateWithString: content
|
return [NSCalendarDate dateWithString: content
|
||||||
calendarFormat: @"%Y-%m-%d %H:%M:%S %z"];
|
calendarFormat: @"%Y-%m-%d %H:%M:%S %z"];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue