|
|
1.1 ! root 1: *** /tmp/,RCSt1a13342 Tue Nov 7 13:12:12 1989 ! 2: --- /tmp/,RCSt2a13342 Tue Nov 7 13:12:14 1989 ! 3: *************** ! 4: *** 2,8 **** ! 5: /*ident "@(#)ctrans:src/dcl2.c 1.3.4.21" */ ! 6: /* ! 7: $Source: /usr3/lang/benson/work/stripped_cfront/O/RCS/dcl2.c,v $ $RCSfile: dcl2.c,v $ ! 8: ! $Revision: 1.13 $ $Date: 89/10/20 14:27:49 $ ! 9: $Author: benson $ $Locker: $ ! 10: $State: Exp $ ! 11: */ ! 12: --- 2,8 ---- ! 13: /*ident "@(#)ctrans:src/dcl2.c 1.3.4.21" */ ! 14: /* ! 15: $Source: /usr3/lang/benson/work/stripped_cfront/O/RCS/dcl2.c,v $ $RCSfile: dcl2.c,v $ ! 16: ! $Revision: 1.14 $ $Date: 89/10/26 16:49:46 $ ! 17: $Author: benson $ $Locker: $ ! 18: $State: Exp $ ! 19: */ ! 20: *************** ! 21: *** 1221,1226 **** ! 22: --- 1221,1228 ---- ! 23: d = 0; ! 24: } ! 25: ! 26: + extern int ZB_BOUNDARY; ! 27: + ! 28: void ! 29: name::field_align() ! 30: /* ! 31: *************** ! 32: *** 1229,1250 **** ! 33: { ! 34: Pbase fld = (Pbase) tp; ! 35: ! 36: ! int a = (F_SENSITIVE) ? fld->b_fieldtype->align() : SZ_WORD; ! 37: if (max_align < a) ! 38: max_align = a; ! 39: ! 40: if (fld->b_bits == 0) { /* # force word alignment # */ ! 41: int b; ! 42: ! if (bit_offset) ! 43: ! fld->b_bits = BI_IN_WORD - bit_offset; ! 44: ! else if (b = byte_offset % SZ_WORD) ! 45: fld->b_bits = b * BI_IN_BYTE; ! 46: /* # else # */ ! 47: /* # fld->b_bits = BI_IN_WORD; # */ ! 48: ! if (max_align < SZ_WORD) ! 49: ! max_align = SZ_WORD; ! 50: } else if (bit_offset == 0) { /* # take care of part of word # */ ! 51: ! int b = byte_offset % SZ_WORD; ! 52: if (b) { ! 53: byte_offset -= b; ! 54: bit_offset = b * BI_IN_BYTE; ! 55: --- 1231,1253 ---- ! 56: { ! 57: Pbase fld = (Pbase) tp; ! 58: ! 59: ! int a; ! 60: ! a = (F_SENSITIVE) ? fld->b_fieldtype->align() : ZB_BOUNDARY; ! 61: if (max_align < a) ! 62: max_align = a; ! 63: ! 64: if (fld->b_bits == 0) { /* # force word alignment # */ ! 65: int b; ! 66: ! if (bit_offset && bit_offset != ZB_BOUNDARY * BI_IN_BYTE) ! 67: ! fld->b_bits = (BI_IN_BYTE * ZB_BOUNDARY) - bit_offset; ! 68: ! else if (b = byte_offset % ZB_BOUNDARY) ! 69: fld->b_bits = b * BI_IN_BYTE; ! 70: /* # else # */ ! 71: /* # fld->b_bits = BI_IN_WORD; # */ ! 72: ! if (max_align < ZB_BOUNDARY) ! 73: ! max_align = ZB_BOUNDARY; ! 74: } else if (bit_offset == 0) { /* # take care of part of word # */ ! 75: ! int b = byte_offset % ZB_BOUNDARY; ! 76: if (b) { ! 77: byte_offset -= b; ! 78: bit_offset = b * BI_IN_BYTE; ! 79: *************** ! 80: *** 1252,1257 **** ! 81: --- 1255,1261 ---- ! 82: } ! 83: /*#error('d',"byteoff %d bitoff %d bits %d",byte_offset,bit_offset,fld->b_bits); #*/ ! 84: int x = (bit_offset += fld->b_bits); ! 85: + ! 86: if (BI_IN_WORD < x) { ! 87: fld->b_offset = 0; ! 88: byte_offset += SZ_WORD; ! 89: *************** ! 90: *** 1266,1276 **** ! 91: } ! 92: n_offset = byte_offset; ! 93: } ! 94: - static char rcsinfo[] = "$Header: /usr3/lang/benson/work/stripped_cfront/O/RCS/dcl2.c,v 1.13 89/10/20 14:27:49 benson Exp $"; ! 95: ! 96: ! 97: ! 98: /* $Log: dcl2.c,v $ ! 99: * Revision 1.13 89/10/20 14:27:49 benson ! 100: * fixes to go with the error signalling stuff. ! 101: * ! 102: --- 1270,1287 ---- ! 103: } ! 104: n_offset = byte_offset; ! 105: } ! 106: ! 107: + static char rcsinfo[] = "$Header: /usr3/lang/benson/work/stripped_cfront/O/RCS/dcl2.c,v 1.14 89/10/26 16:49:46 benson Exp $"; ! 108: ! 109: ! 110: + ! 111: /* $Log: dcl2.c,v $ ! 112: + * Revision 1.14 89/10/26 16:49:46 benson ! 113: + * fix bit offset layout. On the 68K (at least on a sun) ! 114: + * the "word" for the purposes of bitfields is 32 bits, but ! 115: + * it can begin on a 16 bit boundary. See size.c/h for the ! 116: + * new size parameter, ZB_BOUNDARY. ! 117: + * ! 118: * Revision 1.13 89/10/20 14:27:49 benson ! 119: * fixes to go with the error signalling stuff. ! 120: *
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.