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 2001-01-31 05:58:59 +00:00
parent 9b52e0838d
commit 53ccfd10ab
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> 2001-01-30 Michael Hanni <mhanni@sprintmail.com>
* Source/.cvsignore: tweaked to cover a few more items. * Source/.cvsignore: tweaked to cover a few more items.

View file

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

View file

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