mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
47 lines
479 B
Plaintext
47 lines
479 B
Plaintext
module foo;
|
|
|
|
|
|
bitstruct BitField
|
|
{
|
|
int a : 3;
|
|
int b : 3;
|
|
int c : 2;
|
|
}
|
|
|
|
|
|
bitstruct BitField2 : byte
|
|
{
|
|
int a : 3;
|
|
int b : 3;
|
|
int c : 2;
|
|
}
|
|
|
|
struct Packet
|
|
{
|
|
bitstruct bitfield : int
|
|
{
|
|
int a : 3;
|
|
int b : 3;
|
|
int c : 2;
|
|
int pad : 24;
|
|
}
|
|
int packet_id;
|
|
}
|
|
|
|
bitstruct BitField3 : byte[3]
|
|
{
|
|
int a : 3;
|
|
int b : 6;
|
|
int c : 10;
|
|
int d : 5;
|
|
}
|
|
|
|
bitstruct BitField3 : byte[3] @aligned
|
|
{
|
|
int a : 3;
|
|
int b : 5;
|
|
int c : 8;
|
|
int d : 5;
|
|
void : 5;
|
|
}
|