summaryrefslogtreecommitdiff
path: root/kernel/libc/stdio
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-02-21 00:14:29 +0100
committerAnton Kling <anton@kling.gg>2024-02-21 00:14:29 +0100
commit8ff63b062d724826d8017504063df9b92f8e6703 (patch)
tree03bf0b5a278a4908da8912f956e5651bea9412f1 /kernel/libc/stdio
parenta85eacdd2406fede4d6ff5cb130b1758978cabb3 (diff)
New clang-format options
Diffstat (limited to 'kernel/libc/stdio')
-rw-r--r--kernel/libc/stdio/print.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/libc/stdio/print.c b/kernel/libc/stdio/print.c
index fe50f50..93393ee 100644
--- a/kernel/libc/stdio/print.c
+++ b/kernel/libc/stdio/print.c
@@ -23,12 +23,14 @@ int kprint_hex(u64 num) {
char str[16] = {0};
int i = 0;
- for (; num != 0 && i < 16; i++, num /= 16)
+ for (; num != 0 && i < 16; i++, num /= 16) {
str[i] = HEX_SET[(num % 16)];
+ }
c += i;
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--) {
putc(str[i]);
+ }
return c;
}
@@ -42,12 +44,14 @@ int kprint_int(int num) {
}
char str[10];
int i = 0;
- for (; num != 0 && i < 10; i++, num /= 10)
+ for (; num != 0 && i < 10; i++, num /= 10) {
str[i] = (num % 10) + '0';
+ }
c += i;
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--) {
putc(str[i]);
+ }
return c;
}
@@ -65,8 +69,9 @@ int kprintf(const char *format, ...) {
}
char flag = *(s + 1);
- if ('\0' == flag)
+ if ('\0' == flag) {
break;
+ }
switch (flag) {
case 'c':