Ethereal

Re: [ethereal-dev] ANSI bitfields
Google
 
Web Ethereal.com

Home | Introduction | Documentation | Lists | FAQ | Development | Wiki | Bugs

Ethereal-dev: February 1999


As Laurent Deniel said:
> 
> I think this is not a good solution. memcpy'ing the whole struct is 
> preferable to copying each field. We have just to correctly define a
> particular structure. For instance, if you define the igmp structure in
> such a way:
> {
> guint_8  igmp_type;
> guint_8  igmp_code;
> guint_16 igmp_cksum;
> guint_32 igmp_gaddr;
> }
> I don't know any modern C compiler that will do the wrong thing about
> alignment. We have just to define structures in a compiler-independent
> way and to handle any further endianness problem in the code itself rather
> than in the structure definition.

that sounds like a good thing to do, if there are no alignment problems.

--gilbert

-- 
Gilbert Ramirez                Voice:  +1 210 358 4032
Technical Services             Fax:    +1 210 358 1122
University Health System       San Antonio, Texas, USA


Powered by MHonArc 2.6.10