0

What does this line of code mean:

    unsigned int                   :32       ;

It comes from:

      typedef struct avr32_pwm_channel_t {
      union {
              unsigned long                  cmr       ;//0x0000
              avr32_pwm_cmr_t                CMR       ;
      };
              unsigned long                  cdty      ;//0x0004
              unsigned long                  cprd      ;//0x0008
        const unsigned long                  ccnt      ;//0x000c
              unsigned long                  cupd      ;//0x0010
              unsigned int                   :32       ;//0x0014
              unsigned int                   :32       ;//0x0018
              unsigned int                   :32       ;//0x001c
    } avr32_pwm_channel_t;

I try googling it but found nothing

Ken Y-N
  • 14,644
  • 21
  • 71
  • 114
cloud em
  • 21
  • 6

1 Answers1

1

It's called bit-field. It determines the width of each memeber of the struct.

See https://en.wikipedia.org/wiki/Bit_field.

Ouss4
  • 479
  • 4
  • 11
  • how can we Distinguish those 3 members of the struct then ?? `unsigned int :32 ;//0x0014 unsigned int :32 ;//0x0018 unsigned int :32 ;//0x001c` since they have no names, can you please explain them more. – cloud em Apr 27 '16 at 01:11
  • Those are some padding bits. – Ouss4 Apr 27 '16 at 01:20
  • aha ... thank you also this link explains it better than the wiki http://publications.gbdirect.co.uk/c_book/chapter6/bitfields.html – cloud em Apr 27 '16 at 01:23