Re: compiler warning
Re: compiler warning
- Subject: Re: compiler warning
- From: "Alastair J.Houghton" <email@hidden>
- Date: Tue, 5 Aug 2003 10:46:14 +0100
On Tuesday, August 5, 2003, at 07:55 am, Chuck Soper wrote:
I'm getting an "initialization discards qualifiers from pointer target
type" warning for this line of code:
NSPointArray myPoints = [myMutableData bytes];
If I send mutableBytes to my NSMutableData object then I don't get a
warning. Either way my application runs fine.
How can I avoid the warning from being generated? Thanks.
The reason is that NSData's -bytes method returns a const void *
pointer, but NSPointArray isn't const qualified. You should write:
const NSPoint *myPoints = (const NSPoint *)[myMutableData bytes];
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.