From 795ffc5e62e8ba383575dbcd9943a580d4bd3358 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 15:50:21 +0200 Subject: formatting changes Manual format adjustments. Comment adjustments. Remove usage of the register keyword. --- src/fmt.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'src/fmt.c') diff --git a/src/fmt.c b/src/fmt.c index eaf98fb..77a3c93 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -1,39 +1,41 @@ #include "fmt.h" /** - @file fmt.c - @author djb - @source qmail - @brief formating differnt inputs format for output printing + @file fmt.c + @author djb + @source qmail + @brief formating differnt inputs format for output printing */ -unsigned int fmt_str(register char *s, register char *t) +unsigned int fmt_str(char *s, char *t) { - register unsigned int len; + unsigned int len; char ch; len = 0; if (s) { while ((ch = t[len])) s[len++] = ch; - } else + } else { while (t[len]) len++; + } return len; } -unsigned int fmt_strn(register char *s, register char *t, register unsigned int n) +unsigned int fmt_strn(char *s, char *t, unsigned int n) { - register unsigned int len; + unsigned int len; char ch; len = 0; if (s) { while (n-- && (ch = t[len])) s[len++] = ch; - } else + } else { while (n-- && t[len]) len++; + } return len; } -unsigned int fmt_uint(register char *s, register unsigned int u) +unsigned int fmt_uint(char *s, unsigned int u) { - register unsigned long l; + unsigned long l; l = u; return fmt_ulong(s, l); } @@ -50,10 +52,10 @@ unsigned int fmt_uint0(char *s, unsigned int u, unsigned int n) return len; } -unsigned int fmt_ulong(register char *s, register unsigned long u) +unsigned int fmt_ulong(char *s, unsigned long u) { - register unsigned int len; - register unsigned long q; + unsigned int len; + unsigned long q; len = 1; q = u; while (q > 9) { @@ -70,10 +72,10 @@ unsigned int fmt_ulong(register char *s, register unsigned long u) return len; } -unsigned int fmt_xlong(register char *s, register unsigned long u) +unsigned int fmt_xlong(char *s, unsigned long u) { - register unsigned int len; - register unsigned long q; + unsigned int len; + unsigned long q; len = 1; q = u; while (q > 15) { @@ -108,5 +110,6 @@ int fromhex(unsigned char c) return c - 'A' + 10; else if (c >= 'a' && c <= 'f') return c - 'a' + 10; - return -1; + else + return -1; } -- cgit v1.2.3