[riot-devel] C Bitfields and network_uint16_t
authmillenon at gmail.com
Sat Mar 21 22:14:50 CET 2015
you can use network_uint16_t as integer by accessing it's u16 member, but
since bitfields are usually accessed using bit-arithmetics anyways I'm
wondering if it makes so much sense to use network_uint16_t, since they are
primarily used to warn about byteorder issues.
2015-03-21 21:01 GMT+01:00 Simon <brummer.simon at googlemail.com>:
> Hi Everyone,
> I am trying to define the Header Datastructure for the new TCP
> implementation. I'd like to use C Bitfields in structs for the Control
> Bits and would like to use the Type of network_uint16_t (That seems to
> be common for most other Header Structures). My compiler tells me that
> thats not possible because network_uint16_t is not an integer type.
> In Byteorder.h it shows that its actually a union. Has anyone an Idea to
> solve this issue? I would really like to use only network types in my
> Thanks in advance.
> Yours sincerly
> Simon Brummer
> devel mailing list
> devel at riot-os.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel