From: Markus Armbruster <armbru@redhat.com>
To: Stefan Weil via <qemu-devel@nongnu.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Michael Tokarev" <mjt@tls.msk.ru>,
"rent Vivier" <laurent@vivier.eu>, "Stefan Weil" <sw@weilnetz.de>,
qemu-trivial@nongnu.org
Subject: Re: [PATCH trivial] chardev/baum: Fix compiler warning for Windows builds
Date: Sat, 09 Aug 2025 08:20:32 +0200 [thread overview]
Message-ID: <87y0rtnhhr.fsf@pond.sub.org> (raw)
In-Reply-To: <20250809061302.596931-1-sw@weilnetz.de> (Stefan Weil via's message of "Sat, 9 Aug 2025 08:13:02 +0200")
Stefan Weil via <qemu-devel@nongnu.org> writes:
> Compiler warning:
>
> ../chardev/baum.c:657:25: warning: comparison between pointer and integer
>
> Use brlapi_fileDescriptor instead of int for brlapi_fd and
> BRLAPI_INVALID_FILE_DESCRIPTOR instead of -1.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>
> This is a rather old patch which I now use since more than two years
> to support Braille with QEMU on Windows.
>
> It's a hack (because Windows uses a pointer (64 bit) which is
> assigned to an int (32 bit), but it seems to work.
Would a code comment pointing out the hack be useful?
> Regards,
> Stefan
>
>
> chardev/baum.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/chardev/baum.c b/chardev/baum.c
> index f3e8cd27f0..5c3587dda5 100644
> --- a/chardev/baum.c
> +++ b/chardev/baum.c
> @@ -94,7 +94,7 @@ struct BaumChardev {
> Chardev parent;
>
> brlapi_handle_t *brlapi;
> - int brlapi_fd;
> + brlapi_fileDescriptor brlapi_fd;
> unsigned int x, y;
> bool deferred_init;
>
> @@ -654,7 +654,7 @@ static void baum_chr_open(Chardev *chr,
> baum->brlapi = handle;
>
> baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
> - if (baum->brlapi_fd == -1) {
> + if (baum->brlapi_fd == BRLAPI_INVALID_FILE_DESCRIPTOR) {
> error_setg(errp, "brlapi__openConnection: %s",
> brlapi_strerror(brlapi_error_location()));
> g_free(handle);
next prev parent reply other threads:[~2025-08-09 6:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-09 6:13 [PATCH trivial] chardev/baum: Fix compiler warning for Windows builds Stefan Weil via
2025-08-09 6:13 ` Stefan Weil via
2025-08-09 6:20 ` Markus Armbruster [this message]
2025-08-09 6:27 ` Stefan Weil via
2025-08-09 6:27 ` Stefan Weil via
2025-08-10 7:29 ` Samuel Thibault
2025-08-10 7:55 ` Michael Tokarev
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=87y0rtnhhr.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=laurent@vivier.eu \
--cc=marcandre.lureau@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=sw@weilnetz.de \
/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.