bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableData -replaceBytesInRange:withBytes doesn't follow OpenStep


From: Richard Frith-Macdonald
Subject: Re: NSMutableData -replaceBytesInRange:withBytes doesn't follow OpenStep Specs
Date: Fri, 8 Jun 2001 12:15:27 +0100

On Friday, June 8, 2001, at 10:26 AM, Tom Koelman wrote:

I assume this was done on purpose, but nonetheless.
According to the OpenStep specs

- (void) replaceBytesInRange:(NSRange)aRange withBytes:(const void*)bytes raises an NSRangeException if aRange is not within the range of the receiver's data

When aRange would extend the receiver however, GNUstep's base library
adjusts the capacity of the NSMutableData.

While the OpenStep spec says that an exception is raised for a range outside the receivers range, the MacOS-X documentation changes that to say that the 'location' must be in the receivers range
and that the data is extended as necessary.

In this case, GNUstep goes with the newer MacOS-X spec, as it seems a more useful behavior.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]