Results 1 to 3 of 3

Thread: The type for XAboolean

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    14

    The type for XAboolean

    In OpenMaxAL.h the typedef for XAboolean is given as XAint32 which is a 32-bit signed number. But standard C says that the Boolean type is unsigned and has the lowest ranking in its category of standard unsigned integer types. In simple assignments, if the left operand is a Boolean type, then the right operand must be either an arithmetic type or a pointer. An object declared as a Boolean type uses 1 byte of storage space, which is large enough to hold the values 0 or 1.
    Why we should have 32-bits allocated for a boolean type? Also to store 0 or 1 shouldn't that be unsigned ?

  2. #2
    Junior Member
    Join Date
    Sep 2007
    Posts
    4

    Re: The type for XAboolean

    Thank you for the feedback. The header declaration as XAint32 is typographical error. It should be XAuint8. The headers will be corrected.

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    14

    Re: The type for XAboolean

    I guess if it is made as 8-bit now , holes will be created in many of the structures. This will be a problem especially when we have not used sizeof() operator (eg:- due MISRA-C Rules) in our codes and we have codes where the size of structure is manually calculated.
    So it will be better to leave it as 32-bit but as unsigned (XAuint32)

Similar Threads

  1. I want to know the type of this effect.
    By balladry in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 01-20-2013, 01:20 PM
  2. Complex type
    By moonlai in forum OpenCL
    Replies: 1
    Last Post: 01-04-2010, 12:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •