chardev/baum: Fix compiler warning for Windows builds
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> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
8415b0619f
commit
1566b8c8df
1 changed files with 6 additions and 2 deletions
|
|
@ -94,7 +94,7 @@ struct BaumChardev {
|
||||||
Chardev parent;
|
Chardev parent;
|
||||||
|
|
||||||
brlapi_handle_t *brlapi;
|
brlapi_handle_t *brlapi;
|
||||||
int brlapi_fd;
|
brlapi_fileDescriptor brlapi_fd;
|
||||||
unsigned int x, y;
|
unsigned int x, y;
|
||||||
bool deferred_init;
|
bool deferred_init;
|
||||||
|
|
||||||
|
|
@ -654,7 +654,7 @@ static void baum_chr_open(Chardev *chr,
|
||||||
baum->brlapi = handle;
|
baum->brlapi = handle;
|
||||||
|
|
||||||
baum->brlapi_fd = brlapi__openConnection(handle, NULL, NULL);
|
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",
|
error_setg(errp, "brlapi__openConnection: %s",
|
||||||
brlapi_strerror(brlapi_error_location()));
|
brlapi_strerror(brlapi_error_location()));
|
||||||
g_free(handle);
|
g_free(handle);
|
||||||
|
|
@ -665,6 +665,10 @@ static void baum_chr_open(Chardev *chr,
|
||||||
|
|
||||||
baum->cellCount_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, baum_cellCount_timer_cb, baum);
|
baum->cellCount_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, baum_cellCount_timer_cb, baum);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* On Windows, brlapi_fd is a pointer, which is being used here
|
||||||
|
* as an integer, but in practice it seems to work
|
||||||
|
*/
|
||||||
qemu_set_fd_handler(baum->brlapi_fd, baum_chr_read, NULL, baum);
|
qemu_set_fd_handler(baum->brlapi_fd, baum_chr_read, NULL, baum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue