diff options
-rw-r--r-- | AK/PrintfImplementation.h | 18 | ||||
-rw-r--r-- | Kernel/FileSystem/ProcFS.cpp | 6 | ||||
-rw-r--r-- | Kernel/Scheduler.cpp | 4 | ||||
-rw-r--r-- | Userland/df.cpp | 2 | ||||
-rw-r--r-- | Userland/top.cpp | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/AK/PrintfImplementation.h b/AK/PrintfImplementation.h index 091b5b4334..e6a9495a3d 100644 --- a/AK/PrintfImplementation.h +++ b/AK/PrintfImplementation.h @@ -196,7 +196,7 @@ template<typename PutChFunc> char* bufptr = buffer; for (p = fmt; *p; ++p) { - bool leftPad = false; + bool left_pad = false; bool zeroPad = false; unsigned fieldWidth = 0; unsigned long_qualifiers = 0; @@ -204,8 +204,8 @@ template<typename PutChFunc> if (*p == '%' && *(p + 1)) { one_more: ++p; - if (*p == ' ') { - leftPad = true; + if (*p == '-') { + left_pad = true; if (*(p + 1)) goto one_more; } @@ -233,19 +233,19 @@ template<typename PutChFunc> switch (*p) { case 's': { const char* sp = va_arg(ap, const char*); - ret += print_string(putch, bufptr, sp ? sp : "(null)", leftPad, fieldWidth); + ret += print_string(putch, bufptr, sp ? sp : "(null)", left_pad, fieldWidth); } break; case 'd': - ret += print_signed_number(putch, bufptr, va_arg(ap, int), leftPad, zeroPad, fieldWidth); + ret += print_signed_number(putch, bufptr, va_arg(ap, int), left_pad, zeroPad, fieldWidth); break; case 'u': - ret += print_number(putch, bufptr, va_arg(ap, dword), leftPad, zeroPad, fieldWidth); + ret += print_number(putch, bufptr, va_arg(ap, dword), left_pad, zeroPad, fieldWidth); break; case 'Q': - ret += print_qword(putch, bufptr, va_arg(ap, qword), leftPad, zeroPad, fieldWidth); + ret += print_qword(putch, bufptr, va_arg(ap, qword), left_pad, zeroPad, fieldWidth); break; case 'q': @@ -256,7 +256,7 @@ template<typename PutChFunc> case 'g': case 'f': // FIXME: Print as float! - ret += print_signed_qword(putch, bufptr, (qword)va_arg(ap, double), leftPad, zeroPad, fieldWidth); + ret += print_signed_qword(putch, bufptr, (qword)va_arg(ap, double), left_pad, zeroPad, fieldWidth); break; #endif @@ -265,7 +265,7 @@ template<typename PutChFunc> putch(bufptr, '0'); ++ret; } - ret += print_octal_number(putch, bufptr, va_arg(ap, dword), leftPad, zeroPad, fieldWidth); + ret += print_octal_number(putch, bufptr, va_arg(ap, dword), left_pad, zeroPad, fieldWidth); break; case 'x': diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index 06f6cb3f1d..fc712e9e99 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -196,7 +196,7 @@ ByteBuffer procfs$pid_fds(InodeIdentifier identifier) auto* description = process.file_description(i); if (!description) continue; - builder.appendf("% 3u %s\n", i, description->absolute_path().characters()); + builder.appendf("%-3u %s\n", i, description->absolute_path().characters()); } return builder.to_byte_buffer(); } @@ -228,7 +228,7 @@ ByteBuffer procfs$pid_vm(InodeIdentifier identifier) flags_builder.append('R'); if (region->is_writable()) flags_builder.append('W'); - builder.appendf("%x -- %x %x %x % 4s %s\n", + builder.appendf("%x -- %x %x %x %-4s %s\n", region->vaddr().get(), region->vaddr().offset(region->size() - 1).get(), region->size(), @@ -544,7 +544,7 @@ ByteBuffer procfs$summary(InodeIdentifier) StringBuilder builder; builder.appendf("PID TPG PGP SID OWNER STATE PPID NSCHED FDS TTY NAME\n"); for (auto* process : processes) { - builder.appendf("% 3u % 3u % 3u % 3u % 4u % 8s % 3u % 9u % 3u % 4s %s\n", + builder.appendf("%-3u %-3u %-3u %-3u %-4u %-8s %-3u %-9u %-3u %-4s %s\n", process->pid(), process->tty() ? process->tty()->pgid() : 0, process->pgid(), diff --git a/Kernel/Scheduler.cpp b/Kernel/Scheduler.cpp index 5ddae383a5..41438ab66f 100644 --- a/Kernel/Scheduler.cpp +++ b/Kernel/Scheduler.cpp @@ -231,13 +231,13 @@ bool Scheduler::pick_next() dbgprintf("Non-runnables:\n"); for (auto* thread = g_nonrunnable_threads->head(); thread; thread = thread->next()) { auto* process = &thread->process(); - dbgprintf("[K%x] % 12s %s(%u:%u) @ %w:%x\n", process, to_string(thread->state()), process->name().characters(), process->pid(), thread->tid(), thread->tss().cs, thread->tss().eip); + dbgprintf("[K%x] %-12s %s(%u:%u) @ %w:%x\n", process, to_string(thread->state()), process->name().characters(), process->pid(), thread->tid(), thread->tss().cs, thread->tss().eip); } dbgprintf("Runnables:\n"); for (auto* thread = g_runnable_threads->head(); thread; thread = thread->next()) { auto* process = &thread->process(); - dbgprintf("[K%x] % 12s %s(%u:%u) @ %w:%x\n", process, to_string(thread->state()), process->name().characters(), process->pid(), thread->tid(), thread->tss().cs, thread->tss().eip); + dbgprintf("[K%x] %-12s %s(%u:%u) @ %w:%x\n", process, to_string(thread->state()), process->name().characters(), process->pid(), thread->tid(), thread->tss().cs, thread->tss().eip); } #endif diff --git a/Userland/df.cpp b/Userland/df.cpp index 875aaa0d11..e1600ae812 100644 --- a/Userland/df.cpp +++ b/Userland/df.cpp @@ -45,7 +45,7 @@ int main(int, char**) (void)total_inode_count; (void)free_inode_count; - printf("% 10s", fs.characters()); + printf("%-10s", fs.characters()); printf("%10u ", total_block_count); printf("%10u ", total_block_count - free_block_count); printf("%10u ", free_block_count); diff --git a/Userland/top.cpp b/Userland/top.cpp index 4f5a07f60d..aeebd98622 100644 --- a/Userland/top.cpp +++ b/Userland/top.cpp @@ -88,7 +88,7 @@ int main(int, char**) auto sum_diff = current.sum_nsched - prev.sum_nsched; printf("\033[3J\033[H\033[2J"); - printf("\033[47;30m%6s %3s % 8s % 8s %6s %6s %4s %s\033[K\033[0m\n", + printf("\033[47;30m%6s %3s %-8s %-8s %6s %6s %4s %s\033[K\033[0m\n", "PID", "PRI", "USER", @@ -118,7 +118,7 @@ int main(int, char**) }); for (auto* process : processes) { - printf("%6d %c % 8s % 8s %6u %6u %2u.%1u %s\n", + printf("%6d %c %-8s %-8s %6u %6u %2u.%1u %s\n", process->pid, process->priority[0], process->user.characters(), |