[PATCH joystick 1/9] Replace LocalDevicePtr with InputInfoPtr

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 15 17:48:47 PST 2010


On Wed, Dec 15, 2010 at 07:56:19AM -0500, Trevor Woerner wrote:
> On Tue, Dec 14, 2010 at 9:58 PM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> > Both typedefs describe the same struct, LocalDevicePtr has been removed with
> > input ABI 12.
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> > @@ -513,35 +513,35 @@ _X_EXPORT InputDriverRec JSTK_KEYBOARD = {
> >  static InputInfoPtr
> >  jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
> >  {
> > -    LocalDevicePtr      local = NULL;
> > +    InputInfoPtr      pInfo = NULL;
> >     JoystickDevPtr      priv = NULL;
> >     char                *s;
> >     int                 i, j;
> 
> Maybe the above declaration could be kept aligned in the same way as
> the other variables?

amended, thanks.

> 
> > @@ -710,22 +710,22 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
> >     }
> >
> >     /* return the LocalDevice */
> > -    local->flags |= XI86_CONFIGURED;
> > +    pInfo->flags |= XI86_CONFIGURED;
> >
> >     priv->keyboard_device = jstkKeyboardPreInit(&JSTK_KEYBOARD, dev, flags);
> >     if (priv->keyboard_device) {
> >         priv->keyboard_device->private = priv;
> >     }
> >
> > -    return (local);
> > +    return (pInfo);
> >
> >  SetupProc_fail:
> >     if (priv)
> >         free(priv);
> > -    if (local)
> > -        local->private = NULL;
> > +    if (pInfo)
> > +        pInfo->private = NULL;
> >     return NULL;
> > -/*    return (local); */ /* Makes X segfault on error */
> > +/*    return (pInfo); */ /* Makes X segfault on error */
> >  }
> 
> Maybe the last line could be removed altogether, since it's a comment anyway?

I'd rather not. this line is removed in the big ABI 12 hotplugging revamp
anyway. Since this is a simple search/replace patch, I try to avoid any
changes that aren't automatic (or semi-automatic in case of indentation
fixes).

Cheers,
  Peter


More information about the xorg-devel mailing list