- SPEC_VOLATILE (loop->etype) |= (su == UNION ? 1 : 0);
-
- /* if this is a bit field */
- if (loop->bitVar) {
-
- /* change it to a unsigned bit */
- SPEC_NOUN (loop->etype) = V_BITFIELD;
- /* ISO/IEC 9899 J.3.9 implementation defined behaviour: */
- /* a "plain" int bitfield is unsigned */
- if (!loop->etype->select.s.b_signed)
- SPEC_USIGN(loop->etype) = 1;
-
- SPEC_BLEN (loop->etype) = loop->bitVar;
-
- if (loop->bitVar == BITVAR_PAD) {
- /* A zero length bitfield forces padding */
- SPEC_BSTR (loop->etype) = bitOffset;
- SPEC_BLEN (loop->etype) = 0;
- bitOffset = 8;
- loop->offset = sum;
- }
- else {
- if (bitOffset == 8) {
- bitOffset = 0;
- sum++;
- }
- /* check if this fit into the remaining */
- /* bits of this byte else align it to the */
- /* next byte boundary */
- if (loop->bitVar <= (8 - bitOffset)) {
- /* fits into current byte */
- loop->offset = sum;
- SPEC_BSTR (loop->etype) = bitOffset;
- bitOffset += loop->bitVar;
- }
- else if (!bitOffset) {
- /* does not fit, but is already byte aligned */
- loop->offset = sum;
- SPEC_BSTR (loop->etype) = bitOffset;
- bitOffset += loop->bitVar;
- }
- else {
- if( TARGET_IS_PIC16 && getenv("PIC16_PACKED_BITFIELDS") ) {
- /* if PIC16 && enviroment variable is set, then
- * tightly pack bitfields, this means that when a
- * bitfield goes beyond byte alignment, do not
- * automatically start allocatint from next byte,
- * but also use the available bits first */
- fprintf(stderr, ": packing bitfields in structures\n");
- SPEC_BSTR (loop->etype) = bitOffset;
- bitOffset += loop->bitVar;
- loop->offset = (su == UNION ? sum = 0 : sum);
- } else {
- /* does not fit; need to realign first */
- sum++;
- loop->offset = (su == UNION ? sum = 0 : sum);
- bitOffset = 0;
- SPEC_BSTR (loop->etype) = bitOffset;
- bitOffset += loop->bitVar;
- }
- }
- while (bitOffset>8) {
- bitOffset -= 8;
- sum++;
- }
- }
+ /* check if this fit into the remaining */
+ /* bits of this byte else align it to the */
+ /* next byte boundary */
+ if (loop->bitVar <= (8 - bitOffset)) {
+ /* fits into current byte */
+ loop->offset = sum;
+ SPEC_BSTR (loop->etype) = bitOffset;
+ bitOffset += loop->bitVar;
+ }
+ else if (!bitOffset) {
+ /* does not fit, but is already byte aligned */
+ loop->offset = sum;
+ SPEC_BSTR (loop->etype) = bitOffset;
+ bitOffset += loop->bitVar;