From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTC9Q-00018W-B9 for qemu-devel@nongnu.org; Wed, 04 Mar 2015 11:28:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTC9N-000811-3e for qemu-devel@nongnu.org; Wed, 04 Mar 2015 11:28:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTC9M-00080n-Os for qemu-devel@nongnu.org; Wed, 04 Mar 2015 11:27:57 -0500 Date: Wed, 4 Mar 2015 17:27:50 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Message-ID: <20150304162750.GB25889@potion.redhat.com> References: <1424448376-15599-1-git-send-email-rkrcmar@redhat.com> <1424448376-15599-2-git-send-email-rkrcmar@redhat.com> <54F7185F.6070404@msgid.tls.msk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54F7185F.6070404@msgid.tls.msk.ru> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] fix GCC 5.0.0 logical-not-parentheses warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: Paolo Bonzini , Michael Walle , qemu-devel@nongnu.org, Peter Maydell 2015-03-04 17:36+0300, Michael Tokarev: > 20.02.2015 19:06, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > > - if (!!n->vhost_started =3D=3D > > - (virtio_net_started(n, status) && !nc->peer->link_down)) { > > + if ((virtio_net_started(n, status) && !nc->peer->link_down) =3D=3D > > + !!n->vhost_started) { >=20 > btw, can this be rewritten as > (bool)n->vhost_started > instead of > !!n->vhos_started Yes. (It's the same as long as we use bool from stdbool.h.) > Not questioning the patch itself, just wondering, as these > double-negatives look ugly... Casting to bool looks better to me as well, yet the QEMU design guide, `grep $x | wc -l`, greatly prefers bangs. I think that it is best to define it as bool in struct VirtIONet, but I prefer not to change decision that I don't understand ... Thanks for accepting the patches.