mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
deprecates some gnustep runtime wrappers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29697 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
80be6b9067
commit
8769dd8b6f
39 changed files with 381 additions and 333 deletions
42
ChangeLog
42
ChangeLog
|
@ -1,3 +1,45 @@
|
|||
2010-02-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSIndexPath.m:
|
||||
* Source/NSPortCoder.m:
|
||||
* Source/NSCalendarDate.m:
|
||||
* Source/NSPropertyList.m:
|
||||
* Source/GSConcreteValueTemplate.m:
|
||||
* Source/NSScanner.m:
|
||||
* Source/GSFFCallInvocation.m:
|
||||
* Source/NSKeyValueObserving.m:
|
||||
* Source/NSSortDescriptor.m:
|
||||
* Source/GSFFIInvocation.m:
|
||||
* Source/NSUnarchiver.m:
|
||||
* Source/NSInvocation.m:
|
||||
* Source/NSFileManager.m:
|
||||
* Source/NSString.m:
|
||||
* Source/NSObject.m:
|
||||
* Source/NSConcreteMapTable.m:
|
||||
* Source/Additions/GSObjCRuntime.m:
|
||||
* Source/GSSet.m:
|
||||
* Source/GSString.m:
|
||||
* Source/NSConnection.m:
|
||||
* Source/NSAutoreleasePool.m:
|
||||
* Source/NSData.m:
|
||||
* Source/NSDate.m:
|
||||
* Source/NSProxy.m:
|
||||
* Source/NSObjCRuntime.m:
|
||||
* Source/NSProtocolChecker.m:
|
||||
* Source/GSValue.m:
|
||||
* Source/NSSerializer.m:
|
||||
* Source/NSCountedSet.m:
|
||||
* Source/NSSet.m:
|
||||
* Source/NSDistantObject.m:
|
||||
* Source/NSArchiver.m:
|
||||
* Source/NSCharacterSet.m:
|
||||
* Source/NSConcreteHashTable.m:
|
||||
* Headers/Additions/GNUstepBase/NSDebug+GNUstepBase.h:
|
||||
* Headers/Additions/GNUstepBase/GSObjCRuntime.h:
|
||||
Deprecate some GS... runtime wrappers in favour of using the new
|
||||
ObjC2 API where we have emulation for systems which are actually
|
||||
usig the old API. Work in progress.
|
||||
|
||||
2010-02-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSString.m: Fix incorrectly initialized zone ivar.
|
||||
|
|
|
@ -36,8 +36,14 @@
|
|||
#include <objc/objc.h>
|
||||
#include <objc/objc-api.h>
|
||||
|
||||
#if defined(HAVE_OBJC_RUNTIME_H)
|
||||
#if OBJC2RUNTIME
|
||||
/* We have a real ObjC2 runtime.
|
||||
*/
|
||||
#include <objc/runtime.h>
|
||||
#else
|
||||
/* We emulate an ObjC2 runtime.
|
||||
*/
|
||||
#include <GNUstepBase/runtime.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -94,16 +100,33 @@ extern "C" {
|
|||
#define nil 0
|
||||
#endif
|
||||
|
||||
#if !defined(_C_CONST)
|
||||
#define _C_CONST 'r'
|
||||
#endif
|
||||
#if !defined(_C_IN)
|
||||
#define _C_IN 'n'
|
||||
#endif
|
||||
#if !defined(_C_INOUT)
|
||||
#define _C_INOUT 'N'
|
||||
#endif
|
||||
#if !defined(_C_OUT)
|
||||
#define _C_OUT 'o'
|
||||
#endif
|
||||
#if !defined(_C_BYCOPY)
|
||||
#define _C_BYCOPY 'O'
|
||||
#endif
|
||||
#if !defined(_C_BYREF)
|
||||
#define _C_BYREF 'R'
|
||||
#endif
|
||||
#if !defined(_C_ONEWAY)
|
||||
#define _C_ONEWAY 'V'
|
||||
#endif
|
||||
#if !defined(_C_GCINVISIBLE)
|
||||
#define _C_GCINVISIBLE '!'
|
||||
#endif
|
||||
|
||||
#if defined(NeXT_RUNTIME)
|
||||
|
||||
#define _C_CONST 'r'
|
||||
#define _C_IN 'n'
|
||||
#define _C_INOUT 'N'
|
||||
#define _C_OUT 'o'
|
||||
#define _C_BYCOPY 'O'
|
||||
#define _C_BYREF 'R'
|
||||
#define _C_ONEWAY 'V'
|
||||
#define _C_GCINVISIBLE '!'
|
||||
|
||||
#elif defined(__GNUSTEP_RUNTIME__)
|
||||
|
||||
|
@ -116,7 +139,6 @@ extern "C" {
|
|||
|
||||
#else /* Old GNU runtime */
|
||||
|
||||
#define class_getInstanceSize(C) class_get_instance_size(C)
|
||||
|
||||
#define class_nextMethodList(aClass,anIterator) (({\
|
||||
if (*(anIterator) == 0) \
|
||||
|
@ -125,8 +147,6 @@ extern "C" {
|
|||
*(anIterator) = (*((struct objc_method_list**)(anIterator)))->method_next; \
|
||||
}), *(anIterator))
|
||||
|
||||
#define object_getClass(O) ((Class)*(Class*)O)
|
||||
#define object_setClass(O,C) (*((Class*)O) = C)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -205,128 +225,53 @@ GS_EXPORT unsigned int
|
|||
GSClassList(Class *buffer, unsigned int max, BOOL clearCache);
|
||||
|
||||
/**
|
||||
* GSObjCClass() return the class of an instance.
|
||||
* Returns a nul pointer if the argument is nil.
|
||||
* GSObjCClass() is deprecated ... use object_getClass()
|
||||
*/
|
||||
GS_STATIC_INLINE Class
|
||||
GSObjCClass(id obj)
|
||||
{
|
||||
if (obj == nil)
|
||||
return 0;
|
||||
return obj->class_pointer;
|
||||
}
|
||||
GS_EXPORT Class GSObjCClass(id obj);
|
||||
|
||||
/**
|
||||
* Returns the superclass of this.
|
||||
* GSObjCSuper() is deprecated ... use class_getSuperclass()
|
||||
*/
|
||||
GS_STATIC_INLINE Class
|
||||
GSObjCSuper(Class cls)
|
||||
{
|
||||
#ifndef NeXT_RUNTIME
|
||||
if (cls != 0 && CLS_ISRESOLV (cls) == NO)
|
||||
{
|
||||
const char *name;
|
||||
name = (const char *)cls->super_class;
|
||||
if (name == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return objc_lookup_class (name);
|
||||
}
|
||||
#endif
|
||||
return class_get_super_class(cls);
|
||||
}
|
||||
GS_EXPORT Class GSObjCSuper(Class cls);
|
||||
|
||||
/**
|
||||
* GSObjCIsInstance() tests to see if an id is an instance.
|
||||
* Returns NO if the argument is nil.
|
||||
* GSObjCIsInstance() is deprecated ... use object_getClass()
|
||||
* in conjunction with class_isMetaClass()
|
||||
*/
|
||||
GS_STATIC_INLINE BOOL
|
||||
GSObjCIsInstance(id obj)
|
||||
{
|
||||
if (obj == nil)
|
||||
return NO;
|
||||
return object_is_instance(obj);
|
||||
}
|
||||
GS_EXPORT BOOL GSObjCIsInstance(id obj);
|
||||
|
||||
/**
|
||||
* GSObjCIsClass() tests to see if an id is a class.
|
||||
* Returns NO if the argument is nil.
|
||||
* GSObjCIsClass() is deprecated ... use object_getClass()
|
||||
* in conjunction with class_isMetaClass()
|
||||
*/
|
||||
GS_STATIC_INLINE BOOL
|
||||
GSObjCIsClass(Class cls)
|
||||
{
|
||||
if (cls == nil)
|
||||
return NO;
|
||||
return object_is_class(cls);
|
||||
}
|
||||
GS_EXPORT BOOL GSObjCIsClass(Class cls);
|
||||
|
||||
/**
|
||||
* GSObjCIsKindOf() tests to see if a class inherits from another class
|
||||
* Test to see if class inherits from another class
|
||||
* The argument to this function must NOT be nil.
|
||||
*/
|
||||
GS_STATIC_INLINE BOOL
|
||||
GSObjCIsKindOf(Class cls, Class other)
|
||||
{
|
||||
while (cls != Nil)
|
||||
{
|
||||
if (cls == other)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
cls = GSObjCSuper(cls);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
GS_EXPORT BOOL GSObjCIsKindOf(Class cls, Class other);
|
||||
|
||||
/**
|
||||
* Given a class name, return the corresponding class or
|
||||
* a nul pointer if the class cannot be found. <br />
|
||||
* If the argument is nil, return a nul pointer.
|
||||
* GSClassFromName() is deprecated ... use objc_lookUpClass()
|
||||
*/
|
||||
GS_STATIC_INLINE Class
|
||||
GSClassFromName(const char *name)
|
||||
{
|
||||
if (name == 0)
|
||||
return 0;
|
||||
return objc_lookup_class(name);
|
||||
}
|
||||
GS_EXPORT Class GSClassFromName(const char *name);
|
||||
|
||||
/**
|
||||
* Return the name of the supplied class, or a nul pointer if no class
|
||||
* was supplied.
|
||||
* GSNameFromClass() is deprecated ... use class_getName()
|
||||
*/
|
||||
GS_STATIC_INLINE const char *
|
||||
GSNameFromClass(Class cls)
|
||||
{
|
||||
if (cls == 0)
|
||||
return 0;
|
||||
return class_get_class_name(cls);
|
||||
}
|
||||
GS_EXPORT const char *GSNameFromClass(Class cls);
|
||||
|
||||
/**
|
||||
* Return the name of the object's class, or a nul pointer if no object
|
||||
* was supplied.
|
||||
* GSClassNameFromObject() is deprecated ... use object_getClass()
|
||||
* in conjunction with class_getName()
|
||||
*/
|
||||
GS_STATIC_INLINE const char *
|
||||
GSClassNameFromObject(id obj)
|
||||
{
|
||||
if (obj == 0)
|
||||
return 0;
|
||||
return object_get_class_name(obj);
|
||||
}
|
||||
GS_EXPORT const char *GSClassNameFromObject(id obj);
|
||||
|
||||
/**
|
||||
* Return the name of the supplied selector, or a nul pointer if no selector
|
||||
* was supplied.
|
||||
* GSNameFromSelector() is deprecated ... use sel_getName()
|
||||
*/
|
||||
GS_STATIC_INLINE const char *
|
||||
GSNameFromSelector(SEL sel)
|
||||
{
|
||||
if (sel == 0)
|
||||
return 0;
|
||||
return sel_get_name(sel);
|
||||
}
|
||||
GS_EXPORT const char *GSNameFromSelector(SEL sel);
|
||||
|
||||
/**
|
||||
* Return a selector matching the specified name, or nil if no name is
|
||||
|
@ -653,13 +598,9 @@ GSRemoveMethodList(Class cls,
|
|||
|
||||
|
||||
/**
|
||||
* Returns the version number of this.
|
||||
* GSObjCVersion() is deprecated ... use class_getVersion()
|
||||
*/
|
||||
GS_STATIC_INLINE int
|
||||
GSObjCVersion(Class cls)
|
||||
{
|
||||
return class_get_version(cls);
|
||||
}
|
||||
GS_EXPORT int GSObjCVersion(Class cls);
|
||||
|
||||
#ifndef NeXT_Foundation_LIBRARY
|
||||
#include <Foundation/NSZone.h>
|
||||
|
|
|
@ -206,7 +206,7 @@ GS_EXPORT NSString* GSDebugMethodMsg(id obj, SEL sel, const char *file,
|
|||
* has not already been called.<br />
|
||||
* Use this from inside a function. Pass an NSString as a format,
|
||||
* followed by zero or more arguments for the format string.
|
||||
* Example: GSOnceMLog(@"This function is deprecated, use another");
|
||||
* Example: GSOnceFLog(@"This function is deprecated, use another");
|
||||
*/
|
||||
#define GSOnceFLog(format, args...) \
|
||||
do { static BOOL beenHere = NO; if (beenHere == NO) {\
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/** Implementation of ObjC runtime additions for GNUStep
|
||||
Copyright (C) 1995-2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2010 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
||||
Date: Aug 1995
|
||||
|
@ -68,6 +68,74 @@
|
|||
#define BDBGPrintf(format, args...) \
|
||||
do { if (behavior_debug) { fprintf(stderr, (format) , ## args); } } while (0)
|
||||
|
||||
|
||||
Class
|
||||
GSObjCClass(id obj)
|
||||
{
|
||||
return object_getClass(obj);
|
||||
}
|
||||
Class GSObjCSuper(Class cls)
|
||||
{
|
||||
return class_getSuperclass(cls);
|
||||
}
|
||||
BOOL
|
||||
GSObjCIsInstance(id obj)
|
||||
{
|
||||
Class c = object_getClass(obj);
|
||||
|
||||
if (c != Nil && class_isMetaClass(c) == NO)
|
||||
return YES;
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
BOOL
|
||||
GSObjCIsClass(Class cls)
|
||||
{
|
||||
if (class_isMetaClass(object_getClass(cls)))
|
||||
return YES;
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
BOOL
|
||||
GSObjCIsKindOf(Class cls, Class other)
|
||||
{
|
||||
while (cls != Nil)
|
||||
{
|
||||
if (cls == other)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
cls = class_getSuperclass(cls);
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
Class
|
||||
GSClassFromName(const char *name)
|
||||
{
|
||||
return objc_lookUpClass(name);
|
||||
}
|
||||
const char *
|
||||
GSNameFromClass(Class cls)
|
||||
{
|
||||
return class_getName(cls);
|
||||
}
|
||||
const char *
|
||||
GSClassNameFromObject(id obj)
|
||||
{
|
||||
return class_getName(object_getClass(obj));
|
||||
}
|
||||
const char *
|
||||
GSNameFromSelector(SEL sel)
|
||||
{
|
||||
return sel_getName(sel);
|
||||
}
|
||||
int
|
||||
GSObjCVersion(Class cls)
|
||||
{
|
||||
return class_getVersion(cls);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to locate information about the instance
|
||||
* variable of obj called name. It returns YES if the variable
|
||||
|
@ -560,7 +628,7 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
GSNameFromSelector(method->method_name));
|
||||
|
||||
if (!search_for_method_in_class(cls, method->method_name)
|
||||
&& !sel_eq(method->method_name, initialize_sel))
|
||||
&& !sel_isEqual(method->method_name, initialize_sel))
|
||||
{
|
||||
/* As long as the method isn't defined in the CLASS,
|
||||
put the BEHAVIOR method in there. Thus, behavior
|
||||
|
@ -610,7 +678,7 @@ search_for_method_in_class (Class cls, SEL op)
|
|||
|
||||
if (method->method_name)
|
||||
{
|
||||
if (sel_eq(method->method_name, op))
|
||||
if (sel_isEqual(method->method_name, op))
|
||||
return method;
|
||||
}
|
||||
}
|
||||
|
@ -668,7 +736,7 @@ GSObjCAddMethods (Class cls, GSMethodList methods)
|
|||
BDBGPrintf(" processing method [%s] ... ", name);
|
||||
|
||||
if (!search_for_method_in_list(cls->methods, method->method_name)
|
||||
&& !sel_eq(method->method_name, initialize_sel))
|
||||
&& !sel_isEqual(method->method_name, initialize_sel))
|
||||
{
|
||||
/* As long as the method isn't defined in the CLASS,
|
||||
put the BEHAVIOR method in there. Thus, behavior
|
||||
|
@ -830,7 +898,7 @@ GSRemoveMethodFromList (GSMethodList list,
|
|||
sel = (SEL)GSNameFromSelector (sel);
|
||||
}
|
||||
#else
|
||||
/* Insure that we always use sel_eq on non GNU Runtimes. */
|
||||
/* Insure that we always use sel_isEqual on non GNU Runtimes. */
|
||||
isFree = NO;
|
||||
#endif
|
||||
|
||||
|
@ -838,10 +906,10 @@ GSRemoveMethodFromList (GSMethodList list,
|
|||
{
|
||||
SEL method_name = list->method_list[i].method_name;
|
||||
|
||||
/* For the GNU runtime we have use strcmp instead of sel_eq
|
||||
/* For the GNU runtime we have use strcmp instead of sel_isEqual
|
||||
for free standing method lists. */
|
||||
if ((isFree == YES && strcmp((char *)method_name, (char *)sel) == 0)
|
||||
|| (isFree == NO && sel_eq(method_name, sel)))
|
||||
|| (isFree == NO && sel_isEqual(method_name, sel)))
|
||||
{
|
||||
/* Found the list. Now fill up the gap. */
|
||||
for ((list->method_count)--; i < list->method_count; i++)
|
||||
|
@ -928,10 +996,10 @@ GSMethodFromList(GSMethodList list,
|
|||
GSMethod method = &list->method_list[i];
|
||||
SEL method_name = method->method_name;
|
||||
|
||||
/* For the GNU runtime we have use strcmp instead of sel_eq
|
||||
/* For the GNU runtime we have use strcmp instead of sel_isEqual
|
||||
for free standing method lists. */
|
||||
if ((isFree == YES && strcmp((char *)method_name, (char *)sel) == 0)
|
||||
|| (isFree == NO && sel_eq(method_name, sel)))
|
||||
|| (isFree == NO && sel_isEqual(method_name, sel)))
|
||||
{
|
||||
return method;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ behavior_class_add_methods (Class class, struct objc_method_list *methods)
|
|||
}
|
||||
|
||||
if (!search_for_method_in_list(class,method->method_name)
|
||||
&& !sel_eq(method->method_name, initialize_sel))
|
||||
&& !sel_isEqual(method->method_name, initialize_sel))
|
||||
{
|
||||
/* As long as the method isn't defined in the CLASS,
|
||||
put the BEHAVIOR method in there. Thus, behavior
|
||||
|
@ -249,7 +249,7 @@ search_for_method_in_list (Class class, SEL op)
|
|||
|
||||
if (method->method_name)
|
||||
{
|
||||
if (sel_eq(method->method_name, op))
|
||||
if (sel_isEqual(method->method_name, op))
|
||||
return method;
|
||||
}
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ behavior_class_add_methods (Class class,
|
|||
fprintf(stderr, " processing method [%s] ... ", name);
|
||||
}
|
||||
if (!search_for_method_in_list(class->methods, method->method_name)
|
||||
&& !sel_eq(method->method_name, initialize_sel))
|
||||
&& !sel_isEqual(method->method_name, initialize_sel))
|
||||
{
|
||||
/* As long as the method isn't defined in the CLASS,
|
||||
put the BEHAVIOR method in there. Thus, behavior
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
- (BOOL) isEqual: (id)other
|
||||
{
|
||||
if (other != nil && GSObjCIsInstance(other) == YES
|
||||
&& GSObjCIsKindOf(GSObjCClass(other), GSObjCClass(self)))
|
||||
&& GSObjCIsKindOf(object_getClass(other), object_getClass(self)))
|
||||
{
|
||||
return [self isEqualToValue: other];
|
||||
}
|
||||
|
@ -144,7 +144,7 @@
|
|||
typedef __typeof__(data) _dt;
|
||||
|
||||
if (aValue != nil && GSObjCIsInstance(aValue) == YES
|
||||
&& GSObjCIsKindOf(GSObjCClass(aValue), GSObjCClass(self)))
|
||||
&& GSObjCIsKindOf(object_getClass(aValue), object_getClass(self)))
|
||||
{
|
||||
_dt val = [aValue TYPE_METHOD];
|
||||
#if TYPE_ORDER == 0
|
||||
|
|
|
@ -290,7 +290,7 @@ gs_method_for_receiver_and_selector (id receiver, SEL sel)
|
|||
if (receiver)
|
||||
{
|
||||
return GSGetMethod((GSObjCIsInstance(receiver)
|
||||
? GSObjCClass(receiver) : (Class)receiver),
|
||||
? object_getClass(receiver) : (Class)receiver),
|
||||
sel,
|
||||
GSObjCIsInstance(receiver),
|
||||
YES);
|
||||
|
@ -321,7 +321,7 @@ gs_find_best_typed_sel (SEL sel)
|
|||
{
|
||||
if (!sel_get_type (sel))
|
||||
{
|
||||
const char *name = GSNameFromSelector(sel);
|
||||
const char *name = sel_getName(sel);
|
||||
|
||||
if (name)
|
||||
{
|
||||
|
@ -753,16 +753,16 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
|
|||
|
||||
s.self = _target;
|
||||
if (GSObjCIsInstance(_target))
|
||||
s.class = GSObjCSuper(GSObjCClass(_target));
|
||||
s.class = class_getSuperclass(object_getClass(_target));
|
||||
else
|
||||
s.class = GSObjCSuper((Class)_target);
|
||||
s.class = class_getSuperclass((Class)_target);
|
||||
imp = objc_msg_lookup_super(&s, _selector);
|
||||
}
|
||||
else
|
||||
{
|
||||
GSMethod method;
|
||||
method = GSGetMethod((GSObjCIsInstance(_target)
|
||||
? (id)GSObjCClass(_target)
|
||||
? (id)object_getClass(_target)
|
||||
: (id)_target),
|
||||
_selector,
|
||||
GSObjCIsInstance(_target),
|
||||
|
@ -888,7 +888,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
@" to forwardInvocation: for '%s'",
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
selector ? sel_getName(selector) : "(null)"];
|
||||
}
|
||||
|
||||
sig = nil;
|
||||
|
@ -916,7 +916,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
|
||||
if (runtimeTypes == 0 || strcmp(receiverTypes, runtimeTypes) != 0)
|
||||
{
|
||||
const char *runtimeName = GSNameFromSelector(selector);
|
||||
const char *runtimeName = sel_getName(selector);
|
||||
|
||||
selector = sel_get_typed_uid (runtimeName, receiverTypes);
|
||||
if (selector == 0)
|
||||
|
@ -956,7 +956,7 @@ GSInvocationCallback (void *callback_data, va_alist args)
|
|||
format: @"Can not determine type information for %s[%s %s]",
|
||||
GSObjCIsInstance(obj) ? "-" : "+",
|
||||
GSClassNameFromObject(obj),
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
selector ? sel_getName(selector) : "(null)"];
|
||||
}
|
||||
|
||||
invocation = [[GSFFCallInvocation alloc] initWithMethodSignature: sig];
|
||||
|
|
|
@ -22,8 +22,6 @@
|
|||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
// FIXME: We should be using the new interfaces, not exposing the old ones.
|
||||
# define __OBJC_LEGACY_GNU_MODE__
|
||||
|
||||
#import "common.h"
|
||||
#import "Foundation/NSException.h"
|
||||
|
@ -31,10 +29,7 @@
|
|||
#import "Foundation/NSDistantObject.h"
|
||||
#import "Foundation/NSData.h"
|
||||
#import "GSInvocation.h"
|
||||
#import <objc/objc-api.h>
|
||||
#if HAVE_OBJC_RUNTIME_H
|
||||
# import <objc/runtime.h>
|
||||
#endif
|
||||
#import "GNUstepBase/GSObjCRuntime.h"
|
||||
#import <pthread.h>
|
||||
#import "cifframe.h"
|
||||
#import "GSPrivate.h"
|
||||
|
@ -68,7 +63,7 @@ gs_method_for_receiver_and_selector (id receiver, SEL sel)
|
|||
if (receiver)
|
||||
{
|
||||
return GSGetMethod((GSObjCIsInstance(receiver)
|
||||
? GSObjCClass(receiver) : (Class)receiver),
|
||||
? object_getClass(receiver) : (Class)receiver),
|
||||
sel,
|
||||
GSObjCIsInstance(receiver),
|
||||
YES);
|
||||
|
@ -99,7 +94,7 @@ gs_find_best_typed_sel (SEL sel)
|
|||
{
|
||||
if (!sel_get_type (sel))
|
||||
{
|
||||
const char *name = GSNameFromSelector(sel);
|
||||
const char *name = sel_getName(sel);
|
||||
|
||||
if (name)
|
||||
{
|
||||
|
@ -225,7 +220,8 @@ IMP gs_objc_msg_forward (SEL sel)
|
|||
}
|
||||
#ifdef __GNUSTEP_RUNTIME__
|
||||
pthread_key_t thread_slot_key;
|
||||
static struct objc_slot_t gs_objc_msg_forward3(id receiver, SEL op)
|
||||
static struct objc_slot_t
|
||||
gs_objc_msg_forward3(id receiver, SEL op)
|
||||
{
|
||||
/* The slot has its version set to 0, so it can not be cached. This makes it
|
||||
* safe to free it when the thread exits. */
|
||||
|
@ -254,33 +250,34 @@ BOOL class_respondsToSelector(Class cls, SEL sel);
|
|||
*/
|
||||
static id gs_objc_proxy_lookup(id receiver, SEL op)
|
||||
{
|
||||
/* FIXME: Should be isa, but legacy-compat mode makes it class_pointer */
|
||||
Class cls = receiver->class_pointer;
|
||||
BOOL resolved = NO;
|
||||
/* Let the class try to add a method for this thing. */
|
||||
if (class_isMetaClass(cls))
|
||||
{
|
||||
if (class_respondsToSelector(cls, @selector(resolveClassMethod:)))
|
||||
{
|
||||
resolved = [receiver resolveClassMethod: op];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (class_respondsToSelector(cls->class_pointer, @selector(resolveInstanceMethod:)))
|
||||
{
|
||||
resolved = [class resolveInstanceMethod: op];
|
||||
}
|
||||
}
|
||||
if (resolved)
|
||||
{
|
||||
return receiver;
|
||||
}
|
||||
if (class_respondsToSelector(cls, @selector(forwardingTargetForSelector:)))
|
||||
{
|
||||
return [receiver forwardingTargetForSelector: op]
|
||||
}
|
||||
return nil;
|
||||
/* FIXME: Should be isa, but legacy-compat mode makes it class_pointer */
|
||||
Class cls = receiver->class_pointer;
|
||||
BOOL resolved = NO;
|
||||
|
||||
/* Let the class try to add a method for this thing. */
|
||||
if (class_isMetaClass(cls))
|
||||
{
|
||||
if (class_respondsToSelector(cls, @selector(resolveClassMethod:)))
|
||||
{
|
||||
resolved = [receiver resolveClassMethod: op];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (class_respondsToSelector(cls->class_pointer, @selector(resolveInstanceMethod:)))
|
||||
{
|
||||
resolved = [cls resolveInstanceMethod: op];
|
||||
}
|
||||
}
|
||||
if (resolved)
|
||||
{
|
||||
return receiver;
|
||||
}
|
||||
if (class_respondsToSelector(cls, @selector(forwardingTargetForSelector:)))
|
||||
{
|
||||
return [receiver forwardingTargetForSelector: op]
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -446,16 +443,16 @@ GSFFIInvokeWithTargetAndImp(NSInvocation *_inv, id anObject, IMP imp)
|
|||
|
||||
s.self = _target;
|
||||
if (GSObjCIsInstance(_target))
|
||||
s.class = GSObjCSuper(GSObjCClass(_target));
|
||||
s.class = class_getSuperclass(object_getClass(_target));
|
||||
else
|
||||
s.class = GSObjCSuper((Class)_target);
|
||||
s.class = class_getSuperclass((Class)_target);
|
||||
imp = objc_msg_lookup_super(&s, _selector);
|
||||
}
|
||||
else
|
||||
{
|
||||
GSMethod method;
|
||||
method = GSGetMethod((GSObjCIsInstance(_target)
|
||||
? (Class)GSObjCClass(_target)
|
||||
? (Class)object_getClass(_target)
|
||||
: (Class)_target),
|
||||
_selector,
|
||||
GSObjCIsInstance(_target),
|
||||
|
@ -555,7 +552,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
@" to forwardInvocation: for '%s'",
|
||||
GSClassNameFromObject(obj),
|
||||
GSObjCIsInstance(obj) ? "instance" : "class",
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
selector ? sel_getName(selector) : "(null)"];
|
||||
}
|
||||
|
||||
sig = nil;
|
||||
|
@ -579,7 +576,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
|
||||
if (runtimeTypes == 0 || strcmp(receiverTypes, runtimeTypes) != 0)
|
||||
{
|
||||
const char *runtimeName = GSNameFromSelector(selector);
|
||||
const char *runtimeName = sel_getName(selector);
|
||||
|
||||
selector = sel_get_typed_uid (runtimeName, receiverTypes);
|
||||
if (selector == 0)
|
||||
|
@ -620,7 +617,7 @@ GSFFIInvocationCallback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
format: @"Can not determine type information for %s[%s %s]",
|
||||
GSObjCIsInstance(obj) ? "-" : "+",
|
||||
GSClassNameFromObject(obj),
|
||||
selector ? GSNameFromSelector(selector) : "(null)"];
|
||||
selector ? sel_getName(selector) : "(null)"];
|
||||
}
|
||||
|
||||
invocation = [[GSFFIInvocation alloc] initWithCallback: cif
|
||||
|
|
|
@ -293,7 +293,7 @@ static Class mutableSetClass;
|
|||
}
|
||||
|
||||
// Loop for all members in otherSet
|
||||
c = GSObjCClass(otherSet);
|
||||
c = object_getClass(otherSet);
|
||||
if (c == setClass || c == mutableSetClass)
|
||||
{
|
||||
GSIMapTable m = &((GSSet*)otherSet)->map;
|
||||
|
@ -381,7 +381,7 @@ static Class mutableSetClass;
|
|||
}
|
||||
else
|
||||
{
|
||||
Class c = GSObjCClass(other);
|
||||
Class c = object_getClass(other);
|
||||
|
||||
if (c == setClass || c == mutableSetClass)
|
||||
{
|
||||
|
|
|
@ -831,7 +831,7 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"-initWithString: given non-string object"];
|
||||
|
||||
c = GSObjCClass(string);
|
||||
c = object_getClass(string);
|
||||
length = [string length];
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES || c == NSConstantStringClass
|
||||
|| (GSObjCIsKindOf(c, GSMutableStringClass) == YES
|
||||
|
@ -1215,7 +1215,7 @@ compare_c(GSStr self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(aString);
|
||||
c = object_getClass(aString);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)aString)->_flags.wide == 1))
|
||||
return strCompCsUs((id)self, aString, mask, aRange);
|
||||
|
@ -1232,7 +1232,7 @@ compare_u(GSStr self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(aString);
|
||||
c = object_getClass(aString);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass)
|
||||
|| (c == GSMutableStringClass && ((GSStr)aString)->_flags.wide == 1))
|
||||
return strCompUsUs((id)self, aString, mask, aRange);
|
||||
|
@ -2139,7 +2139,7 @@ isEqual_c(GSStr self, id anObject)
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
c = object_getClass(anObject);
|
||||
if (c == NSConstantStringClass)
|
||||
{
|
||||
GSStr other = (GSStr)anObject;
|
||||
|
@ -2207,7 +2207,7 @@ isEqual_u(GSStr self, id anObject)
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
c = object_getClass(anObject);
|
||||
if (c == NSConstantStringClass)
|
||||
{
|
||||
GSStr other = (GSStr)anObject;
|
||||
|
@ -2617,11 +2617,11 @@ GSPrivateRangeOfString(NSString *receiver, NSString *target)
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(receiver);
|
||||
c = object_getClass(receiver);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)receiver)->_flags.wide == 1))
|
||||
{
|
||||
c = GSObjCClass(target);
|
||||
c = object_getClass(target);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)target)->_flags.wide == 1))
|
||||
return (GSRSFunc)strRangeUsUs;
|
||||
|
@ -2636,7 +2636,7 @@ GSPrivateRangeOfString(NSString *receiver, NSString *target)
|
|||
|| c == NSConstantStringClass
|
||||
|| (c == GSMutableStringClass && ((GSStr)target)->_flags.wide == 0))
|
||||
{
|
||||
c = GSObjCClass(target);
|
||||
c = object_getClass(target);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)target)->_flags.wide == 1))
|
||||
return (GSRSFunc)strRangeCsUs;
|
||||
|
@ -2658,7 +2658,7 @@ rangeOfString_c(GSStr self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(aString);
|
||||
c = object_getClass(aString);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)aString)->_flags.wide == 1))
|
||||
return strRangeCsUs((id)self, aString, mask, aRange);
|
||||
|
@ -2675,7 +2675,7 @@ rangeOfString_u(GSStr self, NSString *aString, unsigned mask, NSRange aRange)
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(aString);
|
||||
c = object_getClass(aString);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES
|
||||
|| (c == GSMutableStringClass && ((GSStr)aString)->_flags.wide == 1))
|
||||
return strRangeUsUs((id)self, aString, mask, aRange);
|
||||
|
@ -2737,7 +2737,7 @@ transmute(GSStr self, NSString *aString)
|
|||
{
|
||||
GSStr other = (GSStr)aString;
|
||||
BOOL transmute = YES;
|
||||
Class c = GSObjCClass(aString); // NB aString must not be nil
|
||||
Class c = object_getClass(aString); // NB aString must not be nil
|
||||
|
||||
if (self->_flags.wide == 1)
|
||||
{
|
||||
|
@ -4769,7 +4769,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
c = object_getClass(anObject);
|
||||
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NSConstantStringClass
|
||||
|
@ -4819,7 +4819,7 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
c = object_getClass(anObject);
|
||||
|
||||
if (GSObjCIsKindOf(c, GSCStringClass) == YES
|
||||
|| c == NSConstantStringClass
|
||||
|
|
|
@ -149,7 +149,7 @@ typeSize(const char* type)
|
|||
{
|
||||
if (aValue == nil)
|
||||
return NO;
|
||||
if (GSObjCClass(aValue) != GSObjCClass(self))
|
||||
if (object_getClass(aValue) != object_getClass(self))
|
||||
return NO;
|
||||
if (strcmp(objctype, ((GSValue*)aValue)->objctype) != 0)
|
||||
return NO;
|
||||
|
|
|
@ -448,9 +448,9 @@ static Class NSMutableDataMallocClass;
|
|||
}
|
||||
while (done == NO)
|
||||
{
|
||||
int tmp = GSObjCVersion(c);
|
||||
int tmp = class_getVersion(c);
|
||||
unsigned version = tmp;
|
||||
Class s = GSObjCSuper(c);
|
||||
Class s = class_getSuperclass(c);
|
||||
|
||||
if (tmp < 0)
|
||||
{
|
||||
|
@ -865,12 +865,12 @@ static Class NSMutableDataMallocClass;
|
|||
GSIMapNode node;
|
||||
Class c;
|
||||
|
||||
c = GSClassFromName([trueName cString]);
|
||||
c = objc_lookUpClass([trueName cString]);
|
||||
node = GSIMapNodeForKey(_namMap, (GSIMapKey)c);
|
||||
if (node)
|
||||
{
|
||||
c = (Class)node->value.ptr;
|
||||
return [NSString stringWithUTF8String: GSNameFromClass(c)];
|
||||
return [NSString stringWithUTF8String: class_getName(c)];
|
||||
}
|
||||
}
|
||||
return trueName;
|
||||
|
@ -891,13 +891,13 @@ static Class NSMutableDataMallocClass;
|
|||
Class tc;
|
||||
Class ic;
|
||||
|
||||
tc = GSClassFromName([trueName cString]);
|
||||
tc = objc_lookUpClass([trueName cString]);
|
||||
if (tc == 0)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Can't find class '%@'.", trueName];
|
||||
}
|
||||
ic = GSClassFromName([inArchiveName cString]);
|
||||
ic = objc_lookUpClass([inArchiveName cString]);
|
||||
if (ic == 0)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
|
|
|
@ -419,7 +419,7 @@ static IMP initImp;
|
|||
"nil object encountered in autorelease pool\n");
|
||||
continue;
|
||||
}
|
||||
c = GSObjCClass(anObject);
|
||||
c = object_getClass(anObject);
|
||||
if (c == 0)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
|
|
|
@ -101,7 +101,7 @@ offset(NSTimeZone *tz, NSDate *d)
|
|||
}
|
||||
else
|
||||
{
|
||||
Class c = GSObjCClass(tz);
|
||||
Class c = object_getClass(tz);
|
||||
|
||||
if (c == dstClass && dstOffIMP != 0)
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ abbrev(NSTimeZone *tz, NSDate *d)
|
|||
}
|
||||
else
|
||||
{
|
||||
Class c = GSObjCClass(tz);
|
||||
Class c = object_getClass(tz);
|
||||
|
||||
if (c == dstClass && dstAbrIMP != 0)
|
||||
{
|
||||
|
|
|
@ -847,7 +847,7 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
- (id) init
|
||||
{
|
||||
if (GSObjCClass(self) == abstractClass)
|
||||
if (object_getClass(self) == abstractClass)
|
||||
{
|
||||
id obj;
|
||||
|
||||
|
@ -1124,7 +1124,7 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
- (id) init
|
||||
{
|
||||
if (GSObjCClass(self) == abstractMutableClass)
|
||||
if (object_getClass(self) == abstractMutableClass)
|
||||
{
|
||||
id obj;
|
||||
|
||||
|
@ -1138,7 +1138,7 @@ static Class concreteMutableClass = nil;
|
|||
|
||||
- (id) initWithBitmap: (NSData*)bitmap
|
||||
{
|
||||
if (GSObjCClass(self) == abstractMutableClass)
|
||||
if (object_getClass(self) == abstractMutableClass)
|
||||
{
|
||||
id obj;
|
||||
|
||||
|
|
|
@ -143,22 +143,22 @@ NSCompareHashTables(NSHashTable *table1, NSHashTable *table2)
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
if (GSObjCClass(table1) != concreteClass
|
||||
&& GSObjCClass(table2) == concreteClass)
|
||||
if (object_getClass(table1) != concreteClass
|
||||
&& object_getClass(table2) == concreteClass)
|
||||
{
|
||||
id t = table1;
|
||||
|
||||
table1 = table2;
|
||||
table2 = t;
|
||||
}
|
||||
if (GSObjCClass(table1) == concreteClass)
|
||||
if (object_getClass(table1) == concreteClass)
|
||||
{
|
||||
BOOL result = YES;
|
||||
NSHashEnumerator enumerator;
|
||||
GSIMapNode n1;
|
||||
|
||||
enumerator = NSEnumerateHashTable(table1);
|
||||
if (GSObjCClass(table2) == concreteClass)
|
||||
if (object_getClass(table2) == concreteClass)
|
||||
{
|
||||
GSIMapTable t2 = (GSIMapTable)table2;
|
||||
|
||||
|
@ -371,7 +371,7 @@ NSEnumerateHashTable(NSHashTable *table)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return v;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
return GSIMapEnumeratorForMap((GSIMapTable)table);
|
||||
}
|
||||
|
@ -408,7 +408,7 @@ NSHashGet(NSHashTable *table, const void *element)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return 0;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapNode n;
|
||||
|
||||
|
@ -443,7 +443,7 @@ NSHashInsert(NSHashTable *table, const void *element)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to place null in hash table"];
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
GSIMapNode n;
|
||||
|
@ -487,7 +487,7 @@ NSHashInsertIfAbsent(NSHashTable *table, const void *element)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to place null in hash table"];
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
GSIMapNode n;
|
||||
|
@ -538,7 +538,7 @@ NSHashInsertKnownAbsent(NSHashTable *table, const void *element)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to place null in hash table"];
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
GSIMapNode n;
|
||||
|
@ -582,7 +582,7 @@ NSHashRemove(NSHashTable *table, const void *element)
|
|||
NSWarnFLog(@"Nul table argument supplied");
|
||||
return;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable map = (GSIMapTable)table;
|
||||
GSIMapBucket bucket;
|
||||
|
@ -658,7 +658,7 @@ NSResetHashTable(NSHashTable *table)
|
|||
NSWarnFLog(@"Nul table argument supplied");
|
||||
return;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
NSConcreteHashTable *t = (NSConcreteHashTable*)table;
|
||||
|
||||
|
|
|
@ -221,8 +221,8 @@ NSCompareMapTables(NSMapTable *table1, NSMapTable *table2)
|
|||
return NO;
|
||||
}
|
||||
|
||||
if (GSObjCClass(table1) != concreteClass
|
||||
&& GSObjCClass(table2) == concreteClass)
|
||||
if (object_getClass(table1) != concreteClass
|
||||
&& object_getClass(table2) == concreteClass)
|
||||
{
|
||||
id t = table1;
|
||||
|
||||
|
@ -230,7 +230,7 @@ NSCompareMapTables(NSMapTable *table1, NSMapTable *table2)
|
|||
table2 = t;
|
||||
}
|
||||
|
||||
if (GSObjCClass(table1) == concreteClass)
|
||||
if (object_getClass(table1) == concreteClass)
|
||||
{
|
||||
NSConcreteMapTable *c1 = (NSConcreteMapTable*)table1;
|
||||
GSIMapTable t1 = (GSIMapTable)table1;
|
||||
|
@ -239,7 +239,7 @@ NSCompareMapTables(NSMapTable *table1, NSMapTable *table2)
|
|||
GSIMapNode n1;
|
||||
|
||||
enumerator = GSIMapEnumeratorForMap(t1);
|
||||
if (GSObjCClass(table2) == concreteClass)
|
||||
if (object_getClass(table2) == concreteClass)
|
||||
{
|
||||
GSIMapTable t2 = (GSIMapTable)table2;
|
||||
|
||||
|
@ -356,7 +356,7 @@ NSCopyMapTableWithZone(NSMapTable *table, NSZone *zone)
|
|||
#endif
|
||||
GSIMapInitWithZoneAndCapacity(t, zone, ((GSIMapTable)table)->nodeCount);
|
||||
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
NSMapEnumerator enumerator;
|
||||
|
||||
|
@ -393,7 +393,7 @@ NSCountMapTable(NSMapTable *table)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return 0;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
return ((GSIMapTable)table)->nodeCount;
|
||||
}
|
||||
|
@ -518,7 +518,7 @@ NSEnumerateMapTable(NSMapTable *table)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return v;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
return GSIMapEnumeratorForMap((GSIMapTable)table);
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ NSMapGet(NSMapTable *table, const void *key)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return 0;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapNode n;
|
||||
|
||||
|
@ -598,7 +598,7 @@ NSMapInsert(NSMapTable *table, const void *key, const void *value)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to place key-value in null table"];
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
GSIMapNode n;
|
||||
|
@ -653,7 +653,7 @@ NSMapInsertIfAbsent(NSMapTable *table, const void *key, const void *value)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to place key-value in null table"];
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
GSIMapNode n;
|
||||
|
@ -710,7 +710,7 @@ NSMapInsertKnownAbsent(NSMapTable *table, const void *key, const void *value)
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to place key-value in null table"];
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
GSIMapNode n;
|
||||
|
@ -771,7 +771,7 @@ NSMapMember(NSMapTable *table, const void *key,
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return NO;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapNode n;
|
||||
|
||||
|
@ -811,7 +811,7 @@ NSMapRemove(NSMapTable *table, const void *key)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
if (((GSIMapTable)table)->nodeCount > 0)
|
||||
{
|
||||
|
@ -928,7 +928,7 @@ NSResetMapTable(NSMapTable *table)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
if (((GSIMapTable)table)->nodeCount > 0)
|
||||
{
|
||||
|
@ -956,7 +956,7 @@ NSStringFromMapTable(NSMapTable *table)
|
|||
NSWarnFLog(@"Null table argument supplied");
|
||||
return nil;
|
||||
}
|
||||
if (GSObjCClass(table) == concreteClass)
|
||||
if (object_getClass(table) == concreteClass)
|
||||
{
|
||||
GSIMapTable t = (GSIMapTable)table;
|
||||
NSMutableString *string;
|
||||
|
|
|
@ -1991,7 +1991,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
type = [[object methodSignatureForSelector: [inv selector]] methodType];
|
||||
if (type)
|
||||
{
|
||||
sel_register_typed_name(GSNameFromSelector([inv selector]), type);
|
||||
sel_register_typed_name(sel_getName([inv selector]), type);
|
||||
}
|
||||
}
|
||||
NSParameterAssert(type);
|
||||
|
@ -2032,7 +2032,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
|
||||
[self _sendOutRmc: op type: METHOD_REQUEST];
|
||||
NSDebugMLLog(@"NSConnection", @"Sent message %s RMC %d to 0x%x",
|
||||
GSNameFromSelector([inv selector]), seq, (uintptr_t)self);
|
||||
sel_getName([inv selector]), seq, (uintptr_t)self);
|
||||
|
||||
if (needsResponse == NO)
|
||||
{
|
||||
|
@ -2557,7 +2557,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
}
|
||||
else if (GSObjCIsInstance(object))
|
||||
{
|
||||
meth = GSGetMethod(GSObjCClass(object), selector, YES, YES);
|
||||
meth = GSGetMethod(object_getClass(object), selector, YES, YES);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2574,9 +2574,9 @@ static NSLock *cached_proxies_gate = nil;
|
|||
NSDebugLog(@"Local object <%p %s> doesn't implement: %s directly. "
|
||||
@"Will search for arbitrary signature.",
|
||||
object,
|
||||
GSNameFromClass(GSObjCIsClass(object)
|
||||
? object : (id)GSObjCClass(object)),
|
||||
GSNameFromSelector(selector));
|
||||
class_getName(GSObjCIsClass(object)
|
||||
? object : (id)object_getClass(object)),
|
||||
sel_getName(selector));
|
||||
type = GSTypesFromSelector(selector);
|
||||
}
|
||||
|
||||
|
@ -2587,7 +2587,7 @@ static NSLock *cached_proxies_gate = nil;
|
|||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"NSConection types (%s / %s) missmatch for %s",
|
||||
encoded_types, type, GSNameFromSelector(selector)];
|
||||
encoded_types, type, sel_getName(selector)];
|
||||
}
|
||||
|
||||
sig = [NSMethodSignature signatureWithObjCTypes: type];
|
||||
|
|
|
@ -115,7 +115,7 @@ static Class NSCountedSet_concrete_class;
|
|||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
unsigned count;
|
||||
Class c = GSObjCClass(self);
|
||||
Class c = object_getClass(self);
|
||||
|
||||
if (c == NSCountedSet_abstract_class)
|
||||
{
|
||||
|
|
|
@ -1100,12 +1100,12 @@ failure:
|
|||
length: ni
|
||||
atCursor: cursor];
|
||||
name[ni] = '\0';
|
||||
c = GSClassFromName(name);
|
||||
c = objc_lookUpClass(name);
|
||||
if (c == 0)
|
||||
{
|
||||
NSLog(@"[%s %s] can't find class - %s",
|
||||
GSNameFromClass([self class]),
|
||||
GSNameFromSelector(_cmd), name);
|
||||
class_getName([self class]),
|
||||
sel_getName(_cmd), name);
|
||||
}
|
||||
*(Class*)data = c;
|
||||
}
|
||||
|
@ -2265,7 +2265,7 @@ failure:
|
|||
}
|
||||
case _C_CLASS:
|
||||
{
|
||||
const char *name = *(Class*)data?GSNameFromClass(*(Class*)data):"";
|
||||
const char *name = *(Class*)data?class_getName(*(Class*)data):"";
|
||||
uint16_t ln = (uint16_t)strlen(name);
|
||||
uint16_t ni;
|
||||
|
||||
|
@ -2279,7 +2279,7 @@ failure:
|
|||
}
|
||||
case _C_SEL:
|
||||
{
|
||||
const char *name = *(SEL*)data?GSNameFromSelector(*(SEL*)data):"";
|
||||
const char *name = *(SEL*)data?sel_getName(*(SEL*)data):"";
|
||||
uint16_t ln = (name == 0) ? 0 : (uint16_t)strlen(name);
|
||||
const char *types = *(SEL*)data?GSTypesFromSelector(*(SEL*)data):"";
|
||||
uint16_t lt = (types == 0) ? 0 : (uint16_t)strlen(types);
|
||||
|
@ -2762,12 +2762,12 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
|
||||
getBytes((void*)name, bytes, ni, length, cursor);
|
||||
name[ni] = '\0';
|
||||
c = GSClassFromName(name);
|
||||
c = objc_lookUpClass(name);
|
||||
if (c == 0)
|
||||
{
|
||||
NSLog(@"[%s %s] can't find class - %s",
|
||||
GSNameFromClass([self class]),
|
||||
GSNameFromSelector(_cmd), name);
|
||||
class_getName([self class]),
|
||||
sel_getName(_cmd), name);
|
||||
}
|
||||
*(Class*)data = c;
|
||||
}
|
||||
|
@ -3572,7 +3572,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
}
|
||||
case _C_CLASS:
|
||||
{
|
||||
const char *name = *(Class*)data?GSNameFromClass(*(Class*)data):"";
|
||||
const char *name = *(Class*)data?class_getName(*(Class*)data):"";
|
||||
uint16_t ln = (uint16_t)strlen(name);
|
||||
uint32_t minimum = length + ln + sizeof(uint16_t);
|
||||
uint16_t ni;
|
||||
|
@ -3593,7 +3593,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
|||
}
|
||||
case _C_SEL:
|
||||
{
|
||||
const char *name = *(SEL*)data?GSNameFromSelector(*(SEL*)data):"";
|
||||
const char *name = *(SEL*)data?sel_getName(*(SEL*)data):"";
|
||||
uint16_t ln = (name == 0) ? 0 : (uint16_t)strlen(name);
|
||||
const char *types = *(SEL*)data?GSTypesFromSelector(*(SEL*)data):"";
|
||||
uint16_t lt = (types == 0) ? 0 : (uint16_t)strlen(types);
|
||||
|
|
|
@ -110,7 +110,7 @@ otherTime(NSDate* other)
|
|||
[NSException raise: NSInvalidArgumentException format: @"other time nil"];
|
||||
if (GSObjCIsInstance(other) == NO)
|
||||
[NSException raise: NSInvalidArgumentException format: @"other time bad"];
|
||||
c = GSObjCClass(other);
|
||||
c = object_getClass(other);
|
||||
if (c == concreteClass || c == calendarClass)
|
||||
return ((NSGDate*)other)->_seconds_since_ref;
|
||||
else
|
||||
|
|
|
@ -159,7 +159,7 @@ enum proxyLocation
|
|||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (self == GSClassFromName("GSDistantObjectPlaceHolder"))
|
||||
if (self == objc_lookUpClass("GSDistantObjectPlaceHolder"))
|
||||
{
|
||||
distantObjectClass = [NSDistantObject class];
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ enum proxyLocation
|
|||
{
|
||||
if (self == [NSDistantObject class])
|
||||
{
|
||||
placeHolder = GSClassFromName("GSDistantObjectPlaceHolder");
|
||||
placeHolder = objc_lookUpClass("GSDistantObjectPlaceHolder");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -687,7 +687,7 @@ enum proxyLocation
|
|||
* signature of methodSignatureForSelector:, so we hack in
|
||||
* the signature required manually :-(
|
||||
*/
|
||||
if (sel_eq(aSelector, _cmd))
|
||||
if (sel_isEqual(aSelector, _cmd))
|
||||
{
|
||||
static NSMethodSignature *sig = nil;
|
||||
|
||||
|
@ -697,7 +697,7 @@ enum proxyLocation
|
|||
}
|
||||
return sig;
|
||||
}
|
||||
if (sel_eq(aSelector, @selector(methodType)))
|
||||
if (sel_isEqual(aSelector, @selector(methodType)))
|
||||
{
|
||||
static NSMethodSignature *sig = nil;
|
||||
|
||||
|
@ -720,7 +720,7 @@ enum proxyLocation
|
|||
* (implemented in NSObject.m) to examine the protocol contents
|
||||
* without sending any ObjectiveC message to it.
|
||||
*/
|
||||
if ((uintptr_t)GSObjCClass(_protocol) == 0x2)
|
||||
if ((uintptr_t)object_getClass(_protocol) == 0x2)
|
||||
{
|
||||
extern struct objc_method_description*
|
||||
GSDescriptionForInstanceMethod();
|
||||
|
@ -732,7 +732,7 @@ enum proxyLocation
|
|||
}
|
||||
if (mth == 0)
|
||||
{
|
||||
if ((uintptr_t)GSObjCClass(_protocol) == 0x2)
|
||||
if ((uintptr_t)object_getClass(_protocol) == 0x2)
|
||||
{
|
||||
extern struct objc_method_description*
|
||||
GSDescriptionForClassMethod();
|
||||
|
@ -878,7 +878,7 @@ static inline BOOL class_is_kind_of (Class self, Class aClassObject)
|
|||
{
|
||||
Class class;
|
||||
|
||||
for (class = self; class!=Nil; class = GSObjCSuper(class))
|
||||
for (class = self; class!=Nil; class = class_getSuperclass(class))
|
||||
if (class==aClassObject)
|
||||
return YES;
|
||||
return NO;
|
||||
|
@ -911,7 +911,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", GSNameFromSelector(aSel));
|
||||
NSLog(@"NSDistantObject forwarding %s\n", sel_getName(aSel));
|
||||
|
||||
if (![_connection isValid])
|
||||
[NSException
|
||||
|
|
|
@ -403,7 +403,7 @@ static NSStringEncoding defaultEncoding;
|
|||
lpath = [defaultManager fileSystemRepresentationWithPath: path];
|
||||
|
||||
#ifndef __MINGW32__
|
||||
if (GSObjCClass(attributes) == GSAttrDictionaryClass)
|
||||
if (object_getClass(attributes) == GSAttrDictionaryClass)
|
||||
{
|
||||
num = ((GSAttrDictionary*)attributes)->statbuf.st_uid;
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ static NSStringEncoding defaultEncoding;
|
|||
}
|
||||
}
|
||||
|
||||
if (GSObjCClass(attributes) == GSAttrDictionaryClass)
|
||||
if (object_getClass(attributes) == GSAttrDictionaryClass)
|
||||
{
|
||||
num = ((GSAttrDictionary*)attributes)->statbuf.st_gid;
|
||||
}
|
||||
|
|
|
@ -399,7 +399,7 @@ static NSIndexPath *dummy = nil;
|
|||
{
|
||||
return YES;
|
||||
}
|
||||
if (other == nil || GSObjCIsKindOf(GSObjCClass(other), myClass) == NO)
|
||||
if (other == nil || GSObjCIsKindOf(object_getClass(other), myClass) == NO)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
|
|
@ -653,8 +653,8 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
snprintf (buffer, 1024, "<%s %p selector: %s target: %s>", \
|
||||
GSClassNameFromObject(self), \
|
||||
self, \
|
||||
_selector ? GSNameFromSelector(_selector) : "nil", \
|
||||
_target ? GSNameFromClass([_target class]) : "nil" \
|
||||
_selector ? sel_getName(_selector) : "nil", \
|
||||
_target ? class_getName([_target class]) : "nil" \
|
||||
);
|
||||
|
||||
return [NSString stringWithUTF8String: buffer];
|
||||
|
@ -800,12 +800,12 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
if (types == 0)
|
||||
{
|
||||
types
|
||||
= sel_get_type(sel_get_any_typed_uid(GSNameFromSelector(aSelector)));
|
||||
= sel_get_type(sel_get_any_typed_uid(sel_getName(aSelector)));
|
||||
}
|
||||
if (types == 0)
|
||||
{
|
||||
NSLog(@"Couldn't find encoding type for selector %s.",
|
||||
GSNameFromSelector(aSelector));
|
||||
sel_getName(aSelector));
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ static inline void setup()
|
|||
|
||||
- (Class) class
|
||||
{
|
||||
return GSObjCSuper(GSObjCClass(self));
|
||||
return class_getSuperclass(object_getClass(self));
|
||||
}
|
||||
|
||||
- (void) setValue: (id)anObject forKey: (NSString*)aKey
|
||||
|
@ -299,7 +299,7 @@ static inline void setup()
|
|||
|
||||
- (Class) superclass
|
||||
{
|
||||
return GSObjCSuper(GSObjCSuper(GSObjCClass(self)));
|
||||
return class_getSuperclass(class_getSuperclass(object_getClass(self)));
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -309,7 +309,7 @@ static inline void setup()
|
|||
*/
|
||||
static NSString *newKey(SEL _cmd)
|
||||
{
|
||||
const char *name = GSNameFromSelector(_cmd);
|
||||
const char *name = sel_getName(_cmd);
|
||||
unsigned len = strlen(name);
|
||||
NSString *key;
|
||||
unsigned i;
|
||||
|
|
|
@ -69,7 +69,7 @@ NSString *
|
|||
NSStringFromSelector(SEL aSelector)
|
||||
{
|
||||
if (aSelector != (SEL)0)
|
||||
return [NSString stringWithUTF8String: GSNameFromSelector(aSelector)];
|
||||
return [NSString stringWithUTF8String: sel_getName(aSelector)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ NSClassFromString(NSString *aClassName)
|
|||
[aClassName getCString: buf
|
||||
maxLength: len + 1
|
||||
encoding: NSASCIIStringEncoding];
|
||||
return GSClassFromName (buf);
|
||||
return objc_lookUpClass (buf);
|
||||
}
|
||||
return (Class)0;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ NSString *
|
|||
NSStringFromClass(Class aClass)
|
||||
{
|
||||
if (aClass != (Class)0)
|
||||
return [NSString stringWithUTF8String: (char*)GSNameFromClass(aClass)];
|
||||
return [NSString stringWithUTF8String: (char*)class_getName(aClass)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
|
|
@ -570,7 +570,7 @@ NSAllocateObject(Class aClass, NSUInteger extraBytes, NSZone *zone)
|
|||
{
|
||||
new = NSZoneCalloc(zone, 1, size);
|
||||
NSLog(@"No garbage collection information for '%s'",
|
||||
GSNameFromClass(aClass));
|
||||
class_getName(aClass));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -603,7 +603,7 @@ NSDeallocateObject(id anObject)
|
|||
inline NSZone *
|
||||
GSObjCZone(NSObject *object)
|
||||
{
|
||||
if (GSObjCClass(object) == NSConstantStringClass)
|
||||
if (object_getClass(object) == NSConstantStringClass)
|
||||
return NSDefaultMallocZone();
|
||||
return ((obj)object)[-1].zone;
|
||||
}
|
||||
|
@ -723,7 +723,7 @@ GSDescriptionForInstanceMethod(pcl self, SEL aSel)
|
|||
{
|
||||
int i;
|
||||
struct objc_protocol_list *p_list;
|
||||
const char *name = GSNameFromSelector(aSel);
|
||||
const char *name = sel_getName(aSel);
|
||||
struct objc_method_description *result;
|
||||
|
||||
if (self->instance_methods != 0)
|
||||
|
@ -754,7 +754,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
|
|||
{
|
||||
int i;
|
||||
struct objc_protocol_list *p_list;
|
||||
const char *name = GSNameFromSelector(aSel);
|
||||
const char *name = sel_getName(aSel);
|
||||
struct objc_method_description *result;
|
||||
|
||||
if (self->class_methods != 0)
|
||||
|
@ -1299,7 +1299,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
*/
|
||||
+ (Class) superclass
|
||||
{
|
||||
return GSObjCSuper(self);
|
||||
return class_getSuperclass(self);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1307,7 +1307,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
*/
|
||||
- (Class) superclass
|
||||
{
|
||||
return GSObjCSuper(GSObjCClass(self));
|
||||
return class_getSuperclass(object_getClass(self));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1407,12 +1407,12 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
|
||||
/*
|
||||
* If 'self' is an instance, GSObjCClass() will get the class,
|
||||
* If 'self' is an instance, object_getClass() will get the class,
|
||||
* and get_imp() will get the instance method.
|
||||
* If 'self' is a class, GSObjCClass() will get the meta-class,
|
||||
* If 'self' is a class, object_getClass() will get the meta-class,
|
||||
* and get_imp() will get the class method.
|
||||
*/
|
||||
return get_imp(GSObjCClass(self), aSelector);
|
||||
return get_imp(object_getClass(self), aSelector);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1452,7 +1452,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
|
||||
|
||||
selTypes = sel_get_type(aSelector);
|
||||
c = (GSObjCIsInstance(self) ? GSObjCClass(self) : (Class)self);
|
||||
c = (GSObjCIsInstance(self) ? object_getClass(self) : (Class)self);
|
||||
mth = GSGetMethod(c, aSelector, GSObjCIsInstance(self), YES);
|
||||
|
||||
if (mth == 0)
|
||||
|
@ -1525,7 +1525,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
- (NSString*) description
|
||||
{
|
||||
return [NSString stringWithFormat: @"<%s: %p>",
|
||||
GSNameFromClass([self class]), self];
|
||||
class_getName([self class]), self];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1560,7 +1560,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
format: @"%s(%s) does not recognize %s",
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSelector ? GSNameFromSelector(aSelector) : "(null)"];
|
||||
aSelector ? sel_getName(aSelector) : "(null)"];
|
||||
}
|
||||
|
||||
- (retval_t) forward: (SEL)aSel : (arglist_t)argFrame
|
||||
|
@ -1750,7 +1750,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
*/
|
||||
- (BOOL) isKindOfClass: (Class)aClass
|
||||
{
|
||||
Class class = GSObjCClass(self);
|
||||
Class class = object_getClass(self);
|
||||
|
||||
return GSObjCIsKindOf(class, aClass);
|
||||
}
|
||||
|
@ -1768,7 +1768,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
*/
|
||||
- (BOOL) isMemberOfClass: (Class)aClass
|
||||
{
|
||||
return (GSObjCClass(self) == aClass) ? YES : NO;
|
||||
return (object_getClass(self) == aClass) ? YES : NO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1804,12 +1804,12 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
|
||||
|
||||
msg = get_imp(GSObjCClass(self), aSelector);
|
||||
msg = get_imp(object_getClass(self), aSelector);
|
||||
if (!msg)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector);
|
||||
|
@ -1829,12 +1829,12 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
|
||||
|
||||
msg = get_imp(GSObjCClass(self), aSelector);
|
||||
msg = get_imp(object_getClass(self), aSelector);
|
||||
if (!msg)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -1857,11 +1857,11 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
|
||||
|
||||
msg = get_imp(GSObjCClass(self), aSelector);
|
||||
msg = get_imp(object_getClass(self), aSelector);
|
||||
if (!msg)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s", GSNameFromSelector(_cmd)];
|
||||
format: @"invalid selector passed to %s", sel_getName(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -2165,7 +2165,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
format: @"%s(%s) does not recognize %s",
|
||||
GSClassNameFromObject(self),
|
||||
GSObjCIsInstance(self) ? "instance" : "class",
|
||||
aSel ? GSNameFromSelector(aSel) : "(null)"];
|
||||
aSel ? sel_getName(aSel) : "(null)"];
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
@ -2287,7 +2287,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
- (BOOL) isMemberOfClassNamed: (const char*)aClassName
|
||||
{
|
||||
return ((aClassName!=NULL)
|
||||
&&!strcmp(GSNameFromClass(GSObjCClass(self)), aClassName));
|
||||
&&!strcmp(class_getName(object_getClass(self)), aClassName));
|
||||
}
|
||||
|
||||
+ (struct objc_method_description *) descriptionForInstanceMethod: (SEL)aSel
|
||||
|
@ -2308,7 +2308,7 @@ objc_create_block_classes_as_subclasses_of(Class super) __attribute__((weak));
|
|||
|
||||
return ((struct objc_method_description *)
|
||||
GSGetMethod((GSObjCIsInstance(self)
|
||||
? GSObjCClass(self) : (Class)self),
|
||||
? object_getClass(self) : (Class)self),
|
||||
aSel,
|
||||
GSObjCIsInstance(self),
|
||||
YES));
|
||||
|
|
|
@ -597,8 +597,8 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
if (c == 0)
|
||||
{
|
||||
NSLog(@"[%s %s] decoded nil class",
|
||||
GSNameFromClass([self class]),
|
||||
GSNameFromSelector(_cmd));
|
||||
class_getName([self class]),
|
||||
sel_getName(_cmd));
|
||||
}
|
||||
obj = [c allocWithZone: _zone];
|
||||
GSIArrayAddItem(_objAry, (GSIArrayItem)obj);
|
||||
|
@ -712,7 +712,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
if (c == 0)
|
||||
{
|
||||
NSLog(@"[%s %s] decoded nil class",
|
||||
GSNameFromClass([self class]), GSNameFromSelector(_cmd));
|
||||
class_getName([self class]), sel_getName(_cmd));
|
||||
}
|
||||
classInfo = [GSClassInfo newWithClass: c andVersion: cver];
|
||||
GSIArrayAddItem(_clsAry, (GSIArrayItem)((id)classInfo));
|
||||
|
@ -1525,9 +1525,9 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
}
|
||||
while (done == NO)
|
||||
{
|
||||
int tmp = GSObjCVersion(c);
|
||||
int tmp = class_getVersion(c);
|
||||
unsigned version = tmp;
|
||||
Class s = GSObjCSuper(c);
|
||||
Class s = class_getSuperclass(c);
|
||||
|
||||
if (tmp < 0)
|
||||
{
|
||||
|
@ -2045,7 +2045,7 @@ static IMP _xRefImp; /* Serialize a crossref. */
|
|||
* use get_imp() because NSDistantObject doesn't implement
|
||||
* methodForSelector:
|
||||
*/
|
||||
proxyImp = get_imp(GSObjCClass((id)proxyClass),
|
||||
proxyImp = get_imp(object_getClass((id)proxyClass),
|
||||
@selector(proxyWithLocal:connection:));
|
||||
}
|
||||
|
||||
|
|
|
@ -2102,14 +2102,14 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
lastClass = NSStringClass;
|
||||
for (i = 0; i < numKeys; i++)
|
||||
{
|
||||
if (GSObjCClass(keys[i]) == lastClass)
|
||||
if (object_getClass(keys[i]) == lastClass)
|
||||
continue;
|
||||
if ([keys[i] isKindOfClass: NSStringClass] == NO)
|
||||
{
|
||||
canCompare = NO;
|
||||
break;
|
||||
}
|
||||
lastClass = GSObjCClass(keys[i]);
|
||||
lastClass = object_getClass(keys[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2149,7 +2149,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step,
|
|||
Class x;
|
||||
NSComparisonResult r;
|
||||
|
||||
x = GSObjCClass(a);
|
||||
x = object_getClass(a);
|
||||
if (x != lastClass)
|
||||
{
|
||||
lastClass = x;
|
||||
|
@ -2364,7 +2364,7 @@ GSPropertyListMake(id obj, NSDictionary *loc, BOOL xml,
|
|||
{
|
||||
*str = AUTORELEASE([GSMutableString new]);
|
||||
}
|
||||
else if (GSObjCClass(*str) != [GSMutableString class])
|
||||
else if (object_getClass(*str) != [GSMutableString class])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Illegal object (%@) at argument 0", *str];
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
*/
|
||||
if (GSObjCIsInstance(_myTarget))
|
||||
{
|
||||
if ((uintptr_t)GSObjCClass(_myProtocol) == 0x2)
|
||||
if ((uintptr_t)object_getClass(_myProtocol) == 0x2)
|
||||
{
|
||||
mth = GSDescriptionForInstanceMethod(_myProtocol, aSelector);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((uintptr_t)GSObjCClass(_myProtocol) == 0x2)
|
||||
if ((uintptr_t)object_getClass(_myProtocol) == 0x2)
|
||||
{
|
||||
mth = GSDescriptionForClassMethod(_myProtocol, aSelector);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@
|
|||
* signature of methodSignatureForSelector:, so we hack in
|
||||
* the signature required manually :-(
|
||||
*/
|
||||
if (sel_eq(aSelector, _cmd))
|
||||
if (sel_isEqual(aSelector, _cmd))
|
||||
{
|
||||
static NSMethodSignature *sig = nil;
|
||||
|
||||
|
@ -225,7 +225,7 @@
|
|||
return [NSMethodSignature signatureWithObjCTypes: types];
|
||||
}
|
||||
|
||||
c = GSObjCClass(self);
|
||||
c = object_getClass(self);
|
||||
mth = GSGetMethod(c, aSelector, YES, YES);
|
||||
if (mth == 0)
|
||||
{
|
||||
|
|
|
@ -142,7 +142,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@ null selector given", NSStringFromSelector(_cmd)];
|
||||
|
||||
return get_imp(GSObjCClass((id)self), aSelector);
|
||||
return get_imp(object_getClass((id)self), aSelector);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -209,7 +209,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
*/
|
||||
+ (Class) superclass
|
||||
{
|
||||
return GSObjCSuper(self);
|
||||
return class_getSuperclass(self);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -296,7 +296,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"NSProxy should not implement '%s'",
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -321,7 +321,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"subclass %s should override %s", GSClassNameFromObject(self),
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
- (id) notImplemented: (SEL)aSel
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"NSProxy notImplemented %s", GSNameFromSelector(aSel)];
|
||||
format: @"NSProxy notImplemented %s", sel_getName(aSel)];
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -402,7 +402,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
return nil;
|
||||
}
|
||||
mth = GSGetMethod(GSObjCClass(self), aSelector, YES, YES);
|
||||
mth = GSGetMethod(object_getClass(self), aSelector, YES, YES);
|
||||
if (mth != 0)
|
||||
{
|
||||
const char *types = mth->method_types;
|
||||
|
@ -425,7 +425,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector);
|
||||
|
@ -440,7 +440,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector, anObject);
|
||||
|
@ -456,7 +456,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"invalid selector passed to %s",
|
||||
GSNameFromSelector(_cmd)];
|
||||
sel_getName(_cmd)];
|
||||
return nil;
|
||||
}
|
||||
return (*msg)(self, aSelector, anObject, anotherObject);
|
||||
|
@ -496,7 +496,7 @@ extern BOOL __objc_responds_to(id, SEL);
|
|||
* use get_imp() because NSDistantObject doesn't implement
|
||||
* methodForSelector:
|
||||
*/
|
||||
proxyImp = get_imp(GSObjCClass((id)proxyClass),
|
||||
proxyImp = get_imp(object_getClass((id)proxyClass),
|
||||
@selector(proxyWithLocal:connection:));
|
||||
}
|
||||
|
||||
|
|
|
@ -309,7 +309,7 @@ static inline BOOL timerInvalidated(NSTimer *t)
|
|||
{
|
||||
GSTimedPerformer *p = array[count];
|
||||
|
||||
if (p->target == target && sel_eq(p->selector, aSelector)
|
||||
if (p->target == target && sel_isEqual(p->selector, aSelector)
|
||||
&& (p->argument == arg || [p->argument isEqual: arg]))
|
||||
{
|
||||
[p invalidate];
|
||||
|
@ -1384,7 +1384,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
|
|||
GSRunLoopPerformer *p;
|
||||
|
||||
p = GSIArrayItemAtIndex(performers, count).obj;
|
||||
if (p->target == target && sel_eq(p->selector, aSelector)
|
||||
if (p->target == target && sel_isEqual(p->selector, aSelector)
|
||||
&& (p->argument == argument || [p->argument isEqual: argument]))
|
||||
{
|
||||
GSIArrayRemoveItemAtIndex(performers, count);
|
||||
|
|
|
@ -202,7 +202,7 @@ typedef GSString *ivars;
|
|||
aString = @"";
|
||||
}
|
||||
|
||||
c = GSObjCClass(aString);
|
||||
c = object_getClass(aString);
|
||||
if (GSObjCIsKindOf(c, GSUnicodeStringClass) == YES)
|
||||
{
|
||||
_isUnicode = YES;
|
||||
|
|
|
@ -146,7 +146,7 @@ initSerializerInfo(_NSSerializerInfo* info, NSMutableData *d, BOOL u)
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(d);
|
||||
c = object_getClass(d);
|
||||
info->data = d;
|
||||
info->appImp = (void (*)(NSData*,SEL,const void*,unsigned))get_imp(c, appSel);
|
||||
info->datImp = (void* (*)(NSMutableData*,SEL))get_imp(c, datSel);
|
||||
|
@ -180,7 +180,7 @@ serializeToInfo(id object, _NSSerializerInfo* info)
|
|||
format: @"Class (%@) in property list - expected instance",
|
||||
[object description]];
|
||||
}
|
||||
c = GSObjCClass(object);
|
||||
c = object_getClass(object);
|
||||
|
||||
if (GSObjCIsKindOf(c, StringClass)
|
||||
/*
|
||||
|
|
|
@ -210,7 +210,7 @@ static Class NSMutableSet_concrete_class;
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSObjCClass(self);
|
||||
c = object_getClass(self);
|
||||
if (c == NSSet_abstract_class)
|
||||
{
|
||||
RELEASE(self);
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
|
||||
- (unsigned) hash
|
||||
{
|
||||
const char *sel = GSNameFromSelector(_selector);
|
||||
const char *sel = sel_getName(_selector);
|
||||
|
||||
return _ascending + GSPrivateHash(sel, strlen(sel), 16, YES) + [_key hash];
|
||||
}
|
||||
|
@ -136,7 +136,7 @@
|
|||
{
|
||||
return NO;
|
||||
}
|
||||
if (!sel_eq(((NSSortDescriptor*)other)->_selector, _selector))
|
||||
if (!sel_isEqual(((NSSortDescriptor*)other)->_selector, _selector))
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
|
|
@ -1962,7 +1962,7 @@ handle_printf_atsign (FILE *stream,
|
|||
}
|
||||
if (anObject != nil && GSObjCIsInstance(anObject) == YES)
|
||||
{
|
||||
Class c = GSObjCClass(anObject);
|
||||
Class c = object_getClass(anObject);
|
||||
|
||||
if (c != nil)
|
||||
{
|
||||
|
|
|
@ -744,7 +744,7 @@ static Class NSDataMallocClass;
|
|||
if (className == 0)
|
||||
{
|
||||
NSLog(@"[%s %s] decoded nil class name",
|
||||
GSNameFromClass([self class]), GSNameFromSelector(_cmd));
|
||||
class_getName([self class]), sel_getName(_cmd));
|
||||
className = @"_NSUnarchiverUnknownClass";
|
||||
}
|
||||
classInfo = [objDict objectForKey: className];
|
||||
|
@ -1230,7 +1230,7 @@ static Class NSDataMallocClass;
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSClassFromName([trueName cString]);
|
||||
c = objc_lookUpClass([trueName cString]);
|
||||
if (c == 0)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
@ -1282,7 +1282,7 @@ static Class NSDataMallocClass;
|
|||
{
|
||||
Class c;
|
||||
|
||||
c = GSClassFromName([trueName cString]);
|
||||
c = objc_lookUpClass([trueName cString]);
|
||||
if (c == 0)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
@ -1377,7 +1377,7 @@ static Class NSDataMallocClass;
|
|||
|
||||
TEST_RELEASE(data);
|
||||
data = RETAIN(anObject);
|
||||
c = GSObjCClass(data);
|
||||
c = object_getClass(data);
|
||||
if (src != self)
|
||||
{
|
||||
src = data;
|
||||
|
|
Loading…
Reference in a new issue