int size
, align
, mask
, nelt
;
for(p
= s
->strdesc
; p
; p
= p
->nextp
)
dclerr("attempt to give storage class to mos",
if(q
->vtype
== TYUNDEFINED
)
sizalign(q
, &size
, &align
, &mask
);
s
->strsize
= evenoff(s
->strsize
, align
);
q
->voffset
= mkint(s
->strsize
);
for(t
= t
->datap
; t
; t
= t
->nextp
)
if(t
->upperb
== 0) continue;
n
-= conval(t
->lowerb
)-1;
if(q
->vtype
==TYFIELD
&& q
->vdim
==0 &&
(n
=conval(q
->vtypep
->frange
))*rshift
<=fieldmax
&& rshift
>0)
prevp
->vtypep
->fanymore
= 1;
q
->vtypep
->frshift
= mkint( (int) rshift
);
q
->voffset
= mkint(s
->strsize
- tailor
.ftnsize
[FTNINT
]);
if(q
->vdim
!=0 && q
->vtype
==TYFIELD
)
rshift
= (q
->vtype
==TYFIELD
? n
: 0);
s
->strsize
+= nelt
* evenoff(size
,align
);
s
->stralign
= lcm(s
->stralign
, align
);
if( (ab
= a
*b
) == 0) return(0);
if(p
->tag
!=TNAME
&& p
->tag
!=TTEMP
&& p
->tag
!=TFTNBLOCK
)
badtag("sizalign", p
->tag
);
*s
= tailor
.ftnsize
[FTNDCOMPLEX
];
*s
= 2*tailor
.ftnsize
[k
];
*a
= p
->vtypep
->stralign
;
*m
= p
->vtypep
->basetypes
;
*s
= tailor
.ftnsize
[FTNINT
] *
ceil(conval(p
->vtypep
), tailor
.ftnchwd
);
*a
= tailor
.ftnalign
[FTNINT
];
dclerr("subroutine name as variable", p
->sthead
->namep
);
fatal1("sizalign: invalid type %d", t
);
evenoff(a
,b
) /* round a up to a multiple of b */
ptr
esizeof(type
, typep
, dim
)
k
= tailor
.ftnsize
[ eflftn
[type
] ];
k
= tailor
.ftnsize
[FTNINT
] * ceil(conval(typep
), tailor
.ftnchwd
);
exprerr("invalid sizeof", "");
/* debug version. should multiply by dimension */
ptr
elenof(type
, typep
, dim
)
return( mkint( conval(typep
) ) );
exprerr("invalid lengthof", "");
/* debug version. should multiply by dimension */