DO patches from Frith-MacDonald

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2573 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 1997-10-28 14:37:53 +00:00
parent ca4fec83b0
commit 710599da68
3 changed files with 112 additions and 7 deletions

View file

@ -1,3 +1,89 @@
Tue Oct 28 10:05:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* src/NSData.m: Added [-replacementObjectForPortCoder:] method to
ensure that NSData objects are always sent bycopy.
* src/mframe.m: Modified mframe_do_call() and mframe_build_return()
to encode/decode a dummy integer value where a method returns void
but is NOT declared as being oneway.
Mon Oct 27 16:15:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Makefile: Added Tools subproject
* NSTimeZones/Makefile.postamble: Added distclean code to remove
time-zone files leaving only the tar image.
* Tools/Makefile: New make file added.
* Tools/Makefile.postamble: New file.
* Tools/Makefile.preamble: New file.
* Tools/gdomap.c: Moved from the src directory with some minor
bug fixes and easing of restrictions on deregistering a name.
* Tools/gdomap.h: Moved from the src directory with some minor
changes and improvements to comments.
* checks/Makefile.postamble: Added some stuff for distclean to
remove some fo the temporary data files.
* checks/Makefile.preamble: Modified to compile with -g flag
even if being linked with non-debug libraries.
* checks/nsdate.m: Added checks for new NSCalendarDate features.
* src/Coder.m: ([-initForReadingWithData:]) modified use of the
[-retainCount] method for newly corrected version.
* src/Makefile: Removed references to gdomap.[hc]
* src/Makefile.postamble: distclean now removes some automatically
generated source files.
* src/NSBundle.m: Removed own reference counting support in favour
of using the standard mechanism but intercepting [-release] to
change deallocation behaviour.
* src/NSCalendarDate.m: Implemented [-dayOfWeek], added support for
week day names (and abbreviations) in descriptions. Implemented
some missing formatting directives in descriptions, Fixed the
[-initWithYears:months:days:hours:minutes:seconds:timeZone:] method
to use the supplied time zone correctly.
Implemented [-dateByAddingYears:months:days:hours:minutes:seconds].
Implemented [-years:months:days:hours:minutes:seconds:sinceDate:].
* src/NSData.m: Fixed shared memory to only remove shared-memory IDs
from the system when the last object having mapped the memory is
deallocated.
* src/NSObject.m: ([-retainCount]) corrected to return the number of
times the object has been retained.
([-autorelease]) use [-retainCount] so that this works with classes
that have implemented their own retain./release/retainCount.
* src/NSProxy.m: Fixed retain counting scheme so that [-retainCount]
returns the correct value.
* src/NSRunLoop.m: ([-runMode:beforeDate:]) fixed possible problem
with passing a date obejct which might have been released unexpectedly.
* src/NotificationDispatcher.m: Fixed retain counting scheme so that
[-retainCount] returns the correct value.
* src/Proxy.m: Fixed retain counting scheme so that [-retainCount]
returns the correct value.
* src/TcpPort.m: Modified to expect to find gdomap in the Tools
directory of the new GNUstep directory standard.
* src/include/NSBundle.h: Removed unneeded retsain count variable.
* src/include/NSData.h: Conform to NSCoding protocol.
* src/include/NSDate.h: Added two OPENSTEP methods.
Fri Oct 24 14:36:23 1997 Adam Fedor <fedor@oc.com>
* Removed unused files.

View file

@ -361,6 +361,11 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len)
return;
}
- (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder
{
return self;
}
- (NSData*) subdataWithRange: (NSRange)aRange
{
void *buffer;

View file

@ -655,14 +655,19 @@ mframe_do_call (const char *encoded_types,
etmptype = objc_skip_type_qualifiers (encoded_types);
tmptype = objc_skip_type_qualifiers (type);
/* Only encode return values if there is a non-void return value, or
if there are values that were passed by reference. */
/* xxx Are my tests right? Do we also have to check _F_ONEWAY? */
/* Only encode return values if there is a non-void return value,
a non-oneway void return value, or if there are values that were
passed by reference. */
/* If there is a return value, encode it. */
switch (*tmptype)
{
case _C_VOID:
if ((flags & _F_ONEWAY) == 0)
{
int dummy = 0;
(*encoder) (-1, (void*)&dummy, @encode(int), 0);
}
/* No return value to encode; do nothing. */
break;
@ -904,7 +909,7 @@ mframe_build_return (arglist_t argframe,
/* Decode the return value and pass-by-reference values, if there
are any. OUT_PARAMETERS should be the value returned by
mframe_dissect_call(). */
if (out_parameters || *tmptype != _C_VOID)
if (out_parameters || *tmptype != _C_VOID || (flags & _F_ONEWAY) == 0)
/* xxx What happens with method declared "- (oneway) foo: (out int*)ip;" */
/* xxx What happens with method declared "- (in char *) bar;" */
/* xxx Is this right? Do we also have to check _F_ONEWAY? */
@ -913,10 +918,13 @@ mframe_build_return (arglist_t argframe,
value, not an argument. */
/* If there is a return value, decode it, and put it in retframe. */
if (*tmptype != _C_VOID)
if (*tmptype != _C_VOID || (flags & _F_ONEWAY) == 0)
{
/* Get the size of the returned value. */
retsize = objc_sizeof_type (tmptype);
if (*tmptype == _C_VOID)
retsize = sizeof(void*);
else
retsize = objc_sizeof_type (tmptype);
/* Allocate memory on the stack to hold the return value.
It should be at least 4 * sizeof(void*). */
/* xxx We need to test retsize's less than 4. Also note that
@ -969,6 +977,12 @@ mframe_build_return (arglist_t argframe,
(*decoder) (-1, ((char*)retframe), tmptype, flags);
break;
case _C_VOID:
{
(*decoder) (-1, retframe, @encode(int), 0);
}
break;
default:
/* (Among other things, _C_CHARPTR is handled here). */
/* Special case BOOL (and other types smaller than int)
@ -1055,7 +1069,7 @@ mframe_build_return (arglist_t argframe,
}
}
}
(*decoder) (0, 0, 0, 0); /* Tell it we have finished. */
(*decoder) (0, 0, 0, 0); /* Tell it we have finished. */
}
else /* matches `if (out_parameters)' */
{