• 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: Carbon Boolean
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Carbon Boolean


  • Subject: Re: Carbon Boolean
  • From: Graham Cox <email@hidden>
  • Date: Fri, 12 Jun 2009 02:26:00 +1000


On 12/06/2009, at 2:12 AM, Matt Neuburg wrote:

What is a (Carbon) Boolean and how do I convert it to a Cocoa BOOL
(regardless of architecture)? Thx - m.

A Boolean is an unsigned char and a BOOL is a signed char. Since both define false as 0 and true as !0, you can simply cast one to the other. The ISA doesn't make any difference because it's a single byte.


--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Carbon Boolean (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: program crashes because of a variable declaration
  • Next by Date: Re: Carbon Boolean
  • Previous by thread: Carbon Boolean
  • Next by thread: Re: Carbon Boolean
  • Index(es):
    • Date
    • Thread