[Xcb] [PATCH lib] c_client.py: Do not create pointers in unions
Ran Benita
ran234 at gmail.com
Wed Aug 7 00:24:33 PDT 2013
On Tue, Aug 06, 2013 at 07:26:54PM +0200, Daniel Martin wrote:
> On Tue, Aug 06, 2013 at 01:22:21PM +0300, Ran Benita wrote:
> > On Tue, Aug 06, 2013 at 01:18:13PM +0300, Ran Benita wrote:
> > > On Fri, Dec 28, 2012 at 11:40:29PM +0100, Daniel Martin wrote:
> > > > Do not create pointers in unions for fields of variadic length.
> > > >
> > > > Signed-off-by: Daniel Martin <consume.noise at gmail.com>
> > > > ---
> > > >
> > > > With this patch xcb_xkb_doodad_t in xkb.h will change:
> > > >
> > > > typedef union xcb_xkb_doodad_t {
> > > > xcb_xkb_common_doodad_t common; /**< */
> > > > xcb_xkb_shape_doodad_t shape; /**< */
> > > > - xcb_xkb_text_doodad_t *text; /**< */
> > > > + xcb_xkb_text_doodad_t text; /**< */
> > > > xcb_xkb_indicator_doodad_t indicator; /**< */
> > > > - xcb_xkb_logo_doodad_t *logo; /**< */
> > > > + xcb_xkb_logo_doodad_t logo; /**< */
> > > > } xcb_xkb_doodad_t;
> > >
> > > This changes sizeof(xcb_xkb_doodad_t) from 20 to 24, which is incorrect.
> > > It should be the same as sizeof(xkbDoodadWireDesc) from
> > > X11/extensions/XKBproto.h, which is 20.
>
> I didn't checked the size prior. Now, I did. Are you sure you've build
> against the header with that change? For me it's the other way around
> (with pointers = 24, without = 20).
You are right, it was actually wrong before. It's impossible to test
currently, but
Reviewed-By: Ran Benita <ran234 at gmail.com>
More information about the Xcb
mailing list