mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
GSObjCRuntime usage cleanup backport. See ChangeLog for details.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/freeze_1_8_0@17652 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5f46006ea4
commit
ff97384381
17 changed files with 309 additions and 148 deletions
111
ChangeLog
111
ChangeLog
|
@ -1,3 +1,114 @@
|
|||
2003-09-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSObject.m: Tidy use of GSObjCRuntime a little.
|
||||
|
||||
2003-09-10 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* Headers/Additions/GNUstepBase/GSObjCRuntime.h
|
||||
(GSObjCClass): Allow nil values.
|
||||
(GSObjCIsInstance): Ditto.
|
||||
(GSObjCIsClass): New function.
|
||||
(GSClassNameFromObject): Ditto.
|
||||
(GSObjCIsKindOf): Use GSObjCSuper() in favor of
|
||||
class_get_super_class().
|
||||
|
||||
* Headers/Foundation/NSRange.h
|
||||
(GS_RANGE_CHECK), (CHECK_INDEX_RANGE_ERROR):
|
||||
Use GSNameFromSelector() in favor of sel_get_name().
|
||||
|
||||
* Source/GSFFCallInvocation.m
|
||||
(gs_method_for_receiver_and_selector), (gs_find_best_typed_sel),
|
||||
(-[GSFFCallInvocation invokeWithTarget:]), (GSInvocationCallback):
|
||||
Use GSObjCIsInstance() in favor of object_is_instance,
|
||||
GSObjCClass() in favor of object_get_class(),
|
||||
GSObjCIsClass() in favor of object_is_class(),
|
||||
GSNameFromSelector() in favor of sel_get_name(),
|
||||
GSObjCSuper() in favor of class_get_super_class() and
|
||||
GSClassNameFromObject() in favor of object_get_class_name().
|
||||
|
||||
* Source/GSFFIInvocation.m
|
||||
(gs_method_for_receiver_and_selector), (gs_find_best_typed_sel),
|
||||
(-[GSFFIInvocation invokeWithTarget:]), (GSFFIInvocationCallback):
|
||||
Use GSObjCIsInstance() in favor of object_is_instance,
|
||||
GSObjCClass() in favor of object_get_class(),
|
||||
GSObjCIsClass() in favor of object_is_class(),
|
||||
GSNameFromSelector() in favor of sel_get_name(),
|
||||
GSObjCSuper() in favor of class_get_super_class() and
|
||||
GSClassNameFromObject() in favor of object_get_class_name().
|
||||
|
||||
* Source/NSConnection.m
|
||||
(-[NSConnection forwardForProxy:selector:argFrame:]),
|
||||
(-[NSConnection forwardInvocation:forProxy:]):
|
||||
Use GSNameFromSelector() in favor of sel_get_name().
|
||||
|
||||
* Source/NSDistantObject.m
|
||||
(class_is_kind_of): Use GSObjCSuper in favor of
|
||||
class_get_super_class().
|
||||
(-[NSDistantObject forward::]): Use GSNameFromSelector() in favor of
|
||||
sel_get_name().
|
||||
|
||||
* Source/NSInvocation.m
|
||||
(-[NSInvocation invokeWithTarget:])
|
||||
Use GSObjCSuper() in favor of class_get_super_class(),
|
||||
GSObjCIsInstance() in favor of object_is_instance()
|
||||
(-[NSInvocation description]):
|
||||
Use GSClassNameFromObject in favor of object_get_class_name().
|
||||
Avoid buffer overflow by using snprintf() in favor of sprintf().
|
||||
(-[NSInvocation initWithSelector:]):
|
||||
Use GSNameFromSelector() in favor of sel_get_name().
|
||||
|
||||
* Source/NSObject.m
|
||||
(GSDescriptionForInstanceMethod), (GSDescriptionForClassMethod),
|
||||
(+[NSObject superclass], (-[NSObject description]),
|
||||
(-[NSObject doesNotRecognizeSelector:]),
|
||||
(-[NSObject performSelector:]),
|
||||
(-[NSObject performSelector:withObject:]),
|
||||
(+[NSObject setVersion:], -[NSObject error:]),
|
||||
(-[NSObject doesNotRecognize:], -[NSObject isClass]),
|
||||
(-[Object description]):
|
||||
Use GSNameFromSelector() in favor of sel_get_name(),
|
||||
GSObjCSuper() in favor of class_get_super_class(),
|
||||
GSClassNameFromObject() in favor of object_get_class_name() and
|
||||
GSObjCIsClass() in favor of object_is_class().
|
||||
|
||||
* Source/NSProxy.m
|
||||
(+[NSProxy description]), (-[NSProxy description]),
|
||||
(+[NSProxy superclass]), (-[NSProxy forwardInvocation:]),
|
||||
(-[NSProxy init], (-[NSProxy notImplemented:]),
|
||||
(-[NSProxy performSelector:]),
|
||||
(-[NSProxy performSelector:withObject:]),
|
||||
(-[NSProxy performSelector:withObject:withObject:]):
|
||||
Use GSClassNameFromObject() in favor of object_get_class_name(),
|
||||
GSObjCSuper() in favor of class_get_super_class() and
|
||||
GSNameFromSelector() in favor of sel_get_name().
|
||||
|
||||
* Source/Additions/GSCategories.m
|
||||
(-[NSObject notImplemented:]), (-[NSObject shouldNotImplement:]),
|
||||
(-[NSObject subclassResponsibility:]):
|
||||
Use GSNameFromSelector() in favor of sel_get_name() and
|
||||
GSClassNameFromObject() in favor of object_get_class_name().
|
||||
|
||||
* Source/Additions/GSCompatibility.h
|
||||
(GS_RANGE_CHECK): Use GSNameFromSelector() in favor of
|
||||
sel_get_name().
|
||||
|
||||
* Source/Additions/GSCompatibility.m
|
||||
(+[NSObject notImplemented:]):
|
||||
Use GSNameFromSelector() in favor of sel_get_name() and
|
||||
GSClassNameFromObject() in favor of object_get_class_name().
|
||||
|
||||
* Source/Additions/GSObjCRuntime.m
|
||||
(GSObjCMethodNames), (GSObjCAddMethods):
|
||||
Use GSNameFromSelector() in favor of sel_get_name().
|
||||
|
||||
* Testing/nsbundle.m (main): Update to reflect filesystem change.
|
||||
Use GSClassNameFromObject() in favor of object_get_class_name().
|
||||
|
||||
* Testing/nsconnection_server.m
|
||||
Use GSNameFromSelector() in favor of sel_get_name().
|
||||
|
||||
* Testing/Makefile.postamble: Build before checking.
|
||||
|
||||
2003-09-05 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Headers/Additions/GNUstepBase/behavior.h: GS_EXPORT functions.
|
||||
|
|
|
@ -125,22 +125,59 @@ GSObjCSetValue(NSObject *self, NSString *key, id val, SEL sel,
|
|||
|
||||
/**
|
||||
* GSObjCClass() return the class of an instance.
|
||||
* The argument to this function must NOT be nil.
|
||||
* Returns a nul pointer if the argument is nil.
|
||||
*/
|
||||
GS_STATIC_INLINE Class
|
||||
GSObjCClass(id obj)
|
||||
{
|
||||
if (obj == nil)
|
||||
return 0;
|
||||
return obj->class_pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the superclass of this.
|
||||
*/
|
||||
GS_STATIC_INLINE Class
|
||||
GSObjCSuper(Class class)
|
||||
{
|
||||
#ifndef NeXT_RUNTIME
|
||||
if (class != 0 && CLS_ISRESOLV (class) == NO)
|
||||
{
|
||||
const char *name;
|
||||
name = (const char *)class->super_class;
|
||||
if (name == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return objc_lookup_class (name);
|
||||
}
|
||||
#endif
|
||||
return class_get_super_class(class);
|
||||
}
|
||||
|
||||
/**
|
||||
* GSObjCIsInstance() tests to see if an id is an instance.
|
||||
* The argument to this function must NOT be nil.
|
||||
* Returns NO if the argument is nil.
|
||||
*/
|
||||
GS_STATIC_INLINE BOOL
|
||||
GSObjCIsInstance(id obj)
|
||||
{
|
||||
return CLS_ISCLASS(obj->class_pointer);
|
||||
if (obj == nil)
|
||||
return NO;
|
||||
return object_is_instance(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* GSObjCIsClass() tests to see if an id is a class.
|
||||
* Returns NO if the argument is nil.
|
||||
*/
|
||||
GS_STATIC_INLINE BOOL
|
||||
GSObjCIsClass(Class cls)
|
||||
{
|
||||
if (cls == nil)
|
||||
return NO;
|
||||
return object_is_class(cls);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,7 +193,7 @@ GSObjCIsKindOf(Class this, Class other)
|
|||
{
|
||||
return YES;
|
||||
}
|
||||
this = class_get_super_class(this);
|
||||
this = GSObjCSuper(this);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
@ -186,16 +223,28 @@ GSNameFromClass(Class this)
|
|||
return class_get_class_name(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the object's class, or a nul pointer if no object
|
||||
* was supplied.
|
||||
*/
|
||||
GS_STATIC_INLINE const char *
|
||||
GSClassNameFromObject(id obj)
|
||||
{
|
||||
if (obj == 0)
|
||||
return 0;
|
||||
return object_get_class_name(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the supplied selector, or a nul pointer if no selector
|
||||
* was supplied.
|
||||
*/
|
||||
GS_STATIC_INLINE const char *
|
||||
GSNameFromSelector(SEL this)
|
||||
GSNameFromSelector(SEL sel)
|
||||
{
|
||||
if (this == 0)
|
||||
if (sel == 0)
|
||||
return 0;
|
||||
return sel_get_name(this);
|
||||
return sel_get_name(sel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -392,15 +441,6 @@ GS_EXPORT GSIVar
|
|||
GSObjCGetInstanceVariableDefinition(Class class, NSString *name);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the superclass of this.
|
||||
*/
|
||||
GS_STATIC_INLINE Class
|
||||
GSObjCSuper(Class this)
|
||||
{
|
||||
return class_get_super_class(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version number of this.
|
||||
*/
|
||||
|
|
|
@ -203,13 +203,13 @@ GS_EXPORT NSRange NSRangeFromString(NSString *aString);
|
|||
#define GS_RANGE_CHECK(RANGE, SIZE) \
|
||||
if (RANGE.location > SIZE || RANGE.length > (SIZE - RANGE.location)) \
|
||||
[NSException raise: NSRangeException \
|
||||
format: @"in %s, range { %u, %u } extends beyond size (%u)", \
|
||||
sel_get_name(_cmd), RANGE.location, RANGE.length, SIZE]
|
||||
format: @"in %s, range { %u, %u } extends beyond size (%u)", \
|
||||
GSNameFromSelector(_cmd), RANGE.location, RANGE.length, SIZE]
|
||||
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
|
||||
if (INDEX >= OVER) \
|
||||
[NSException raise: NSRangeException \
|
||||
format: @"in %s, index %d is out of range", \
|
||||
sel_get_name (_cmd), INDEX]
|
||||
GSNameFromSelector(_cmd), INDEX]
|
||||
#endif
|
||||
|
||||
#endif /* __NSRange_h_GNUSTEP_BASE_INCLUDE */
|
||||
|
|
|
@ -542,8 +542,8 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"method %s not implemented in %s(%s)",
|
||||
aSel ? sel_get_name(aSel) : "(null)",
|
||||
object_get_class_name(self),
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)",
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class"];
|
||||
return nil;
|
||||
}
|
||||
|
@ -553,9 +553,9 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
[NSException
|
||||
raise: NSGenericException
|
||||
format: @"%s(%s) should not implement %s",
|
||||
object_get_class_name(self),
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSel ? sel_get_name(aSel) : "(null)"];
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)"];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -563,9 +563,9 @@ static void MD5Transform (unsigned long buf[4], unsigned long const in[16])
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"subclass %s(%s) should override %s",
|
||||
object_get_class_name(self),
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSel ? sel_get_name(aSel) : "(null)"];
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)"];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
if (RANGE.location > SIZE || RANGE.length > (SIZE - RANGE.location)) \
|
||||
[NSException raise: NSRangeException \
|
||||
format: @"in %s, range { %u, %u } extends beyond size (%u)", \
|
||||
sel_get_name(_cmd), RANGE.location, RANGE.length, SIZE]
|
||||
GSNameFromSelector(_cmd), RANGE.location, RANGE.length, SIZE]
|
||||
|
||||
/* Taken from base/Headers/Foundation/NSString.h */
|
||||
typedef enum _NSGNUstepStringEncoding
|
||||
|
|
|
@ -419,17 +419,17 @@ BOOL GSDebugSet(NSString *level)
|
|||
|
||||
+ (id) notImplemented:(SEL)selector
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"method %s not implemented in %s(class)",
|
||||
selector ? sel_get_name(selector) : "(null)",
|
||||
object_get_class_name(self)];
|
||||
return nil;
|
||||
[NSException raise: NSGenericException
|
||||
format: @"method %s not implemented in %s(class)",
|
||||
selector ? GSNameFromSelector(selector) : "(null)",
|
||||
GSClassNameFromObject(self)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
// In NSObject.m, category GNU
|
||||
- (BOOL) isInstance
|
||||
{
|
||||
return GSObjCIsInstance(self);
|
||||
return GSObjCIsInstance(self);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -172,7 +172,7 @@ GSObjCMethodNames(id obj)
|
|||
NSString *name;
|
||||
|
||||
name = [[NSString alloc] initWithUTF8String:
|
||||
sel_get_name(methods->method_list[i].method_name)];
|
||||
GSNameFromSelector(methods->method_list[i].method_name)];
|
||||
[set addObject: name];
|
||||
RELEASE(name);
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ GSObjCAddMethods (Class class, struct objc_method_list *methods)
|
|||
if (behavior_debug)
|
||||
{
|
||||
fprintf(stderr, " processing method [%s] ... ",
|
||||
sel_get_name(method->method_name));
|
||||
GSNameFromSelector(method->method_name));
|
||||
}
|
||||
|
||||
if (!search_for_method_in_class(class,method->method_name)
|
||||
|
@ -610,7 +610,7 @@ GSObjCAddMethods (Class class, struct objc_method_list *methods)
|
|||
while (counter >= 0)
|
||||
{
|
||||
struct objc_method *method = &(mlist->method_list[counter]);
|
||||
const char *name = sel_get_name(method->method_name);
|
||||
const char *name = GSNameFromSelector(method->method_name);
|
||||
|
||||
if (behavior_debug)
|
||||
{
|
||||
|
|
|
@ -212,14 +212,13 @@ gs_method_for_receiver_and_selector (id receiver, SEL sel)
|
|||
{
|
||||
if (receiver)
|
||||
{
|
||||
if (object_is_instance (receiver))
|
||||
if (GSObjCIsInstance(receiver))
|
||||
{
|
||||
return GSGetInstanceMethod (object_get_class
|
||||
(receiver), sel);
|
||||
return GSGetInstanceMethod(GSObjCClass(receiver), sel);
|
||||
}
|
||||
else if (object_is_class (receiver))
|
||||
else if (GSObjCIsClass(receiver))
|
||||
{
|
||||
return GSGetClassMethod (receiver, sel);
|
||||
return GSGetClassMethod(receiver, sel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,7 +247,7 @@ gs_find_best_typed_sel (SEL sel)
|
|||
{
|
||||
if (!sel_get_type (sel))
|
||||
{
|
||||
const char *name = sel_get_name (sel);
|
||||
const char *name = GSNameFromSelector(sel);
|
||||
|
||||
if (name)
|
||||
{
|
||||
|
@ -679,14 +678,14 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
|
|||
|
||||
s.self = _target;
|
||||
if (GSObjCIsInstance(_target))
|
||||
s.class = class_get_super_class(GSObjCClass(_target));
|
||||
s.class = GSObjCSuper(GSObjCClass(_target));
|
||||
else
|
||||
s.class = class_get_super_class((Class)_target);
|
||||
s.class = GSObjCSuper((Class)_target);
|
||||
imp = objc_msg_lookup_super(&s, _selector);
|
||||
}
|
||||
else
|
||||
{
|
||||
imp = method_get_imp(object_is_instance(_target) ?
|
||||
imp = method_get_imp(GSObjCIsInstance(_target) ?
|
||||
GSGetInstanceMethod(
|
||||
((struct objc_class*)_target)->class_pointer, _selector)
|
||||
: GSGetClassMethod(
|
||||
|
@ -801,9 +800,13 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
|
||||
if (!fwdInvMethod)
|
||||
{
|
||||
NSCAssert2 (0, @"GSFFCallInvocation: Class '%s' does not respond"
|
||||
@" to forwardInvocation: for '%s'",
|
||||
object_get_class_name (obj), sel_get_name(selector));
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"GSFFCallInvocation: Class '%s(%s)'"
|
||||
@" does not respond"
|
||||
@" to forwardInvocation: for '%s'",
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
}
|
||||
|
||||
sig = nil;
|
||||
|
@ -831,7 +834,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
|
||||
if (runtimeTypes == 0 || strcmp(receiverTypes, runtimeTypes) != 0)
|
||||
{
|
||||
const char *runtimeName = sel_get_name (selector);
|
||||
const char *runtimeName = GSNameFromSelector(selector);
|
||||
|
||||
selector = sel_get_typed_uid (runtimeName, receiverTypes);
|
||||
if (selector == 0)
|
||||
|
@ -864,9 +867,9 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%s(%s) does not recognize %s",
|
||||
object_get_class_name(obj),
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? sel_get_name(selector) : "(null)"];
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
}
|
||||
|
||||
invocation = [[GSFFCallInvocation alloc] initWithMethodSignature: sig];
|
||||
|
|
|
@ -59,15 +59,13 @@ gs_method_for_receiver_and_selector (id receiver, SEL sel)
|
|||
{
|
||||
if (receiver)
|
||||
{
|
||||
if (object_is_instance (receiver))
|
||||
if (GSObjCIsInstance(receiver))
|
||||
{
|
||||
return GSGetInstanceMethod (object_get_class
|
||||
(receiver), sel);
|
||||
return GSGetInstanceMethod(GSObjCClass(receiver), sel);
|
||||
}
|
||||
else if (object_is_class (receiver))
|
||||
else if (GSObjCIsClass(receiver))
|
||||
{
|
||||
return GSGetClassMethod (object_get_class
|
||||
(receiver), sel);
|
||||
return GSGetClassMethod(receiver, sel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +94,7 @@ gs_find_best_typed_sel (SEL sel)
|
|||
{
|
||||
if (!sel_get_type (sel))
|
||||
{
|
||||
const char *name = sel_get_name (sel);
|
||||
const char *name = GSNameFromSelector(sel);
|
||||
|
||||
if (name)
|
||||
{
|
||||
|
@ -325,14 +323,14 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
|
|||
|
||||
s.self = _target;
|
||||
if (GSObjCIsInstance(_target))
|
||||
s.class = class_get_super_class(GSObjCClass(_target));
|
||||
s.class = GSObjCSuper(GSObjCClass(_target));
|
||||
else
|
||||
s.class = class_get_super_class((Class)_target);
|
||||
s.class = GSObjCSuper((Class)_target);
|
||||
imp = objc_msg_lookup_super(&s, _selector);
|
||||
}
|
||||
else
|
||||
{
|
||||
imp = method_get_imp(object_is_instance(_target) ?
|
||||
imp = method_get_imp(GSObjCIsInstance(_target) ?
|
||||
GSGetInstanceMethod(
|
||||
((struct objc_class*)_target)->class_pointer, _selector)
|
||||
: GSGetClassMethod(
|
||||
|
@ -420,9 +418,12 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
|
||||
if (!fwdInvMethod)
|
||||
{
|
||||
NSCAssert2 (0, @"GSFFIInvocation: Class '%s' does not respond"
|
||||
@" to forwardInvocation: for '%s'",
|
||||
object_get_class_name (obj), sel_get_name(selector));
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"GSFFIInvocation: Class '%s'(%s) does not respond"
|
||||
@" to forwardInvocation: for '%s'",
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
}
|
||||
|
||||
sig = nil;
|
||||
|
@ -446,7 +447,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
|
||||
if (runtimeTypes == 0 || strcmp(receiverTypes, runtimeTypes) != 0)
|
||||
{
|
||||
const char *runtimeName = sel_get_name (selector);
|
||||
const char *runtimeName = GSNameFromSelector(selector);
|
||||
|
||||
selector = sel_get_typed_uid (runtimeName, receiverTypes);
|
||||
if (selector == 0)
|
||||
|
@ -479,9 +480,9 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%s(%s) does not recognize %s",
|
||||
object_get_class_name(obj),
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? sel_get_name(selector) : "(null)"];
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
}
|
||||
|
||||
invocation = [[GSFFIInvocation alloc] initWithCallback: cif
|
||||
|
|
|
@ -1832,7 +1832,7 @@ static void retEncoder (DOContext *ctxt)
|
|||
type = [[object methodSignatureForSelector: sel] methodType];
|
||||
if (type)
|
||||
{
|
||||
sel_register_typed_name(sel_get_name(sel), type);
|
||||
sel_register_typed_name(GSNameFromSelector(sel), type);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1885,7 +1885,7 @@ static void retEncoder (DOContext *ctxt)
|
|||
[self _sendOutRmc: ctxt.encoder type: METHOD_REQUEST];
|
||||
ctxt.encoder = nil;
|
||||
NSDebugMLLog(@"NSConnection", @"Sent message (%s) to 0x%x",
|
||||
sel_get_name(sel), (gsaddr)self);
|
||||
GSNameFromSelector(sel), (gsaddr)self);
|
||||
|
||||
if (needsResponse == NO)
|
||||
{
|
||||
|
@ -1952,7 +1952,7 @@ static void retEncoder (DOContext *ctxt)
|
|||
type = [[object methodSignatureForSelector: [inv selector]] methodType];
|
||||
if (type)
|
||||
{
|
||||
sel_register_typed_name(sel_get_name([inv selector]), type);
|
||||
sel_register_typed_name(GSNameFromSelector([inv selector]), type);
|
||||
}
|
||||
}
|
||||
NSParameterAssert(type);
|
||||
|
|
|
@ -1007,7 +1007,7 @@ static inline BOOL class_is_kind_of (Class self, Class aClassObject)
|
|||
{
|
||||
Class class;
|
||||
|
||||
for (class = self; class!=Nil; class = class_get_super_class(class))
|
||||
for (class = self; class!=Nil; class = GSObjCSuper(class))
|
||||
if (class==aClassObject)
|
||||
return YES;
|
||||
return NO;
|
||||
|
@ -1040,7 +1040,7 @@ static inline BOOL class_is_kind_of (Class self, Class aClassObject)
|
|||
- (id) forward: (SEL)aSel :(arglist_t)frame
|
||||
{
|
||||
if (debug_proxy)
|
||||
NSLog(@"NSDistantObject forwarding %s\n", sel_get_name(aSel));
|
||||
NSLog(@"NSDistantObject forwarding %s\n", GSNameFromSelector(aSel));
|
||||
|
||||
if (![_connection isValid])
|
||||
[NSException
|
||||
|
|
|
@ -558,14 +558,14 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
s.receiver = _target;
|
||||
#endif
|
||||
if (GSObjCIsInstance(_target))
|
||||
s.class = class_get_super_class(GSObjCClass(_target));
|
||||
s.class = GSObjCSuper(GSObjCClass(_target));
|
||||
else
|
||||
s.class = class_get_super_class((Class)_target);
|
||||
s.class = GSObjCSuper((Class)_target);
|
||||
imp = objc_msg_lookup_super(&s, _selector);
|
||||
}
|
||||
else
|
||||
{
|
||||
imp = method_get_imp(object_is_instance(_target) ?
|
||||
imp = method_get_imp(GSObjCIsInstance(_target) ?
|
||||
GSGetInstanceMethod(
|
||||
((struct objc_class*)_target)->class_pointer, _selector)
|
||||
: GSGetClassMethod(
|
||||
|
@ -608,14 +608,14 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
*/
|
||||
char buffer[1024];
|
||||
|
||||
sprintf (buffer, "<%s %p selector: %s target: %s>", \
|
||||
(char*)object_get_class_name(self), \
|
||||
snprintf (buffer, 1024, "<%s %p selector: %s target: %s>", \
|
||||
GSClassNameFromObject(self), \
|
||||
self, \
|
||||
_selector ? [NSStringFromSelector(_selector) cString] : "nil", \
|
||||
_target ? [NSStringFromClass([_target class]) cString] : "nil" \
|
||||
_selector ? GSNameFromSelector(_selector) : "nil", \
|
||||
_target ? GSNameFromClass([_target class]) : "nil" \
|
||||
);
|
||||
|
||||
return [NSString stringWithCString:buffer];
|
||||
return [NSString stringWithCString: buffer];
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||
|
@ -761,12 +761,12 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
types = sel_get_type(aSelector);
|
||||
if (types == 0)
|
||||
{
|
||||
types = sel_get_type(sel_get_any_typed_uid(sel_get_name(aSelector)));
|
||||
types = sel_get_type(sel_get_any_typed_uid(GSNameFromSelector(aSelector)));
|
||||
}
|
||||
if (types == 0)
|
||||
{
|
||||
NSLog(@"Couldn't find encoding type for selector %s.",
|
||||
sel_get_name(aSelector));
|
||||
GSNameFromSelector(aSelector));
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
|
|
@ -701,7 +701,7 @@ GSDescriptionForInstanceMethod(pcl self, SEL aSel)
|
|||
{
|
||||
int i;
|
||||
struct objc_protocol_list *p_list;
|
||||
const char *name = sel_get_name (aSel);
|
||||
const char *name = GSNameFromSelector(aSel);
|
||||
struct objc_method_description *result;
|
||||
|
||||
if (self->instance_methods != 0)
|
||||
|
@ -732,7 +732,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
int i;
|
||||
struct objc_protocol_list *p_list;
|
||||
const char *name = sel_get_name (aSel);
|
||||
const char *name = GSNameFromSelector(aSel);
|
||||
struct objc_method_description *result;
|
||||
|
||||
if (self->class_methods != 0)
|
||||
|
@ -1184,7 +1184,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
*/
|
||||
+ (Class) superclass
|
||||
{
|
||||
return class_get_super_class (self);
|
||||
return GSObjCSuper(self);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1192,7 +1192,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
*/
|
||||
- (Class) superclass
|
||||
{
|
||||
return object_get_super_class (self);
|
||||
return GSObjCSuper(GSObjCClass(self));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1404,7 +1404,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s: %lx>",
|
||||
object_get_class_name(self), (unsigned long)self];
|
||||
GSClassNameFromObject(self), (unsigned long)self];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1437,9 +1437,9 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%s(%s) does not recognize %s",
|
||||
object_get_class_name(self),
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSelector ? sel_get_name(aSelector) : "(null)"];
|
||||
aSelector ? GSNameFromSelector(aSelector) : "(null)"];
|
||||
}
|
||||
|
||||
- (retval_t) forward: (SEL)aSel : (arglist_t)argFrame
|
||||
|
@ -1681,7 +1681,8 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
if (!msg)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector);
|
||||
|
@ -1705,7 +1706,8 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
if (!msg)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -1732,7 +1734,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
if (!msg)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", sel_get_name(_cmd)];
|
||||
format: @"invalid selector passed to %s", GSNameFromSelector(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -1906,7 +1908,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
if (aVersion < 0)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%s +setVersion: may not set a negative version",
|
||||
object_get_class_name(self)];
|
||||
GSClassNameFromObject(self)];
|
||||
class_set_version(self, aVersion);
|
||||
return self;
|
||||
}
|
||||
|
@ -1921,11 +1923,11 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
- (id) error: (const char *)aString, ...
|
||||
{
|
||||
#define FMT "error: %s (%s)\n%s\n"
|
||||
char fmt[(strlen((char*)FMT)+strlen((char*)object_get_class_name(self))
|
||||
char fmt[(strlen((char*)FMT)+strlen((char*)GSClassNameFromObject(self))
|
||||
+((aString!=NULL)?strlen((char*)aString):0)+8)];
|
||||
va_list ap;
|
||||
|
||||
sprintf(fmt, FMT, object_get_class_name(self),
|
||||
sprintf(fmt, FMT, GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self)?"instance":"class",
|
||||
(aString!=NULL)?aString:"");
|
||||
va_start(ap, aString);
|
||||
|
@ -1939,7 +1941,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
/*
|
||||
- (const char *) name
|
||||
{
|
||||
return object_get_class_name(self);
|
||||
return GSClassNameFromObject(self);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -2015,9 +2017,9 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"%s(%s) does not recognize %s",
|
||||
object_get_class_name(self),
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSel ? sel_get_name(aSel) : "(null)"];
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)"];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -2124,7 +2126,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
|
||||
- (BOOL) isClass
|
||||
{
|
||||
return object_is_class(self);
|
||||
return GSObjCIsClass((Class)self);
|
||||
}
|
||||
|
||||
- (BOOL) isInstance
|
||||
|
@ -2271,7 +2273,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s: %lx>",
|
||||
object_get_class_name(self), (unsigned long)self];
|
||||
GSClassNameFromObject(self), (unsigned long)self];
|
||||
}
|
||||
- (BOOL) isProxy
|
||||
{
|
||||
|
|
|
@ -94,7 +94,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
*/
|
||||
+ (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s>", object_get_class_name(self)];
|
||||
return [NSString stringWithFormat: @"<%s>", GSClassNameFromObject(self)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -185,7 +185,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
*/
|
||||
+ (Class) superclass
|
||||
{
|
||||
return class_get_super_class (self);
|
||||
return GSObjCSuper(self);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,7 +249,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s %lx>",
|
||||
object_get_class_name(self), (unsigned long)self];
|
||||
GSClassNameFromObject(self), (unsigned long)self];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -272,7 +272,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"NSProxy should not implement '%s'",
|
||||
sel_get_name(_cmd)];
|
||||
GSNameFromSelector(_cmd)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -289,8 +289,8 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
- (id) init
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"subclass %s should override %s", object_get_class_name(self),
|
||||
sel_get_name(_cmd)];
|
||||
format: @"subclass %s should override %s", GSClassNameFromObject(self),
|
||||
GSNameFromSelector(_cmd)];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -355,7 +355,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
- (id) notImplemented: (SEL)aSel
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"NSProxy notImplemented %s", sel_get_name(aSel)];
|
||||
format: @"NSProxy notImplemented %s", GSNameFromSelector(aSel)];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -394,7 +394,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
sel_get_name(_cmd)];
|
||||
GSNameFromSelector(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector);
|
||||
|
@ -409,7 +409,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
sel_get_name(_cmd)];
|
||||
GSNameFromSelector(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector, anObject);
|
||||
|
@ -425,7 +425,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
sel_get_name(_cmd)];
|
||||
GSNameFromSelector(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector, anObject, anotherObject);
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
after-distclean::
|
||||
rm -f cstream.dat fref.dat nsarchiver.dat
|
||||
|
||||
check::
|
||||
check:: all
|
||||
for f in $(CHECKABLE_TOOLS); do \
|
||||
obj/$$f ; \
|
||||
done
|
||||
|
|
|
@ -48,9 +48,13 @@ main(int argc, char *argv[], char **env)
|
|||
printf("Looking for LoadMe bundle...\n");
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
if ([[path lastPathComponent] isEqualToString:@"Testing"] == NO)
|
||||
{
|
||||
/* Delete library combo */
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
path = [path stringByDeletingLastPathComponent];
|
||||
}
|
||||
printf(" Bundle directory is %s\n", [path cString]);
|
||||
path = [NSBundle pathForResource:@"LoadMe" ofType:@"bundle"
|
||||
inDirectory: path];
|
||||
|
@ -88,7 +92,7 @@ main(int argc, char *argv[], char **env)
|
|||
printf("* ERROR: Can't find principal class\n");
|
||||
}
|
||||
else
|
||||
printf(" Principal class is: %s\n", object_get_class_name (object));
|
||||
printf(" Principal class is: %s\n", GSClassNameFromObject(object));
|
||||
|
||||
printf("Testing LoadMe bundle classes...\n");
|
||||
printf(" This is LoadMe:\n");
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
- (BOOL) sendBoolean: (BOOL)b
|
||||
{
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd), (int)b, (int)(!b));
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd), (int)b, (int)(!b));
|
||||
fflush(stdout);
|
||||
return !b;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@
|
|||
- (void) getBoolean: (BOOL*)bp
|
||||
{
|
||||
BOOL rbp = !(*bp);
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)*bp, (int)rbp);
|
||||
fflush(stdout);
|
||||
*bp = rbp;
|
||||
|
@ -111,7 +111,7 @@
|
|||
- (unsigned char) sendUChar: (unsigned char)num
|
||||
{
|
||||
unsigned char rnum = num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)num, (int)rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
|
@ -121,7 +121,7 @@
|
|||
- (void) getUChar: (unsigned char *)num
|
||||
{
|
||||
unsigned char rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)(*num), (int)rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
|
@ -130,7 +130,7 @@
|
|||
- (char) sendChar: (char)num
|
||||
{
|
||||
char rnum = num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)num, (int)rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
|
@ -139,7 +139,7 @@
|
|||
- (void) getChar: (char *)num
|
||||
{
|
||||
char rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd),
|
||||
(int)(*num), (int)rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
|
@ -148,7 +148,7 @@
|
|||
- (short) sendShort: (short)num
|
||||
{
|
||||
short rnum = num + ADD_CONST;
|
||||
printf("(%s) got %hd, returning %hd\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %hd, returning %hd\n", GSNameFromSelector(_cmd),
|
||||
num, rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
|
@ -157,7 +157,7 @@
|
|||
- (void) getShort: (short *)num
|
||||
{
|
||||
short rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %hd, returning %hd\n", sel_get_name(_cmd),
|
||||
printf("(%s) got %hd, returning %hd\n", GSNameFromSelector(_cmd),
|
||||
(*num), rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
|
@ -166,7 +166,7 @@
|
|||
- (int) sendInt: (int)num
|
||||
{
|
||||
int rnum = num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd), num, rnum);
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd), num, rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
}
|
||||
|
@ -174,7 +174,7 @@
|
|||
- (void) getInt: (int *)num
|
||||
{
|
||||
int rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd), *num, rnum);
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd), *num, rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@
|
|||
- (long) sendLong: (long)num
|
||||
{
|
||||
long rnum = num + ADD_CONST;
|
||||
printf("(%s) got %ld, returning %ld\n", sel_get_name(_cmd), num, rnum);
|
||||
printf("(%s) got %ld, returning %ld\n", GSNameFromSelector(_cmd), num, rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
}
|
||||
|
@ -190,7 +190,7 @@
|
|||
- (void) getLong: (long *)num
|
||||
{
|
||||
long rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %ld, returning %ld\n", sel_get_name(_cmd), *num, rnum);
|
||||
printf("(%s) got %ld, returning %ld\n", GSNameFromSelector(_cmd), *num, rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -198,7 +198,7 @@
|
|||
- (float) sendFloat: (float)num
|
||||
{
|
||||
float rnum = num + ADD_CONST;
|
||||
printf("(%s) got %f, returning %f\n", sel_get_name(_cmd), num, rnum);
|
||||
printf("(%s) got %f, returning %f\n", GSNameFromSelector(_cmd), num, rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
}
|
||||
|
@ -206,7 +206,7 @@
|
|||
- (void) getFloat: (float *)num
|
||||
{
|
||||
float rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %f, returning %f\n", sel_get_name(_cmd), *num, rnum);
|
||||
printf("(%s) got %f, returning %f\n", GSNameFromSelector(_cmd), *num, rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@
|
|||
- (double) sendDouble: (double)num
|
||||
{
|
||||
double rnum = num + ADD_CONST;
|
||||
printf("(%s) got %g, returning %g\n", sel_get_name(_cmd), num, rnum);
|
||||
printf("(%s) got %g, returning %g\n", GSNameFromSelector(_cmd), num, rnum);
|
||||
fflush(stdout);
|
||||
return rnum;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@
|
|||
- (void) getDouble: (double *)num
|
||||
{
|
||||
double rnum = *num + ADD_CONST;
|
||||
printf("(%s) got %g, returning %g\n", sel_get_name(_cmd), *num, rnum);
|
||||
printf("(%s) got %g, returning %g\n", GSNameFromSelector(_cmd), *num, rnum);
|
||||
*num = rnum;
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -230,7 +230,7 @@
|
|||
- (small_struct) sendSmallStruct: (small_struct)str
|
||||
{
|
||||
char rnum = str.z + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd), str.z, rnum);
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd), str.z, rnum);
|
||||
fflush(stdout);
|
||||
str.z = rnum;
|
||||
return str;
|
||||
|
@ -239,7 +239,7 @@
|
|||
- (void) getSmallStruct: (small_struct *)str
|
||||
{
|
||||
char rnum = str->z + ADD_CONST;
|
||||
printf("(%s) got %d, returning %d\n", sel_get_name(_cmd), str->z, rnum);
|
||||
printf("(%s) got %d, returning %d\n", GSNameFromSelector(_cmd), str->z, rnum);
|
||||
fflush(stdout);
|
||||
str->z = rnum;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@
|
|||
{
|
||||
foo f2 = {'A', 123.456, 1, "horse", 987654};
|
||||
printf("(%s) got c='%c', d=%g, i=%d, s=%s, l=%lu",
|
||||
sel_get_name(_cmd), f.c, f.d, f.i, f.s, f.l);
|
||||
GSNameFromSelector(_cmd), f.c, f.d, f.i, f.s, f.l);
|
||||
fflush(stdout);
|
||||
printf(" returning c='%c', d=%g, i=%d, s=%s, l=%lu\n",
|
||||
f2.c, f2.d, f2.i, f2.s, f2.l);
|
||||
|
@ -260,7 +260,7 @@
|
|||
{
|
||||
foo f2 = {'A', 123.456, 1, "horse", 987654};
|
||||
printf("(%s) got c='%c', d=%g, i=%d, s=%s, l=%lu",
|
||||
sel_get_name(_cmd), f->c, f->d, f->i, f->s, f->l);
|
||||
GSNameFromSelector(_cmd), f->c, f->d, f->i, f->s, f->l);
|
||||
fflush(stdout);
|
||||
printf(" returning c='%c', d=%g, i=%d, s=%s, l=%lu\n",
|
||||
f2.c, f2.d, f2.i, f2.s, f2.l);
|
||||
|
@ -270,22 +270,22 @@
|
|||
|
||||
- sendObject: (id)str
|
||||
{
|
||||
printf ("(%s) got object (%s)\n", sel_get_name(_cmd),
|
||||
object_get_class_name (str));
|
||||
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
|
||||
GSClassNameFromObject(str));
|
||||
fflush(stdout);
|
||||
return str;
|
||||
}
|
||||
|
||||
- (void) getObject: (id *)str
|
||||
{
|
||||
printf ("(%s) got object (%s)\n", sel_get_name(_cmd),
|
||||
object_get_class_name (*str));
|
||||
printf ("(%s) got object (%s)\n", GSNameFromSelector(_cmd),
|
||||
GSClassNameFromObject(*str));
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
- (char *) sendString: (char *)str
|
||||
{
|
||||
printf ("(%s) got string (%s)", sel_get_name(_cmd), str);
|
||||
printf ("(%s) got string (%s)", GSNameFromSelector(_cmd), str);
|
||||
str[0] = 'N';
|
||||
printf(" returning (%s)\n", str);
|
||||
fflush(stdout);
|
||||
|
@ -294,7 +294,7 @@
|
|||
|
||||
- (void) getString: (char **)str
|
||||
{
|
||||
printf ("(%s) got string (%s)", sel_get_name(_cmd), *str);
|
||||
printf ("(%s) got string (%s)", GSNameFromSelector(_cmd), *str);
|
||||
(*str)[0] = 'N';
|
||||
printf(" returning (%s)\n", *str);
|
||||
fflush(stdout);
|
||||
|
@ -302,14 +302,14 @@
|
|||
|
||||
- (oneway void) shout
|
||||
{
|
||||
printf ("(%s) got it\n", sel_get_name(_cmd));
|
||||
printf ("(%s) got it\n", GSNameFromSelector(_cmd));
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
/* sender must also respond to 'bounce:count:' */
|
||||
- bounce: sender count: (int)c
|
||||
{
|
||||
printf ("(%s) got message %d, bouncing back %d", sel_get_name(_cmd), c, c-1);
|
||||
printf ("(%s) got message %d, bouncing back %d", GSNameFromSelector(_cmd), c, c-1);
|
||||
fflush(stdout);
|
||||
if (--c)
|
||||
[sender bounce:self count:c];
|
||||
|
@ -354,21 +354,21 @@
|
|||
|
||||
- sendDouble: (double)d andFloat: (float)f
|
||||
{
|
||||
printf("(%s) got double %f, float %f\n", sel_get_name(_cmd), d, f);
|
||||
printf("(%s) got double %f, float %f\n", GSNameFromSelector(_cmd), d, f);
|
||||
fflush(stdout);
|
||||
return self;
|
||||
}
|
||||
|
||||
- quietBycopy: (bycopy id)o
|
||||
{
|
||||
printf(" >> quiet bycopy class is %s\n", object_get_class_name (o));
|
||||
printf(" >> quiet bycopy class is %s\n", GSClassNameFromObject(o));
|
||||
fflush(stdout);
|
||||
return self;
|
||||
}
|
||||
|
||||
- sendBycopy: (bycopy id)o
|
||||
{
|
||||
printf(" >> bycopy class is %s\n", object_get_class_name (o));
|
||||
printf(" >> bycopy class is %s\n", GSClassNameFromObject(o));
|
||||
fflush(stdout);
|
||||
return self;
|
||||
}
|
||||
|
@ -376,13 +376,13 @@
|
|||
#ifdef _F_BYREF
|
||||
- sendByref: (byref id)o
|
||||
{
|
||||
printf(" >> byref class is %s\n", object_get_class_name (o));
|
||||
printf(" >> byref class is %s\n", GSClassNameFromObject(o));
|
||||
fflush(stdout);
|
||||
return self;
|
||||
}
|
||||
- modifyByref: (byref NSMutableString *)o
|
||||
{
|
||||
printf(" >> byref class is %s\n", object_get_class_name (o));
|
||||
printf(" >> byref class is %s\n", GSClassNameFromObject(o));
|
||||
fflush(stdout);
|
||||
[o appendString: @"hello"];
|
||||
return self;
|
||||
|
@ -422,7 +422,7 @@
|
|||
|
||||
- (NSConnection*) connection: ancestor didConnect: newConn
|
||||
{
|
||||
printf("%s\n", sel_get_name(_cmd));
|
||||
printf("%s\n", GSNameFromSelector(_cmd));
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
selector: @selector(connectionBecameInvalid:)
|
||||
|
|
Loading…
Reference in a new issue