From 00f5e41f60d5e95792df74b86ce80ba527cd11c6 Mon Sep 17 00:00:00 2001 From: theraven Date: Wed, 25 May 2011 11:19:09 +0000 Subject: [PATCH] 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 --- Source/NSBezierPath.m | 6 +++--- Source/NSFont.m | 4 ++-- Source/NSParagraphStyle.m | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/NSBezierPath.m b/Source/NSBezierPath.m index 4334e00b1..6fb3174b2 100644 --- a/Source/NSBezierPath.m +++ b/Source/NSBezierPath.m @@ -572,7 +572,7 @@ typedef struct _PathElement // - (NSBezierPath *)bezierPathByFlatteningPath { - NSBezierPath *path = [isa bezierPath]; + NSBezierPath *path = [object_getClass(self) bezierPath]; NSBezierPathElement type; NSPoint pts[3]; NSPoint coeff[4]; @@ -631,7 +631,7 @@ typedef struct _PathElement - (NSBezierPath *) bezierPathByReversingPath { - NSBezierPath *path = [isa bezierPath]; + NSBezierPath *path = [object_getClass(self) bezierPath]; NSBezierPathElement type, last_type; NSPoint pts[3]; NSPoint p, cp1, cp2; @@ -2073,7 +2073,7 @@ static NSPoint point_on_curve(double t, NSPoint a, NSPoint b, NSPoint c, PathElement elem; int i, count; - if (![aPath isKindOfClass: isa]) + if (![aPath isKindOfClass: object_getClass(self)]) { [super appendBezierPath: aPath]; return; diff --git a/Source/NSFont.m b/Source/NSFont.m index 7fb5d2f22..7242ac1bf 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -85,7 +85,7 @@ globalFontMap. -(BOOL) isEqual: (id)other { GSFontMapKey *o; - if (![other isKindOfClass: isa]) + if (![other isKindOfClass: object_getClass(self)]) return NO; o = other; if (hash != o->hash || screenFont != o->screenFont || role != o->role @@ -925,7 +925,7 @@ static void setNSFont(NSString *key, NSFont *font) { if (anObject == self) return YES; - if ([anObject isKindOfClass: self->isa] == NO) + if ([anObject isKindOfClass: object_getClass(self)] == NO) return NO; if ([[anObject fontName] isEqual: fontName] == NO) return NO; diff --git a/Source/NSParagraphStyle.m b/Source/NSParagraphStyle.m index 0f82f1c59..406685893 100644 --- a/Source/NSParagraphStyle.m +++ b/Source/NSParagraphStyle.m @@ -125,7 +125,7 @@ if (anObject == self) return NSOrderedSame; - if (anObject == nil || ([anObject isKindOfClass: self->isa] == NO)) + if (anObject == nil || ([anObject isKindOfClass: object_getClass(self)] == NO)) return NSOrderedAscending; loc = ((NSTextTab*)anObject)->_location; if (_location < loc) @@ -148,7 +148,7 @@ { if (anObject == self) return YES; - if ([anObject isKindOfClass: self->isa] == NO) + if ([anObject isKindOfClass: object_getClass(self)] == NO) return NO; else if (((NSTextTab*)anObject)->_tabStopType != _tabStopType) return NO;