From 46c2fb2ffeab726b94b3ebcf915dde39e557935c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 11 Aug 2022 19:23:10 +0200 Subject: [PATCH] kernel/fd: use loop variable type size_t when count type is size_t. Change-Id: Id68582fbd2243d65394e0c2c4d43272823bf778e Reviewed-on: https://review.haiku-os.org/c/haiku/+/5543 Reviewed-by: waddlesplash --- src/system/kernel/fs/fd.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/system/kernel/fs/fd.cpp b/src/system/kernel/fs/fd.cpp index fccb572ebc..28034a8e25 100644 --- a/src/system/kernel/fs/fd.cpp +++ b/src/system/kernel/fs/fd.cpp @@ -819,7 +819,7 @@ common_user_vector_io(int fd, off_t pos, const iovec* userVecs, size_t count, SyscallRestartWrapper status; ssize_t bytesTransferred = 0; - for (uint32 i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { if (vecs[i].iov_base == NULL) continue; @@ -1090,7 +1090,6 @@ _kern_readv(int fd, off_t pos, const iovec* vecs, size_t count) { bool movePosition = false; status_t status; - uint32 i; if (pos < -1) return B_BAD_VALUE; @@ -1115,7 +1114,7 @@ _kern_readv(int fd, off_t pos, const iovec* vecs, size_t count) ssize_t bytesRead = 0; - for (i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { size_t length = vecs[i].iov_len; status = descriptor->ops->fd_read(descriptor, pos, vecs[i].iov_base, &length); @@ -1185,7 +1184,6 @@ _kern_writev(int fd, off_t pos, const iovec* vecs, size_t count) { bool movePosition = false; status_t status; - uint32 i; if (pos < -1) return B_BAD_VALUE; @@ -1210,7 +1208,7 @@ _kern_writev(int fd, off_t pos, const iovec* vecs, size_t count) ssize_t bytesWritten = 0; - for (i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { size_t length = vecs[i].iov_len; status = descriptor->ops->fd_write(descriptor, pos, vecs[i].iov_base, &length);