apps+libos+shell+wind: Correct a bunch of format strings
All checks were successful
Build and test / build (push) Successful in 1m41s

This commit is contained in:
apio 2024-03-29 14:42:38 +01:00
parent f9b39c5ff3
commit 7d69ac56e2
Signed by: apio
GPG Key ID: B8A7D06E42258954
7 changed files with 13 additions and 12 deletions

View File

@ -95,7 +95,7 @@ Result<int> luna_main(int argc, char** argv)
if (fds[i + 1].revents & POLLIN) clients[i]->check_for_messages();
if (fds[i + 1].revents & POLLHUP)
{
os::println("launch: Client %d disconnected", i);
os::println("launch: Client %zu disconnected", i);
fds.remove_at(i + 1);
auto client = clients.remove_at(i);
client->disconnect();

View File

@ -212,14 +212,15 @@ Result<int> luna_main(int argc, char** argv)
{
if (colors)
{
os::println("%s %u %4s %4s %10lu %s%s" RESET_COLORS "%s" SYMLINK_COLOR "%s" RESET_COLORS,
os::println("%s %lu %4s %4s %10lu %s%s" RESET_COLORS "%s" SYMLINK_COLOR "%s" RESET_COLORS,
formatted_mode, st.st_nlink, owner.chars(), group.chars(), st.st_size,
file_type_color(file), file.name.chars(), link.is_empty() ? "" : " -> ", link.chars());
}
else
{
os::println("%s %u %4s %4s %10lu %s%s%s", formatted_mode, st.st_nlink, owner.chars(), group.chars(),
st.st_size, file.name.chars(), link.is_empty() ? "" : " -> ", link.chars());
os::println("%s %lu %4s %4s %10lu %s%s%s", formatted_mode, st.st_nlink, owner.chars(),
group.chars(), st.st_size, file.name.chars(), link.is_empty() ? "" : " -> ",
link.chars());
}
}
else
@ -227,13 +228,13 @@ Result<int> luna_main(int argc, char** argv)
auto size = TRY(to_dynamic_unit(st.st_size, 10, false, si ? Unit::SI : Unit::Binary, false));
if (colors)
{
os::println("%s %u %4s %4s %6s %s%s" RESET_COLORS "%s" SYMLINK_COLOR "%s" RESET_COLORS,
os::println("%s %lu %4s %4s %6s %s%s" RESET_COLORS "%s" SYMLINK_COLOR "%s" RESET_COLORS,
formatted_mode, st.st_nlink, owner.chars(), group.chars(), size.chars(),
file_type_color(file), file.name.chars(), link.is_empty() ? "" : " -> ", link.chars());
}
else
{
os::println("%s %u %4s %4s %6s %s%s%s", formatted_mode, st.st_nlink, owner.chars(), group.chars(),
os::println("%s %lu %4s %4s %6s %s%s%s", formatted_mode, st.st_nlink, owner.chars(), group.chars(),
size.chars(), file.name.chars(), link.is_empty() ? "" : " -> ", link.chars());
}
}

View File

@ -34,7 +34,7 @@ Result<int> luna_main(int argc, char** argv)
close(fd);
}
os::println("%s"_sv, str.chars());
os::println("%s", str.chars());
return 0;
}

View File

@ -33,7 +33,7 @@ Result<int> luna_main(int argc, char** argv)
auto cmdline = TRY(String::join(command, " "));
os::println("%s %d.%.2ds user %d.%.2ds system"_sv, cmdline.chars(), usage.ru_utime.tv_sec,
os::println("%s %ld.%.2lds user %ld.%.2lds system", cmdline.chars(), usage.ru_utime.tv_sec,
usage.ru_utime.tv_usec / 10000, usage.ru_stime.tv_sec, usage.ru_stime.tv_usec / 10000);
return 0;

View File

@ -23,7 +23,7 @@ namespace os::SharedMemory
if (fd < 0)
{
int olderr = errno;
os::eprintln("os: could not create shared memory region: shm_open failed (%s) - %s", path,
os::eprintln("os: could not create shared memory region: shm_open failed (%s) - %s", path.chars(),
strerror(olderr));
return err(olderr);
}

View File

@ -144,7 +144,7 @@ Result<int> luna_main(int argc, char** argv)
{
if (maybe_cmd.error() == EINTR)
{
os::println("");
os::print("\n");
continue;
}
return maybe_cmd.release_error();
@ -200,7 +200,7 @@ Result<int> luna_main(int argc, char** argv)
int sig = WTERMSIG(status);
if (sig != SIGINT && sig != SIGQUIT) os::println("[sh] Process %d exited: %s", child, strsignal(sig));
else
os::println("");
os::print("\n");
}
}

View File

@ -186,7 +186,7 @@ Result<int> luna_main(int argc, char** argv)
if (fds[i + 4].revents & POLLHUP) clients[i]->should_be_disconnected = true;
if (clients[i]->should_be_disconnected)
{
os::println("wind: Client %d disconnected", i);
os::println("wind: Client %zu disconnected", i);
fds.remove_at(i + 4);
auto client = clients.remove_at(i);
client->conn->disconnect();