Skip to content

Commit

Permalink
Remove private concrete class access
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Sep 24, 2024
1 parent 24e65a2 commit 26e0e52
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Source/NSCalendarDate.m
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,11 @@ + (id) dateWithYear: (NSInteger)year
return AUTORELEASE(d);
}

- (NSTimeInterval) timeIntervalSinceReferenceDate
{
return _seconds_since_ref;
}

/**
* Creates and returns a new NSCalendarDate object by taking the
* value of the receiver and adding the interval in seconds specified.
Expand Down
2 changes: 1 addition & 1 deletion Source/NSDate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ - (NSDate*) laterDate: (NSDate*)otherDate
double selfTime;
if (otherDate == nil)
{
return NO;
return nil;
}

selfTime = [self timeIntervalSinceReferenceDate];
Expand Down
1 change: 1 addition & 0 deletions Source/NSDatePrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#if defined(OBJC_SMALL_OBJECT_SHIFT) && (OBJC_SMALL_OBJECT_SHIFT == 3)
#define USE_SMALL_DATE 1
// FIXME: Change to DATE_CONCRETE_CLASS_NAME
#define CONCRETE_CLASS_NAME GSSmallDate
#else
#define USE_SMALL_DATE 0
Expand Down
7 changes: 3 additions & 4 deletions Source/NSTimer.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@
#import "Foundation/NSRunLoop.h"
#import "Foundation/NSInvocation.h"

@class NSGDate;
@interface NSGDate : NSObject // Help the compiler
@end
#import "NSDatePrivate.h"

static Class NSDate_class;

/**
Expand All @@ -58,7 +57,7 @@ + (void) initialize
{
if (self == [NSTimer class])
{
NSDate_class = [NSGDate class];
NSDate_class = [CONCRETE_CLASS_NAME class];
}
}

Expand Down

0 comments on commit 26e0e52

Please sign in to comment.