From f495cc1e93710c233292a503720ec235a61b685c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 18 Mar 2020 17:32:50 +0100 Subject: Applied official linux kernel code style guidelines Due to my change to vim and the clang-format plugin this was needed! --- src/kernel/lib/stdlib/htoa.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/kernel/lib/stdlib/htoa.c') diff --git a/src/kernel/lib/stdlib/htoa.c b/src/kernel/lib/stdlib/htoa.c index 49ca703..ee639ec 100644 --- a/src/kernel/lib/stdlib/htoa.c +++ b/src/kernel/lib/stdlib/htoa.c @@ -6,25 +6,26 @@ static const char HTOA_TABLE[] = "0123456789ABCDEF"; char *htoa(uint32_t n) { - char *ret = (char *) kmalloc(10); + char *ret = (char *)kmalloc(10); - int i = 0; - while (n) { - ret[i++] = HTOA_TABLE[n & 0xF]; - n >>= 4; - } + int i = 0; + while (n) { + ret[i++] = HTOA_TABLE[n & 0xF]; + n >>= 4; + } - if (!i) { - ret[0] = '0'; - i++; - } + if (!i) { + ret[0] = '0'; + i++; + } - for (; i <= 9; i++) ret[i] = 0; + for (; i <= 9; i++) + ret[i] = 0; - char *aux = strdup(ret); - kfree(ret); - ret = aux; + char *aux = strdup(ret); + kfree(ret); + ret = aux; - strinv(ret); - return ret; + strinv(ret); + return ret; } \ No newline at end of file -- cgit v1.2.3