27 Apr
2008
27 Apr
'08
2:14 p.m.
Christoph Frick wrote:
Add dinput support for BSD's usbhid joysticks
+ if (have_joy_devs == 0) { + joy_devs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct JoyDev)); + } else { + HeapReAlloc(GetProcessHeap(), 0, joy_devs, (1 + have_joy_devs) * sizeof(struct JoyDev)); + } + joy_devs[have_joy_devs++] = joydev; + + hid_dispose_report_desc(rdesc); + close(fd); + } +}
This is ugly! Curly brackets should go on the separate line. And I asked no tabs please! And again you copied all the code - I'm against this. All the duplicate code should go into the new joystick base class. No reason to rewrite code if it can be written right the first time around. Vitaliy.