diff options
author | Marvin Borner | 2020-03-18 17:32:50 +0100 |
---|---|---|
committer | Marvin Borner | 2020-03-18 17:32:50 +0100 |
commit | f495cc1e93710c233292a503720ec235a61b685c (patch) | |
tree | 23b0b4b82b6d80001c1ffdb15f00b93cbdc65722 /src/kernel/lib/stdio/vprintf.c | |
parent | c6657aac0c5d5ecf347bc082cb6df38e1174d297 (diff) |
Applied official linux kernel code style guidelines
Due to my change to vim and the clang-format plugin this was needed!
Diffstat (limited to 'src/kernel/lib/stdio/vprintf.c')
-rw-r--r-- | src/kernel/lib/stdio/vprintf.c | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/src/kernel/lib/stdio/vprintf.c b/src/kernel/lib/stdio/vprintf.c index af8e47f..b9188c6 100644 --- a/src/kernel/lib/stdio/vprintf.c +++ b/src/kernel/lib/stdio/vprintf.c @@ -7,47 +7,48 @@ void _writes(const char *data) { - for (size_t i = 0; i < strlen(data); i++) writec(data[i]); + for (size_t i = 0; i < strlen(data); i++) + writec(data[i]); } void vprintf(const char *fmt, va_list args) { - uint8_t readyToFormat = 0; + uint8_t readyToFormat = 0; - char buff = 0; + char buff = 0; - for (; *fmt; fmt++) { - if (readyToFormat) { - if (*fmt == '%') { - writec('%'); - readyToFormat = 0; - continue; - } + for (; *fmt; fmt++) { + if (readyToFormat) { + if (*fmt == '%') { + writec('%'); + readyToFormat = 0; + continue; + } - buff = *fmt; - if (buff == 's') { - const char *str = va_arg(args, const char*); - _writes(str); - readyToFormat = 0; - } else if (buff == 'x') { - char *p = htoa((uint32_t) va_arg(args, int)); - _writes(p); - kfree(p); - readyToFormat = 0; - } else if (buff == 'd') { - char *p = itoa(va_arg(args, int)); - _writes(p); - kfree(p); - readyToFormat = 0; - } else if (buff == 'c') { - writec((char) va_arg(args, int)); - readyToFormat = 0; - } - } else { - if (*fmt == '%') - readyToFormat = 1; - else - writec(*fmt); - } - } + buff = *fmt; + if (buff == 's') { + const char *str = va_arg(args, const char *); + _writes(str); + readyToFormat = 0; + } else if (buff == 'x') { + char *p = htoa((uint32_t)va_arg(args, int)); + _writes(p); + kfree(p); + readyToFormat = 0; + } else if (buff == 'd') { + char *p = itoa(va_arg(args, int)); + _writes(p); + kfree(p); + readyToFormat = 0; + } else if (buff == 'c') { + writec((char)va_arg(args, int)); + readyToFormat = 0; + } + } else { + if (*fmt == '%') + readyToFormat = 1; + else + writec(*fmt); + } + } }
\ No newline at end of file |