On Sun, Feb 26, 2012 at 15:19, Jonas Maebe wrote:
>
> On 26 Feb 2012, at 14:16, ik wrote:
>
>> I'ved replaced it to
>>
>> iphdr = bitpacked record
>
> This is wrong. The record is a C record, and hence follows {$packrecord c}
> rules. "bitpacked record" overrides any current {$packrecords x} s
On 26 Feb 2012, at 14:16, ik wrote:
> I'ved replaced it to
>
> iphdr= bitpacked record
This is wrong. The record is a C record, and hence follows {$packrecord c}
rules. "bitpacked record" overrides any current {$packrecords x} setting. That
is the reason why I used the nested bitpacked re
On Sun, Feb 26, 2012 at 15:08, Jonas Maebe wrote:
>
> On 26 Feb 2012, at 13:54, ik wrote:
>
>> to the following Pascal record:
>>
>>
>> iphdr = record
>> {$IFDEF ENDIAN_LITTLE}
>> jhl : Cardinal; // __u8 ihl:4,
>> version : Cardinal; // version:4
>
> The ":4"
On 26 Feb 2012, at 13:54, ik wrote:
> to the following Pascal record:
>
>
> iphdr= record
> {$IFDEF ENDIAN_LITTLE}
> jhl : Cardinal; // __u8 ihl:4,
> version : Cardinal; // version:4
The ":4" in C means "4 bits", not 4 bytes. The correct translation in th
Hello,
I translated the following struct
struct iphdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
__u8ihl:4,
version:4;
#elif defined (__BIG_ENDIAN_BITFIELD)
__u8version:4,
ihl:4;
#else
#error "Please fix "
#endif
__u8tos;
_