dinput - Allow the use of the standard Joystick GUID when calling CreateDevice

Peter Dons Tychsen donpedro at tdcadsl.dk
Tue Jul 31 14:50:15 CDT 2007


On Tue, 2007-07-31 at 06:34 -0600, Vitaliy Margolen wrote:
> Peter Dons Tychsen wrote:
> > On Mon, 2007-07-30 at 21:20 +0200, Peter Dons Tychsen wrote:
> >> On Sun, 2007-07-29 at 17:43 -0600, Vitaliy Margolen wrote:
> >>> Peter Dons Tychsen wrote:
> >>>> OK. Please review this diff:
> >>>>
> >>>> I will re-submit it if you like it.
> >>>>
> >>>> /Pedro
> >>> Alright looks good now (you might want to remove the extra white space your 
> >>> patch adds - git complains about those). Just left to make the same change 
> >>> to the other joystick interface :)
> >>>
> >>> BTW don't forget to cc: the wine-devel list when you replying.
> >>>
> >>> Vitaliy.
> >> OK. I still feel that trying to sync joystick_linuxinput.c and
> >> joystick_linux.c is out of scope for this patch. But as my steadiness
> >> has limits i have done some of it anyway... :). I have kept the changes
> >> modest.
> >>
> >> Please take a look at the new patch.
> >>
> >> On another note i will agree with you that it would be practical if the
> >> two files had similar (or maybe even shared) code. Redundant code is
> >> never very practical as it always ends up as this very example. The two
> >> implementations which were supposed to identical always drift apart. If
> >> things are supposed to do the same, keep them together to begin with.
> >>
> >> Thanks,
> >>
> > Maybe i would be more successful if i actually attached the
> > patch.... :-)
> > 
> > Here it is....
> 
> Just few small things left:
> 
> > -#undef MAX_JOYSTICKS
> As I mentioned earlier you should move this instead of removing it completely.
> 
> 
> >  static HRESULT joydev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev)
> >  {
> > -  int i;
> > -
> > -  find_joydevs();
> You removed a really important function call here.
> 
> 
> > +static HRESULT joydev_create_deviceA(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev)
> > +{
> > +  unsigned short index;
> > +
> > +  if ((index = get_joystick_index(rguid)) < MAX_JOYDEV) {
> > +    if ((riid == NULL) ||
> If you reformat the whole function, please make it 4-space indented.
> 
> Vitaliy.

OK. Here is the new patch:

/pedro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Allow-the-use-of-the-standard-Joystick-GUID-when-cal.patch
Type: application/mbox
Size: 9130 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070731/49f6f866/0001-Allow-the-use-of-the-standard-Joystick-GUID-when-cal.bin


More information about the wine-devel mailing list