[PATCH] dri2: Initialize padding in DRI2GetBuffers reply

Pauli Nieminen ext-pauli.nieminen at nokia.com
Wed Mar 2 03:41:25 PST 2011


On 02/03/11 11:37 +0000, ext Daniel Stone wrote:
> Hi,
> 
> On Wed, Feb 23, 2011 at 07:01:04PM +0200, Pauli wrote:
> > diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
> > index 4e48e65..725823e 100644
> > --- a/hw/xfree86/dri2/dri2ext.c
> > +++ b/hw/xfree86/dri2/dri2ext.c
> > @@ -227,11 +227,15 @@ send_buffers_reply(ClientPtr client, DrawablePtr pDrawable,
> >      }
> >  
> >      rep.type = X_Reply;
> > +    rep.pad1 = 0;
> >      rep.length = (count - skip) * sizeof(xDRI2Buffer) / 4;
> >      rep.sequenceNumber = client->sequence;
> >      rep.width = width;
> >      rep.height = height;
> >      rep.count = count - skip;
> > +    rep.pad2 = 0;
> > +    rep.pad3 = 0;
> > +    rep.pad4 = 0;
> >      WriteToClient(client, sizeof(xDRI2GetBuffersReply), &rep);
> >  
> >      for (i = 0; i < count; i++) {
> 
> Why not just memset(&rep, 0, sizeof(rep)) before you start filling it
> in?

I tough using C99 named initializer but then I remembered opposition against
using 11 years old standard features. But I guess memset would be option too.

> 
> Cheers,
> Daniel




More information about the xorg-devel mailing list