@@ -96,7 +96,7 @@ io_uring_init :: proc(ring: ^IO_Uring, entries: u32, params: ^io_uring_params) -
9696 assert ((params.flags & IORING_SETUP_SQE128) == 0 )
9797
9898 sq, ok := submission_queue_make (fd, params)
99- if !ok do return .System_Resources
99+ if !ok { return .System_Resources }
100100
101101 ring.fd = fd
102102 ring.sq = sq
@@ -241,7 +241,7 @@ flush_sq :: proc(ring: ^IO_Uring) -> (n_pending: u32) {
241241// Matches the implementation of sq_ring_needs_enter() in liburing.
242242sq_ring_needs_enter :: proc (ring: ^IO_Uring, flags: ^u32 ) -> bool {
243243 assert (flags^ == 0 )
244- if ring.flags & IORING_SETUP_SQPOLL == 0 do return true
244+ if ring.flags & IORING_SETUP_SQPOLL == 0 { return true }
245245 if sync.atomic_load_explicit (ring.sq.flags, .Relaxed) & IORING_SQ_NEED_WAKEUP != 0 {
246246 flags^ |= IORING_ENTER_SQ_WAKEUP
247247 return true
@@ -267,7 +267,7 @@ cq_ready :: proc(ring: ^IO_Uring) -> (n_ready: u32) {
267267// Provides all the wait/peek methods found in liburing, but with batching and a single method.
268268copy_cqes :: proc (ring: ^IO_Uring, cqes: []io_uring_cqe, wait_nr: u32 ) -> (n_copied: u32 , err: IO_Uring_Error) {
269269 n_copied = copy_cqes_ready (ring, cqes)
270- if n_copied > 0 do return
270+ if n_copied > 0 { return }
271271 if wait_nr > 0 || cq_ring_needs_flush (ring) {
272272 _ = enter (ring, 0 , wait_nr, IORING_ENTER_GETEVENTS) or_return
273273 n_copied = copy_cqes_ready (ring, cqes)
@@ -307,7 +307,7 @@ cqe_seen :: proc(ring: ^IO_Uring) {
307307// For advanced use cases only that implement custom completion queue methods.
308308// Matches the implementation of cq_advance() in liburing.
309309cq_advance :: proc (ring: ^IO_Uring, count: u32 ) {
310- if count == 0 do return
310+ if count == 0 { return }
311311 sync.atomic_store_explicit (ring.cq.head, ring.cq.head^ + count, .Release)
312312}
313313
@@ -669,8 +669,8 @@ submission_queue_make :: proc(fd: os.Handle, params: ^io_uring_params) -> (sq: S
669669 int (fd),
670670 IORING_OFF_SQ_RING,
671671 )
672- if mmap_result < 0 do return
673- defer if !ok do unix.sys_munmap (rawptr (uintptr (mmap_result)), uint (size))
672+ if mmap_result < 0 { return }
673+ defer if !ok { unix.sys_munmap (rawptr (uintptr (mmap_result)), uint (size)) }
674674
675675 mmap := transmute ([^]u8 )uintptr (mmap_result)
676676
@@ -684,7 +684,7 @@ submission_queue_make :: proc(fd: os.Handle, params: ^io_uring_params) -> (sq: S
684684 int (fd),
685685 IORING_OFF_SQES,
686686 )
687- if mmap_sqes_result < 0 do return
687+ if mmap_sqes_result < 0 { return }
688688
689689 array := cast ([^]u32 )&mmap[params.sq_off.array]
690690 sqes := cast ([^]io_uring_sqe)uintptr (mmap_sqes_result)
0 commit comments