[fpc-pascal] Converting C's bit field struct

leledumbo leledumbo_cool at yahoo.co.id
Fri Aug 15 14:23:09 CEST 2008


Tried Vinzent solution and it works :clap:!
The layout is I think the same as in C. The difference is that FPC generates
it as

resb 4

while C uses

.comm 16

I don't know what .comm for. But since everything runs fine, who cares?
I just have some issues where assignment to the fields using pointer to that
type (^page_t) doesn't work. For instance:

var
  P: PPage; // the type is named TPage
...
with P^ do begin
  Present:=true;
  ReadWrite:=false;
  UserMode:=true;
  Frame:=FrameStack[FrameStackTop];
end;

When I check the value of each field, it's all ZERO! But the pointer isn't
nil. I guess the problem lies in my OS, but I'll do a re-check.
-- 
View this message in context: http://www.nabble.com/Converting-C%27s-bit-field-struct-tp18959002p18997771.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.




More information about the fpc-pascal mailing list