excuse me. that's what hjdicks was for .. and it's called pack. ok.
abuse them or yourselfs for using such code.
brucee
On Dec 22, 2007 11:20 AM, erik quanstrom <[EMAIL PROTECTED]> wrote:
> > but it doesn't have to be. this is legit:
> >
> > typedef struct{
> > Ehdr; // 1
> > Ehdr; // 2
> > uchar op[2];
> > }Pkt;
>
> my explinations stink. perhaps this gets at what
> i'm saying better. the structure S0 won't have
> any padding, yet the two calls to frobehdr are
> just fine. i'm not sure i see the alignment problem
> that requires padding all unnamed structures.
>
> typedef struct{
> uchar s[6];
> uchar d[6];
> uchar t[2]
> }Ehdr;
>
> frobehdr(Ehdr*)
>
> typedef struct{
> uchar s0[6];
> uchar d0[6];
> uchar t0[2]
> uchar s1[6];
> uchar d1[6];
> uchar t1[2]
> }S0;
>
> void
> thunk0(void)
> {
> S0 *s;
> frobehdr((Ehdr*)s->s0);
> frobehdr((Ehdr*)s->s1);
> }
>
>
> - erik
>