authorgravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-09-21 12:03:52+02:00
committergravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-09-21 12:03:52+02:00
log2d8df2b745d4004a790375deb654065224edd6b0
treeae7c271f3028d5c897bb1931a9fe79baa54cd780
parent7719abbf5460c320b63f7fe10ee27b9e9b66a069

Use @intCast instead of @truncate


1 files changed, 5 insertions(+), 5 deletions(-)

lib/std/os/linux/io_uring.zig+5-5
...@@ -404,7 +404,7 @@ pub const IO_Uring = struct {...@@ -404,7 +404,7 @@ pub const IO_Uring = struct {
404 sqe.fd = fd;404 sqe.fd = fd;
405 sqe.off = offset;405 sqe.off = offset;
406 sqe.addr = @ptrToInt(buffer.ptr);406 sqe.addr = @ptrToInt(buffer.ptr);
407 sqe.len = @truncate(u32, buffer.len);407 sqe.len = @intCast(u32, buffer.len);
408 sqe.user_data = user_data;408 sqe.user_data = user_data;
409 return sqe;409 return sqe;
410 }410 }
...@@ -423,7 +423,7 @@ pub const IO_Uring = struct {...@@ -423,7 +423,7 @@ pub const IO_Uring = struct {
423 sqe.fd = fd;423 sqe.fd = fd;
424 sqe.off = offset;424 sqe.off = offset;
425 sqe.addr = @ptrToInt(buffer.ptr);425 sqe.addr = @ptrToInt(buffer.ptr);
426 sqe.len = @truncate(u32, buffer.len);426 sqe.len = @intCast(u32, buffer.len);
427 sqe.user_data = user_data;427 sqe.user_data = user_data;
428 return sqe;428 return sqe;
429 }429 }
...@@ -444,7 +444,7 @@ pub const IO_Uring = struct {...@@ -444,7 +444,7 @@ pub const IO_Uring = struct {
444 sqe.fd = fd;444 sqe.fd = fd;
445 sqe.off = offset;445 sqe.off = offset;
446 sqe.addr = @ptrToInt(iovecs.ptr);446 sqe.addr = @ptrToInt(iovecs.ptr);
447 sqe.len = @truncate(u32, iovecs.len);447 sqe.len = @intCast(u32, iovecs.len);
448 sqe.user_data = user_data;448 sqe.user_data = user_data;
449 return sqe;449 return sqe;
450 }450 }
...@@ -465,7 +465,7 @@ pub const IO_Uring = struct {...@@ -465,7 +465,7 @@ pub const IO_Uring = struct {
465 sqe.fd = fd;465 sqe.fd = fd;
466 sqe.off = offset;466 sqe.off = offset;
467 sqe.addr = @ptrToInt(iovecs.ptr);467 sqe.addr = @ptrToInt(iovecs.ptr);
468 sqe.len = @truncate(u32, iovecs.len);468 sqe.len = @intCast(u32, iovecs.len);
469 sqe.user_data = user_data;469 sqe.user_data = user_data;
470 return sqe;470 return sqe;
471 }471 }
...@@ -516,7 +516,7 @@ pub const IO_Uring = struct {...@@ -516,7 +516,7 @@ pub const IO_Uring = struct {
516 self.fd,516 self.fd,
517 .REGISTER_FILES,517 .REGISTER_FILES,
518 @ptrCast(*const c_void, fds.ptr),518 @ptrCast(*const c_void, fds.ptr),
519 @truncate(u32, fds.len)519 @intCast(u32, fds.len)
520 );520 );
521 switch (linux.getErrno(res)) {521 switch (linux.getErrno(res)) {
522 0 => {},522 0 => {},