summaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2011-02-23 19:09:16 +0100
committerBlue Swirl <blauwirbel@gmail.com>2011-03-20 21:39:23 +0000
commite0efb993b817564ef84e462ac1fe35f89b57ad7b (patch)
tree805341589c14255dc94c5711d67140f346dcd1e5 /qemu-char.c
parentd81e54de5919f46d911e971804bb4b4d77a8a88a (diff)
Fix conversions from pointer to int and vice versa
Here the int values fds[0], sigfd, s, sock and fd are converted to void pointers which are later converted back to an int value. These conversions should always use intptr_t instead of unsigned long. They are needed for environments where sizeof(long) != sizeof(void *). Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-char.c b/qemu-char.c
index bd4e944e1..cad35d771 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1376,7 +1376,7 @@ static CharDriverState *qemu_chr_open_pp(QemuOpts *opts)
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
{
- int fd = (int)(long)chr->opaque;
+ int fd = (int)(intptr_t)chr->opaque;
uint8_t b;
switch(cmd) {
@@ -1422,7 +1422,7 @@ static CharDriverState *qemu_chr_open_pp(QemuOpts *opts)
return NULL;
chr = qemu_mallocz(sizeof(CharDriverState));
- chr->opaque = (void *)(long)fd;
+ chr->opaque = (void *)(intptr_t)fd;
chr->chr_write = null_chr_write;
chr->chr_ioctl = pp_ioctl;
return chr;