[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [v2 1/3] dinput: Print location ID in debugstr_device on the Mac
From: DavidL <david.dljunk () gmail ! com>
Date: 2016-06-30 9:23:58
Message-ID: CAD6OkWkVXa56N70obfj1QiqomLsW4cYLKWYt4nqM4fMSRAT5xw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Ah, okay ... I have a couple of other new helper functions, I should
probably make sure they are static as well. Thanks!
On Thursday, June 30, 2016, Dmitry Timoshkov <dmitry@baikal.ru> wrote:
> David Lawrie <david.dljunk@gmail.com <javascript:;>> wrote:
>
> > +static Boolean get_device_property_long(IOHIDDeviceRef in_device,
> CFStringRef in_key, long * out_value)
> > +{
> > + Boolean result = FALSE;
> > + CFTypeRef type;
> > +
> > + if (in_device)
> > + {
> > + assert(IOHIDDeviceGetTypeID() == CFGetTypeID(in_device));
> > +
> > + type = IOHIDDeviceGetProperty(in_device, in_key);
> > +
> > + if (type)
> > + {
> > + if (CFNumberGetTypeID() == CFGetTypeID(type))
> > + result = CFNumberGetValue((CFNumberRef)type,
> kCFNumberLongType, out_value);
> > + }
> > + }
> > + return result;
> > +}
> > +
> > +long get_device_location_ID(IOHIDDeviceRef device)
> > +{
> > + long result = 0;
> > + get_device_property_long(device, CFSTR(kIOHIDLocationIDKey),
> &result);
> > + return result;
> > +}
>
> The helper should be 'static'. Also, probably you should return value from
> the helper directly since you don't check for the boolean result anyway.
>
> Same comment applies for a similar winejoystick.drv patch.
>
> --
> Dmitry.
>
[Attachment #5 (text/html)]
Ah, okay ... I have a couple of other new helper functions, I should probably make \
sure they are static as well. Thanks!<br><br>On Thursday, June 30, 2016, Dmitry \
Timoshkov <<a href="mailto:dmitry@baikal.ru">dmitry@baikal.ru</a>> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">David Lawrie <<a href="javascript:;" \
onclick="_e(event, 'cvml', \
'david.dljunk@gmail.com')">david.dljunk@gmail.com</a>> wrote:<br> <br>
> +static Boolean get_device_property_long(IOHIDDeviceRef in_device, CFStringRef \
in_key, long * out_value)<br> > +{<br>
> + Boolean result = FALSE;<br>
> + CFTypeRef type;<br>
> +<br>
> + if (in_device)<br>
> + {<br>
> + assert(IOHIDDeviceGetTypeID() == CFGetTypeID(in_device));<br>
> +<br>
> + type = IOHIDDeviceGetProperty(in_device, in_key);<br>
> +<br>
> + if (type)<br>
> + {<br>
> + if (CFNumberGetTypeID() == CFGetTypeID(type))<br>
> + result = CFNumberGetValue((CFNumberRef)type, \
kCFNumberLongType, out_value);<br> > + }<br>
> + }<br>
> + return result;<br>
> +}<br>
> +<br>
> +long get_device_location_ID(IOHIDDeviceRef device)<br>
> +{<br>
> + long result = 0;<br>
> + get_device_property_long(device, CFSTR(kIOHIDLocationIDKey), \
&result);<br> > + return result;<br>
> +}<br>
<br>
The helper should be 'static'. Also, probably you should return value \
from<br> the helper directly since you don't check for the boolean result \
anyway.<br> <br>
Same comment applies for a similar winejoystick.drv patch.<br>
<br>
--<br>
Dmitry.<br>
</blockquote>
[Attachment #6 (text/plain)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic