diff --git a/core/native/src/main/scala/cats/effect/Signal.scala b/core/native/src/main/scala/cats/effect/Signal.scala index 6d678211df..9a0d9bc2c4 100644 --- a/core/native/src/main/scala/cats/effect/Signal.scala +++ b/core/native/src/main/scala/cats/effect/Signal.scala @@ -34,7 +34,7 @@ import java.io.IOException private object Signal { private[this] def mkPipe() = if (isLinux || isMac) { - val fd = stackalloc[CInt](2) + val fd = stackalloc[CInt](2.toULong) if (pipe(fd) != 0) throw new IOException(fromCString(strerror(errno))) diff --git a/core/native/src/main/scala/cats/effect/unsafe/EpollSystem.scala b/core/native/src/main/scala/cats/effect/unsafe/EpollSystem.scala index 9874edb58e..4e8dfd28d0 100644 --- a/core/native/src/main/scala/cats/effect/unsafe/EpollSystem.scala +++ b/core/native/src/main/scala/cats/effect/unsafe/EpollSystem.scala @@ -185,7 +185,7 @@ object EpollSystem extends PollingSystem { private[EpollSystem] def poll(timeout: Long): Boolean = { - val events = stackalloc[epoll_event](MaxEvents.toLong) + val events = stackalloc[epoll_event](MaxEvents.toULong) var polled = false @tailrec diff --git a/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala b/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala index 3a26a4eb6d..0e7aae2395 100644 --- a/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala +++ b/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala @@ -170,7 +170,7 @@ object KqueueSystem extends PollingSystem { private[KqueueSystem] def poll(timeout: Long): Boolean = { - val eventlist = stackalloc[kevent64_s](MaxEvents.toLong) + val eventlist = stackalloc[kevent64_s](MaxEvents.toULong) var polled = false @tailrec diff --git a/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala b/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala index 543d71b0a6..879f122fdc 100644 --- a/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala +++ b/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala @@ -69,7 +69,7 @@ class FileDescriptorPollerSpec extends BaseSpec { Resource .make { IO { - val fd = stackalloc[CInt](2) + val fd = stackalloc[CInt](2.toULong) if (unistd.pipe(fd) != 0) throw new IOException(fromCString(strerror(errno))) (fd(0), fd(1))