[PATCH] dix: add valuator_mask_fetch_double()

Chase Douglas chase.douglas at canonical.com
Fri Sep 30 16:02:57 PDT 2011


On 09/30/2011 03:55 PM, Daniel Stone wrote:
> Hi,
> 
> On 30 September 2011 17:18, Chase Douglas <chase.douglas at canonical.com> wrote:
>> On 09/29/2011 09:29 PM, Peter Hutterer wrote:
>>> Using this call simplifies callers that don't know if the mask bit is set.
>>>
>>> Before:
>>>   if (valuator_mask_isset(mask, valnum))
>>>     value = valuator_mask_get_double(mask, valnum));
>>>   else
>>>     value = someothervalue;
>>>
>>> Now:
>>>  if (!valuator_mask_fetch_double(mask, valnum, &value))
>>>     value = someothervalue;
>>>
>>> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
>>
>> I think this will help clean up code all over :).
>>
>> Reviewed-by: Chase Douglas <chase.douglas at canonical.com>
> 
> Yeah, seriously.  Is there any good reason to not make a double which
> returns either 0.0 (if not set) or the mask value (if set) though, on
> the grounds that anyone who wants to know will be using
> isset/get_double?

It's not clear to me what you are asking. Can you rephrase it for me?

-- Chase


More information about the xorg-devel mailing list