Change direct references to the isa pointer to calls to object_getClass(). In

discussion with Steve Naroff (before he left Apple) it was decided that the isa
pointer should be regarded as an implementation detail and not part of the
language, so direct references to it are deprecated (on OS X).  This gives the
runtime a bit more freedom to do secret isa-swizzling tricks.

I've had these changes sitting in my copy for ages - no idea why they weren't
committed.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33111 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2011-05-25 11:19:09 +00:00
parent b644b71dd7
commit 00f5e41f60
3 changed files with 7 additions and 7 deletions

View file

@ -572,7 +572,7 @@ typedef struct _PathElement
// //
- (NSBezierPath *)bezierPathByFlatteningPath - (NSBezierPath *)bezierPathByFlatteningPath
{ {
NSBezierPath *path = [isa bezierPath]; NSBezierPath *path = [object_getClass(self) bezierPath];
NSBezierPathElement type; NSBezierPathElement type;
NSPoint pts[3]; NSPoint pts[3];
NSPoint coeff[4]; NSPoint coeff[4];
@ -631,7 +631,7 @@ typedef struct _PathElement
- (NSBezierPath *) bezierPathByReversingPath - (NSBezierPath *) bezierPathByReversingPath
{ {
NSBezierPath *path = [isa bezierPath]; NSBezierPath *path = [object_getClass(self) bezierPath];
NSBezierPathElement type, last_type; NSBezierPathElement type, last_type;
NSPoint pts[3]; NSPoint pts[3];
NSPoint p, cp1, cp2; NSPoint p, cp1, cp2;
@ -2073,7 +2073,7 @@ static NSPoint point_on_curve(double t, NSPoint a, NSPoint b, NSPoint c,
PathElement elem; PathElement elem;
int i, count; int i, count;
if (![aPath isKindOfClass: isa]) if (![aPath isKindOfClass: object_getClass(self)])
{ {
[super appendBezierPath: aPath]; [super appendBezierPath: aPath];
return; return;

View file

@ -85,7 +85,7 @@ globalFontMap.
-(BOOL) isEqual: (id)other -(BOOL) isEqual: (id)other
{ {
GSFontMapKey *o; GSFontMapKey *o;
if (![other isKindOfClass: isa]) if (![other isKindOfClass: object_getClass(self)])
return NO; return NO;
o = other; o = other;
if (hash != o->hash || screenFont != o->screenFont || role != o->role if (hash != o->hash || screenFont != o->screenFont || role != o->role
@ -925,7 +925,7 @@ static void setNSFont(NSString *key, NSFont *font)
{ {
if (anObject == self) if (anObject == self)
return YES; return YES;
if ([anObject isKindOfClass: self->isa] == NO) if ([anObject isKindOfClass: object_getClass(self)] == NO)
return NO; return NO;
if ([[anObject fontName] isEqual: fontName] == NO) if ([[anObject fontName] isEqual: fontName] == NO)
return NO; return NO;

View file

@ -125,7 +125,7 @@
if (anObject == self) if (anObject == self)
return NSOrderedSame; return NSOrderedSame;
if (anObject == nil || ([anObject isKindOfClass: self->isa] == NO)) if (anObject == nil || ([anObject isKindOfClass: object_getClass(self)] == NO))
return NSOrderedAscending; return NSOrderedAscending;
loc = ((NSTextTab*)anObject)->_location; loc = ((NSTextTab*)anObject)->_location;
if (_location < loc) if (_location < loc)
@ -148,7 +148,7 @@
{ {
if (anObject == self) if (anObject == self)
return YES; return YES;
if ([anObject isKindOfClass: self->isa] == NO) if ([anObject isKindOfClass: object_getClass(self)] == NO)
return NO; return NO;
else if (((NSTextTab*)anObject)->_tabStopType != _tabStopType) else if (((NSTextTab*)anObject)->_tabStopType != _tabStopType)
return NO; return NO;