From f57005916ce4b3bf9a8dab4be186c1e336a1a04b Mon Sep 17 00:00:00 2001 From: CaS Date: Thu, 8 Aug 2002 19:25:17 +0000 Subject: [PATCH] Documentation tidyups git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14252 72102866-910b-0410-8b05-ffd578937521 --- Headers/gnustep/base/NSCalendarDate.h | 4 ++++ Headers/gnustep/base/NSDate.h | 11 ----------- Headers/gnustep/base/NSObject.h | 15 +++++++++------ Source/GNUmakefile | 1 + Source/NSCalendarDate.m | 14 +++++++++----- Source/NSDate.m | 13 +++++++++++++ 6 files changed, 36 insertions(+), 22 deletions(-) diff --git a/Headers/gnustep/base/NSCalendarDate.h b/Headers/gnustep/base/NSCalendarDate.h index ba6bc7d03..d3bb76095 100644 --- a/Headers/gnustep/base/NSCalendarDate.h +++ b/Headers/gnustep/base/NSCalendarDate.h @@ -134,4 +134,8 @@ sinceDate: (NSDate*)date; @end +#ifndef NO_GNUSTEP +NSTimeInterval GSTime(int d, int m, int y, int hh, int mm, int ss, int mil); +#endif + #endif /* __NSCalendarDate_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/gnustep/base/NSDate.h b/Headers/gnustep/base/NSDate.h index aa415c424..fa5badeb5 100644 --- a/Headers/gnustep/base/NSDate.h +++ b/Headers/gnustep/base/NSDate.h @@ -97,18 +97,7 @@ typedef double NSTimeInterval; @end #ifndef NO_GNUSTEP -/* -* Our concrete base class - NSCalendar date must share the ivar layout. -*/ -@interface NSGDate : NSDate -{ -@public - NSTimeInterval _seconds_since_ref; -} -@end - NSTimeInterval GSTimeNow(); /* Get time since reference date*/ -NSTimeInterval GSTime(int d, int m, int y, int hh, int mm, int ss, int mil); #endif #endif /* __NSDate_h_GNUSTEP_BASE_INCLUDE*/ diff --git a/Headers/gnustep/base/NSObject.h b/Headers/gnustep/base/NSObject.h index 9a25e33eb..5f93f0e12 100644 --- a/Headers/gnustep/base/NSObject.h +++ b/Headers/gnustep/base/NSObject.h @@ -387,13 +387,16 @@ GS_EXPORT NSRecursiveLock *gnustep_global_lock; * objective-c method if the receiver is not nil. */ #ifndef TEST_RETAIN -#define TEST_RETAIN(object) (object != nil ? [object retain] : nil) +#define TEST_RETAIN(object) ({\ +id __object = (id)(object); (__object != nil) ? [__object retain] : nil; }) #endif #ifndef TEST_RELEASE -#define TEST_RELEASE(object) ({ if (object) [object release]; }) +#define TEST_RELEASE(object) ({\ +id __object = (id)(object); if (__object != nil) [__object retain]; }) #endif #ifndef TEST_AUTORELEASE -#define TEST_AUTORELEASE(object) ({ if (object) [object autorelease]; }) +#define TEST_AUTORELEASE(object) ({\ +id __object = (id)(object); (__object != nil) ? [__object autorelease] : nil; }) #endif /* @@ -420,12 +423,12 @@ if (__value != __object) \ #endif /* - * ASSIGNCOPY(object,value) assignes a copy of the value to the object with - * and release operations. + * ASSIGNCOPY(object,value) assigns a copy of the value to the object + * with release of the original. */ #ifndef ASSIGNCOPY #define ASSIGNCOPY(object,value) ({\ -id __value = (value); \ +id __value = (id)(value); \ id __object = (id)(object); \ if (__value != __object) \ { \ diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 6ab5e4c77..9d998092b 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -368,6 +368,7 @@ DOCUMENT_NAME = Base Base_HEADER_FILES_DIR = $(HEADER_DIR) Base_AGSDOC_FILES = Base.gsdoc $(AUTOGSDOC_HEADERS) +Base_DOC_INSTALL_DIR = Developer Base_AGSDOC_FLAGS = \ -HeaderDirectory ../Headers/Foundation \ -Declared Foundation \ diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index 24b5c93b7..f4a880a0d 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -89,8 +89,10 @@ absoluteGregorianDay(int day, int month, int year) + (year - 1)/400); // ...plus prior years divisible by 400 } -/* - * External - so NSDate can use it. +/** + * Convert a broken out time specification into a time interval + * since the reference date.
+ * External - so NSDate and others can use it. */ NSTimeInterval GSTime(int day, int month, int year, int h, int m, int s, int mil) @@ -116,6 +118,8 @@ GSTime(int day, int month, int year, int h, int m, int s, int mil) @end +@class NSGDate; + @implementation NSCalendarDate + (void) initialize @@ -127,9 +131,9 @@ GSTime(int day, int month, int year, int h, int m, int s, int mil) } } -// -// Getting an NSCalendar Date -// +/** + * Getting an NSCalendar Date + */ + (id) calendarDate { id d = [[self alloc] init]; diff --git a/Source/NSDate.m b/Source/NSDate.m index 17e61a1e7..6f88fd3d0 100644 --- a/Source/NSDate.m +++ b/Source/NSDate.m @@ -71,6 +71,16 @@ static Class abstractClass = nil; static Class concreteClass = nil; static Class calendarClass = nil; +/** + * Our concrete base class - NSCalendar date must share the ivar layout. + */ +@interface NSGDate : NSDate +{ +@public + NSTimeInterval _seconds_since_ref; +} +@end + @interface GSDateSingle : NSGDate @end @@ -117,6 +127,9 @@ otherTime(NSDate* other) return [other timeIntervalSinceReferenceDate]; } +/** + * Returns the current time (seconds since reference date) as an NSTimeInterval. + */ NSTimeInterval GSTimeNow() {