aboutsummaryrefslogtreecommitdiff
path: root/chardev/char-mux.c
diff options
context:
space:
mode:
authorRoman Penyaev <r.peniaev@gmail.com>2024-10-14 17:24:03 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2024-10-15 12:26:01 +0400
commit1ba399406a8fa82ad24fd5208595ca429d2927ab (patch)
tree521433dcf4d1d20ce91209b8182b3023dc44068e /chardev/char-mux.c
parent58e5a3ae427d8a625f803fbc5f2964e6986ebeac (diff)
downloadqemu-1ba399406a8fa82ad24fd5208595ca429d2927ab.zip
qemu-1ba399406a8fa82ad24fd5208595ca429d2927ab.tar.gz
qemu-1ba399406a8fa82ad24fd5208595ca429d2927ab.tar.bz2
chardev/mux: use bool type for `linestart` and `term_got_escape`
Those are boolean variables, not signed integers. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com> Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com> Cc: qemu-devel@nongnu.org Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20241014152408.427700-4-r.peniaev@gmail.com>
Diffstat (limited to 'chardev/char-mux.c')
-rw-r--r--chardev/char-mux.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/chardev/char-mux.c b/chardev/char-mux.c
index ee2d47b..728596c 100644
--- a/chardev/char-mux.c
+++ b/chardev/char-mux.c
@@ -73,11 +73,11 @@ static int mux_chr_write(Chardev *chr, const uint8_t *buf, int len)
* qemu_chr_fe_write and background I/O callbacks */
qemu_chr_fe_write_all(&d->chr,
(uint8_t *)buf1, strlen(buf1));
- d->linestart = 0;
+ d->linestart = false;
}
ret += qemu_chr_fe_write(&d->chr, buf + i, 1);
if (buf[i] == '\n') {
- d->linestart = 1;
+ d->linestart = true;
}
}
}
@@ -145,7 +145,7 @@ static void mux_chr_be_event(Chardev *chr, QEMUChrEvent event)
static int mux_proc_byte(Chardev *chr, MuxChardev *d, int ch)
{
if (d->term_got_escape) {
- d->term_got_escape = 0;
+ d->term_got_escape = false;
if (ch == term_escape_char) {
goto send_char;
}
@@ -175,11 +175,11 @@ static int mux_proc_byte(Chardev *chr, MuxChardev *d, int ch)
case 't':
d->timestamps = !d->timestamps;
d->timestamps_start = -1;
- d->linestart = 0;
+ d->linestart = false;
break;
}
} else if (ch == term_escape_char) {
- d->term_got_escape = 1;
+ d->term_got_escape = true;
} else {
send_char:
return 1;