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

leledumbo leledumbo_cool at yahoo.co.id
Wed Aug 13 12:34:44 CEST 2008


Since no one answers on message board, I'll post it here.

C struct:

typedef unsigned int u32int;

typedef struct page
{
   u32int present    : 1;   // Page present in memory
   u32int rw         : 1;   // Read-only if clear, readwrite if set
   u32int user       : 1;   // Supervisor level only if clear
   u32int accessed   : 1;   // Has the page been accessed since last
refresh?
   u32int dirty      : 1;   // Has the page been written to since last
refresh?
   u32int unused     : 7;   // Amalgamation of unused and reserved bits
   u32int frame      : 20;  // Frame address (shifted right 12 bits)
} page_t;

Pascal record please...
-- 
View this message in context: http://www.nabble.com/Converting-C%27s-bit-field-struct-tp18959002p18959002.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.




More information about the fpc-pascal mailing list