qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 2/7] misc: fix mixups of bool constants with int variables


From: Peter Maydell
Subject: Re: [PATCH v2 2/7] misc: fix mixups of bool constants with int variables
Date: Mon, 4 Jul 2022 16:38:25 +0100

On Mon, 4 Jul 2022 at 16:23, Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  block/vhdx-log.c       | 2 +-
>  hw/xtensa/sim.c        | 4 ++--
>  nbd/client.c           | 4 ++--
>  target/i386/cpu-dump.c | 3 ++-
>  ui/spice-display.c     | 4 ++--
>  5 files changed, 9 insertions(+), 8 deletions(-)

> diff --git a/nbd/client.c b/nbd/client.c
> index 30d5383cb1..fee3959d24 100644
> --- a/nbd/client.c
> +++ b/nbd/client.c
> @@ -832,8 +832,8 @@ static int nbd_list_meta_contexts(QIOChannel *ioc,
>                                    Error **errp)
>  {
>      int ret;
> -    int seen_any = false;
> -    int seen_qemu = false;
> +    bool seen_any = false;
> +    bool seen_qemu = false;
>
>      if (nbd_send_meta_query(ioc, NBD_OPT_LIST_META_CONTEXT,
>                              info->name, NULL, errp) < 0) {

The code in this function does a bitwise OR into seen_qemu later --
bitwise OR into a bool also seems like bad style that something
is probably going to complain about. (I guess currently -Wbool-operation
doesn't care about it or else we don't enable that, but it might
in future.)

The other changes look OK.

-- PMM



reply via email to

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