aboutsummaryrefslogtreecommitdiff
path: root/cpus.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 /cpus.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 'cpus.c')
-rw-r--r--cpus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpus.c b/cpus.c
index 077729c507..b6e658da62 100644
--- a/cpus.c
+++ b/cpus.c
@@ -278,7 +278,7 @@ static void qemu_event_increment(void)
static void qemu_event_read(void *opaque)
{
- int fd = (unsigned long)opaque;
+ int fd = (intptr_t)opaque;
ssize_t len;
char buffer[512];
@@ -306,7 +306,7 @@ static int qemu_event_init(void)
goto fail;
}
qemu_set_fd_handler2(fds[0], NULL, qemu_event_read, NULL,
- (void *)(unsigned long)fds[0]);
+ (void *)(intptr_t)fds[0]);
io_thread_fd = fds[1];
return 0;
@@ -327,7 +327,7 @@ static void dummy_signal(int sig)
*/
static void sigfd_handler(void *opaque)
{
- int fd = (unsigned long) opaque;
+ int fd = (intptr_t)opaque;
struct qemu_signalfd_siginfo info;
struct sigaction action;
ssize_t len;
@@ -395,7 +395,7 @@ static int qemu_signal_init(void)
fcntl_setfl(sigfd, O_NONBLOCK);
qemu_set_fd_handler2(sigfd, NULL, sigfd_handler, NULL,
- (void *)(unsigned long) sigfd);
+ (void *)(intptr_t)sigfd);
return 0;
}