Skip to content

Commit

Permalink
fix(io_uring): use usize instead of i32
Browse files Browse the repository at this point in the history
  • Loading branch information
mookums committed Dec 21, 2024
1 parent d645287 commit e133b42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/aio/apis/io_uring.zig
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ pub const AsyncIoUring = struct {
break :blk .{ .connect = result };
},
.recv => {
if (cqe.res > 0) break :blk .{ .recv = .{ .actual = cqe.res } };
if (cqe.res > 0) break :blk .{ .recv = .{ .actual = @intCast(cqe.res) } };
if (cqe.res == 0) break :blk .{ .recv = .{ .err = RecvError.Closed } };
const result: RecvResult = result: {
const e: LinuxError = @enumFromInt(-cqe.res);
Expand All @@ -520,7 +520,7 @@ pub const AsyncIoUring = struct {
break :blk .{ .recv = result };
},
.send => {
if (cqe.res >= 0) break :blk .{ .send = .{ .actual = cqe.res } };
if (cqe.res >= 0) break :blk .{ .send = .{ .actual = @intCast(cqe.res) } };
const result: SendResult = result: {
const e: LinuxError = @enumFromInt(-cqe.res);
switch (e) {
Expand Down Expand Up @@ -548,7 +548,7 @@ pub const AsyncIoUring = struct {
break :blk .{ .send = result };
},
.open => {
if (cqe.res >= 0) break :blk .{ .open = .{ .actual = cqe.res } };
if (cqe.res >= 0) break :blk .{ .open = .{ .actual = @intCast(cqe.res) } };
const result: OpenResult = result: {
const e: LinuxError = @enumFromInt(-cqe.res);
switch (e) {
Expand Down Expand Up @@ -582,7 +582,7 @@ pub const AsyncIoUring = struct {
break :blk .{ .open = result };
},
.read => {
if (cqe.res > 0) break :blk .{ .read = .{ .actual = cqe.res } };
if (cqe.res > 0) break :blk .{ .read = .{ .actual = @intCast(cqe.res) } };
if (cqe.res == 0) break :blk .{ .read = .{ .err = ReadError.EndOfFile } };
const result: ReadResult = result: {
const e: LinuxError = @enumFromInt(-cqe.res);
Expand All @@ -601,7 +601,7 @@ pub const AsyncIoUring = struct {
break :blk .{ .read = result };
},
.write => {
if (cqe.res > 0) break :blk .{ .write = .{ .actual = cqe.res } };
if (cqe.res > 0) break :blk .{ .write = .{ .actual = @intCast(cqe.res) } };
const result: WriteResult = result: {
const e: LinuxError = @enumFromInt(-cqe.res);
switch (e) {
Expand Down

0 comments on commit e133b42

Please sign in to comment.