Holger Schurig wrote:

struct bitstruct {
        int b : 1;
};

struct bitstruct b;

<snip>

That saves bytes and is very clear. It can be used whenever we transfer the struct over the wire, because the memory layout is not defined from compiler to compiler. But for program internal structs, this can be used quite nicely.

This does not save any bytes; this struct will still require 32 bits (four bytes) for storage (see the "int" specified there?).


It's really a toss-up as to whether to do it this way or the current way; the generated object code is pretty much identical. If it had been my decision I would have implemented it the way you suggest, but it was put into CVS before we got a chance to discuss it.
_______________________________________________
Asterisk-Dev mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-dev
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to