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

Vitaliy Margolen wine-devel at kievinfo.com
Sun Jul 29 18:38:30 CDT 2007

Peter Dons Tychsen wrote:
> On Sun, 2007-07-29 at 13:40 -0600, Vitaliy Margolen wrote:
>> Peter Dons Tychsen wrote:
>>> On Sun, 2007-07-29 at 11:15 -0600, Vitaliy Margolen wrote:

>>> I have re-sent the patch with all your remarks fixed, except for the one
>>> regarding joystick_linuxinput.c, which cannot be done with the current
>>> code as alloc_device() is too different in the two versions for the
>>> patch to work. I have however made sure that the version in
>>> joystick_linuxinput.c does not have this problem.
>> Why do you think they are so different? Looks almost the same to me.
>> Few more things to fix:
> They are almost the same... but different for exactly the thing i am
> changing. Notice the difference in the way the device is found.
> One implementation uses Data3 to look it up, the other loops through all
> devices and compares with the GUID.

Well yeah, but the way they identifying which device is which is about the 
same. If you look at the find_joydevs() you'll see what it's doing with that 
giud.Data3 field.

So you need to pick which way you want to do it (the way it's done in 
joystick_linux.c or joystick_linuxinput.c). And modify the other one 
accordingly. I don't like iterating over the whole array, and doing whole 
GIUD comparison, when you can get the index (the way you have it). Just make 
sure it doesn't overflow

>>> -#undef MAX_JOYSTICKS
>> You removed this, but you haven't added it back.
> Why? I removed it so the rest of the file could use it.
> I don't understand why it was undef'ed to begin with.
> Probably a copy/paste remnant. There is no reason to keep it.
It usually a good idea to undef anything that you no longer need. Otherwise 
it stays around for some time and might cause some problems in the future.

> What things should i change for the re-submit?
Don't send the same patch more the 3 times. Alexandre doesn't like it ;-)
You should work out all the problems then resubmit. You can send patches to 
wine-devel for review in the main time.


More information about the wine-devel mailing list