summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-11-13 16:29:03 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-13 16:29:03 -0700
commit4d881435fdd7e4cd9212a3580fcd0524c2bebca1 (patch)
treeff4f74f887e1f0ddfd6835a020e7611b901eb4d9
parent12877bafa25434f4aea22b26e17b5c94d6ddc5e4 (diff)
downloadliburing-4d881435fdd7e4cd9212a3580fcd0524c2bebca1.tar.gz
liburing-4d881435fdd7e4cd9212a3580fcd0524c2bebca1.tar.bz2
Fix 32-bit compile warnings
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h6
-rw-r--r--test/fixed-link.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 892efcf..74302e6 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -266,7 +266,8 @@ static inline void io_uring_prep_timeout(struct io_uring_sqe *sqe,
static inline void io_uring_prep_timeout_remove(struct io_uring_sqe *sqe,
__u64 user_data, unsigned flags)
{
- io_uring_prep_rw(IORING_OP_TIMEOUT_REMOVE, sqe, -1, (void *)user_data, 0, 0);
+ io_uring_prep_rw(IORING_OP_TIMEOUT_REMOVE, sqe, -1,
+ (void *)(unsigned long)user_data, 0, 0);
sqe->timeout_flags = flags;
}
@@ -274,7 +275,8 @@ static inline void io_uring_prep_accept(struct io_uring_sqe *sqe, int fd,
struct sockaddr *addr,
socklen_t *addrlen, int flags)
{
- io_uring_prep_rw(IORING_OP_ACCEPT, sqe, fd, addr, 0, (__u64) addrlen);
+ io_uring_prep_rw(IORING_OP_ACCEPT, sqe, fd, addr, 0,
+ (__u64) (unsigned long) addrlen);
sqe->accept_flags = flags;
}
diff --git a/test/fixed-link.c b/test/fixed-link.c
index b100563..b9428db 100644
--- a/test/fixed-link.c
+++ b/test/fixed-link.c
@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
struct iovec iovecs[IOVECS_LEN];
struct io_uring ring;
int i, fd, ret;
-
+
fd = open("/dev/zero", O_RDONLY);
if (fd < 0) {
fprintf(stderr, "Failed to open /dev/zero\n");
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
}
if (cqe->res != iovecs[i].iov_len) {
fprintf(stderr, "read: wanted %d, got %ld\n", cqe->res,
- iovecs[i].iov_len);
+ (long) iovecs[i].iov_len);
return 1;
}
io_uring_cqe_seen(&ring, cqe);