Mercurial > hg > CbC > old > device
diff mc-parse.c @ 420:efbd420386c5
non aligned bitfield (not yet finished)
author | kono |
---|---|
date | Thu, 28 Oct 2004 21:20:52 +0900 |
parents | 68fb244e0e3c |
children | fb136af3bf09 |
line wrap: on
line diff
--- a/mc-parse.c Wed Oct 27 09:04:07 2004 +0900 +++ b/mc-parse.c Thu Oct 28 21:20:52 2004 +0900 @@ -640,6 +640,7 @@ n=decl0(); reverse(t); if(n == &null_nptr) { + /* only bitfield allow null field name */ if (!(type>0&&car(type)==BIT_FIELD)) error(DCERR); } @@ -877,7 +878,8 @@ if (mode==GSDECL||mode==GUDECL||mode==LSDECL||mode==LUDECL) { if (scalar(type) || type==LONGLONG || type==ULONGLONG) { getsym(0); - type = list4(BIT_FIELD,type,0 /* bit offset */,symval); + type = list3(BIT_FIELD,type, + list3(type /*store type*/,0 /*bit offset*/,symval)); getsym(0); } } else @@ -2397,7 +2399,7 @@ return(list4(PREINC,e,dir,size_of_int)); if(type>0 && car(type)==BIT_FIELD) { e = list4(BPREINC,e,dir,type); - type = cadr(type); + type = cadr(type); /* value type */ return e; } if(car(type)!=POINTER) @@ -2561,7 +2563,7 @@ return(list4(POSTINC,e,dir,size_of_int)); if(type>0 && car(type)==BIT_FIELD) { e = list4(BPOSTINC,e,dir,type); - type = cadr(type); + type = cadr(type); /* value type */ return e; } if(car(type)!=POINTER)