On Mon, Oct 31, 2011 at 10:28:11AM +0100, walter harms wrote:
>
>
> Am 31.10.2011 05:41, schrieb Peter Hutterer:
> > xf86OptionListDuplicate() duplicates an XF86Option list, not an InputOption
> > list.
> >
> > Signed-off-by: Peter Hutterer <[email protected]>
> > ---
> > src/jstk_key.c | 16 ++++++++--------
> > 1 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/src/jstk_key.c b/src/jstk_key.c
> > index d699dcd..e842941 100644
> > --- a/src/jstk_key.c
> > +++ b/src/jstk_key.c
> > @@ -253,26 +253,26 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
> > int rc;
> > char name[512] = {0};
> > InputAttributes *attrs = NULL;
> > - InputOption *options;
> > InputOption *iopts = NULL, *tmp;
> > DeviceIntPtr dev;
> > + XF86OptionPtr opts;
> >
> > /* duplicate option list, append to name */
> > - options = xf86OptionListDuplicate(pInfo->options);
> > + opts = xf86OptionListDuplicate(pInfo->options);
>
> > strcpy(name, pInfo->name);
> > strcat(name, " (keys)");
>
> perhaps more readable:
> snprintf(name,sizeof(name);"%s (keys)",pInfo->name);
possibly, but it's outside of this patch series and I'd rather not work on
the joystick driver more than necessary. feel free to submit a patch though.
Cheers,
Peter
>
>
>
> > - options = xf86ReplaceStrOption(options, "Name", name);
> > - options = xf86ReplaceStrOption(options, "_source", "_driver/joystick");
> > + opts = xf86ReplaceStrOption(opts, "Name", name);
> > + opts = xf86ReplaceStrOption(opts, "_source", "_driver/joystick");
> >
> > - while(options)
> > + while(opts)
> > {
> > tmp = calloc(1, sizeof(InputOption));
> >
> > - tmp->key = xf86OptionName(options);
> > - tmp->value = xf86OptionValue(options);
> > + tmp->key = xf86OptionName(opts);
> > + tmp->value = xf86OptionValue(opts);
> > tmp->next = iopts;
> > iopts = tmp;
> > - options = xf86NextOption(options);
> > + opts = xf86NextOption(opts);
> > }
> >
> > /* duplicate attribute list */
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel