Re: Codewarrior ->Xcode port
Re: Codewarrior ->Xcode port
- Subject: Re: Codewarrior ->Xcode port
- From: Eric Albert <email@hidden>
- Date: Tue, 10 May 2005 09:52:31 -0700
On May 10, 2005, at 7:52 AM, Bob Sabiston wrote:
I'm trying to port an application from Codewarrior to Xcode. I
think Xcode's compiler must be crazy strict, because I'm getting a lot
of errors like :
invalid conversion from 'const unsigned char' to 'unsigned char'
initializing argument 1 of void RedAlert(unsigned char)
Is there a setting on the compiler to allow such things? In this case
it's calling a function RedAlert:
void RedAlert(Str255 message) {
}
like this:
RedAlert("\pThis isn't working");
Here you're passing a const Str255 to a function that takes a Str255.
That's not a good thing. Declaring the argument as a Str255 means that
you can change it...but if you happen to change it here, you'll crash.
So the compiler's being helpful and telling you that you really, really
don't want to do this.
Assuming that RedAlert doesn't change message (and again, if it does,
you'll crash here, so it probably doesn't), change it to take a
ConstStr255Param instead of a Str255.
Hope this helps,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden