qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Adding more function keys support


From: Eric Blake
Subject: Re: [Qemu-devel] Adding more function keys support
Date: Wed, 13 Dec 2017 20:20:43 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 12/13/2017 01:18 PM, Programmingkid wrote:

> Thank you BALATON for the file. One thing that caught my eye in this file is 
> this:
> 

>       if (usage->code == KEY_FN) {
>               asc->fn_on = !!value;
> 
> Why would they need the double !? 

Double '!!' is an idiomatic way to force a value to be converted to bool
(squashing all non-zero values into 1).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]