[PATCH joystick 1/9] Replace LocalDevicePtr with InputInfoPtr

Trevor Woerner twoerner at gmail.com
Wed Dec 15 04:56:19 PST 2010


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?

> @@ -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?


More information about the xorg-devel mailing list