All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH v2 2/7] misc: fix mixups of bool constants with int variables
Date: Mon,  4 Jul 2022 16:22:58 +0100	[thread overview]
Message-ID: <20220704152303.760983-3-berrange@redhat.com> (raw)
In-Reply-To: <20220704152303.760983-1-berrange@redhat.com>

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/block/vhdx-log.c b/block/vhdx-log.c
index ff0d4e0da0..8f34755a6f 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -215,7 +215,7 @@ exit:
 static bool vhdx_log_hdr_is_valid(VHDXLogEntries *log, VHDXLogEntryHeader *hdr,
                                   BDRVVHDXState *s)
 {
-    int valid = false;
+    bool valid = false;
 
     if (hdr->signature != VHDX_LOG_SIGNATURE) {
         goto exit;
diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index 946c71cb5b..70fce7fb85 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -97,9 +97,9 @@ void xtensa_sim_load_kernel(XtensaCPU *cpu, MachineState *machine)
 {
     const char *kernel_filename = machine->kernel_filename;
 #if TARGET_BIG_ENDIAN
-    int big_endian = true;
+    int big_endian = 1;
 #else
-    int big_endian = false;
+    int big_endian = 0;
 #endif
 
     if (kernel_filename) {
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) {
diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c
index 08ac957e99..43521c74c8 100644
--- a/target/i386/cpu-dump.c
+++ b/target/i386/cpu-dump.c
@@ -275,7 +275,8 @@ static void dump_apic_icr(APICCommonState *s, CPUX86State *env)
 static void dump_apic_interrupt(const char *name, uint32_t *ireg_tab,
                                 uint32_t *tmr_tab)
 {
-    int i, empty = true;
+    int i;
+    bool empty = true;
 
     qemu_printf("%s\t ", name);
     for (i = 0; i < 256; i++) {
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 494168e7fe..5d3b64413f 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -541,14 +541,14 @@ static int interface_get_command(QXLInstance *sin, QXLCommandExt *ext)
 {
     SimpleSpiceDisplay *ssd = container_of(sin, SimpleSpiceDisplay, qxl);
     SimpleSpiceUpdate *update;
-    int ret = false;
+    int ret = 0;
 
     qemu_mutex_lock(&ssd->lock);
     update = QTAILQ_FIRST(&ssd->updates);
     if (update != NULL) {
         QTAILQ_REMOVE(&ssd->updates, update, next);
         *ext = update->ext;
-        ret = true;
+        ret = 1;
     }
     qemu_mutex_unlock(&ssd->lock);
 
-- 
2.36.1



  parent reply	other threads:[~2022-07-04 15:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 15:22 [PATCH v2 0/7] tests: introduce a tree-wide code style checking facility Daniel P. Berrangé
2022-07-04 15:22 ` [PATCH v2 1/7] tests: introduce tree-wide code style checking Daniel P. Berrangé
2022-07-04 15:46   ` Peter Maydell
2022-07-04 16:12     ` Daniel P. Berrangé
2022-07-07 16:43     ` Daniel P. Berrangé
2022-07-04 15:22 ` Daniel P. Berrangé [this message]
2022-07-04 15:38   ` [PATCH v2 2/7] misc: fix mixups of bool constants with int variables Peter Maydell
2022-07-04 15:22 ` [PATCH v2 3/7] tests/style: check for " Daniel P. Berrangé
2022-07-04 15:23 ` [PATCH v2 4/7] misc: fix commonly doubled up words Daniel P. Berrangé
2022-07-04 15:52   ` Peter Maydell
2022-07-07 12:30     ` Daniel P. Berrangé
2022-07-07 12:35       ` Peter Maydell
2022-07-04 15:23 ` [PATCH v2 5/7] tests/style: check for " Daniel P. Berrangé
2022-07-04 15:23 ` [PATCH v2 6/7] misc: ensure qemu/osdep.h is included in all .c files Daniel P. Berrangé
2022-07-04 15:38   ` Warner Losh
2022-07-04 15:46     ` Daniel P. Berrangé
2022-07-04 16:08       ` Warner Losh
2022-07-04 15:23 ` [PATCH v2 7/7] tests/style: check " Daniel P. Berrangé
2022-07-04 15:47   ` Peter Maydell
2022-07-04 15:50     ` Daniel P. Berrangé
2022-07-04 15:55       ` Peter Maydell
2022-07-04 16:15         ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220704152303.760983-3-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.