#include <stdio.h>
#include <stdbool.h>
struct test{
bool opaque : 1;
unsigned int fill_color : 3;
unsigned int : 4;
bool show_border : 1;
unsigned int border_color : 3;
unsigned int border_style : 2;
unsigned int : 2;
};
int main(void)
{
struct test Test = {0};
int i;
printf("%zu\n", sizeof(Test
));
unsigned char* p;
p = (unsigned char*)&Test;
for(i=0; i<sizeof(Test); ++i)
{
++p;
}
Test.opaque = true;
p = (unsigned char*)&Test;
for(i=0; i<sizeof(Test); ++i)
{
++p;
}
Test.fill_color = 3;
p = (unsigned char*)&Test;
for(i=0; i<sizeof(Test); ++i)
{
++p;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRib29sLmg+CgpzdHJ1Y3QgdGVzdHsKCiAgICAgICBib29sIG9wYXF1ZSAgICAgICAgICAgICAgICAgOiAxOwogICAgICAgdW5zaWduZWQgaW50IGZpbGxfY29sb3IgICAgIDogMzsKICAgICAgIHVuc2lnbmVkIGludCAgICAgICAgICAgICAgICA6IDQ7CiAgICAgICBib29sIHNob3dfYm9yZGVyICAgICAgICAgICAgOiAxOwogICAgICAgdW5zaWduZWQgaW50IGJvcmRlcl9jb2xvciAgIDogMzsKICAgICAgIHVuc2lnbmVkIGludCBib3JkZXJfc3R5bGUgICA6IDI7CiAgICAgICB1bnNpZ25lZCBpbnQgICAgICAgICAgICAgICAgOiAyOwp9OwoKCmludCBtYWluKHZvaWQpCnsKICBzdHJ1Y3QgdGVzdCBUZXN0ID0gezB9OwogIGludCBpOwogIHByaW50ZigiJXp1XG4iLCBzaXplb2YoVGVzdCkpOwoKICB1bnNpZ25lZCBjaGFyKiBwOwogIHAgPSAodW5zaWduZWQgY2hhciopJlRlc3Q7CiAgZm9yKGk9MDsgaTxzaXplb2YoVGVzdCk7ICsraSkKICB7CiAgICBwcmludGYoIiUwMngiLCAqcCk7CiAgICArK3A7CiAgfQogIHByaW50ZigiXG4iKTsKCiAgVGVzdC5vcGFxdWUgPSB0cnVlOwoKICBwID0gKHVuc2lnbmVkIGNoYXIqKSZUZXN0OwogIGZvcihpPTA7IGk8c2l6ZW9mKFRlc3QpOyArK2kpCiAgewogICAgcHJpbnRmKCIlMDJ4IiwgKnApOwogICAgKytwOwogIH0KICBwcmludGYoIlxuIik7CgogIFRlc3QuZmlsbF9jb2xvciA9IDM7CgogIHAgPSAodW5zaWduZWQgY2hhciopJlRlc3Q7CiAgZm9yKGk9MDsgaTxzaXplb2YoVGVzdCk7ICsraSkKICB7CiAgICBwcmludGYoIiUwMngiLCAqcCk7CiAgICArK3A7CiAgfQogIHByaW50ZigiXG4iKTsKCiAgcmV0dXJuIDA7Cn0K