mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
Kernel: Remove obsolete size_t casts
This commit is contained in:
parent
9b14a8605a
commit
bf779e182e
8 changed files with 11 additions and 11 deletions
|
@ -17,7 +17,7 @@ KResultOr<int> Process::sys$gethostname(Userspace<char*> buffer, size_t size)
|
|||
if (size > NumericLimits<ssize_t>::max())
|
||||
return EINVAL;
|
||||
Locker locker(*g_hostname_lock, Lock::Mode::Shared);
|
||||
if ((size_t)size < (g_hostname->length() + 1))
|
||||
if (size < (g_hostname->length() + 1))
|
||||
return ENAMETOOLONG;
|
||||
if (!copy_to_user(buffer, g_hostname->characters(), g_hostname->length() + 1))
|
||||
return EFAULT;
|
||||
|
|
|
@ -179,7 +179,7 @@ KResultOr<int> Process::sys$get_thread_name(pid_t tid, Userspace<char*> buffer,
|
|||
|
||||
// We must make a temporary copy here to avoid a race with sys$set_thread_name
|
||||
auto thread_name = thread->name();
|
||||
if (thread_name.length() + 1 > (size_t)buffer_size)
|
||||
if (thread_name.length() + 1 > buffer_size)
|
||||
return ENAMETOOLONG;
|
||||
|
||||
if (!copy_to_user(buffer, thread_name.characters(), thread_name.length() + 1))
|
||||
|
|
|
@ -67,7 +67,7 @@ KResultOr<size_t> Process::do_write(FileDescription& description, const UserOrKe
|
|||
return seek_result.error();
|
||||
}
|
||||
|
||||
while ((size_t)total_nwritten < data_size) {
|
||||
while (total_nwritten < data_size) {
|
||||
while (!description.can_write()) {
|
||||
if (!description.is_blocking()) {
|
||||
if (total_nwritten > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue