pass dates and time zones bycopy

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8955 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2001-01-31 05:58:59 +00:00
parent 39cfacf0f6
commit 2cf148585f
3 changed files with 19 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2001-01-31 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSDate.m: pass dates over DO bycopy unless explicitly byref.
* Source/NSTimeZone.m: pass time zones over DO bycopy unless
explicitly byref.
2001-01-30 Michael Hanni <mhanni@sprintmail.com>
* Source/.cvsignore: tweaked to cover a few more items.

View file

@ -34,6 +34,7 @@
#include <Foundation/NSCharacterSet.h>
#include <Foundation/NSScanner.h>
#include <Foundation/NSObjCRuntime.h>
#include <Foundation/NSPortCoder.h>
#include <base/preface.h>
#include <base/behavior.h>
#if HAVE_SYS_TIME_H
@ -880,11 +881,11 @@ GSTimeNow()
return abstractClass;
}
- (id) replacementObjectForPortCoder: (NSPortCoder*)aRmc
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder
{
/* Make sure that Connection's always send us bycopy,
i.e. as our own class, not a Proxy class. */
return self;
if ([aCoder isByref] == NO)
return self;
return [super replacementObjectForPortCoder: aCoder];
}
- (void) encodeWithCoder: (NSCoder*)coder

View file

@ -63,6 +63,7 @@
#include <Foundation/NSMapTable.h>
#include <Foundation/NSThread.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSPortCoder.h>
#define NOID
#include "tzfile.h"
@ -1109,6 +1110,13 @@ static NSMapTable *absolutes = 0;
return [self subclassResponsibility: _cmd];
}
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder
{
if ([aCoder isByref] == NO)
return self;
return [super replacementObjectForPortCoder: aCoder];
}
- (int) secondsFromGMT
{
return [self secondsFromGMTForDate: [NSDate date]];