• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Codewarrior ->Xcode port
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Codewarrior ->Xcode port (From: Bob Sabiston <email@hidden>)

  • Prev by Date: re: Creating Xcode templates
  • Next by Date: Re: XCode/xcodebuild problems...
  • Previous by thread: Re: Codewarrior ->Xcode port
  • Next by thread: Re: Codewarrior ->Xcode port
  • Index(es):
    • Date
    • Thread