summaryrefslogtreecommitdiff
path: root/src/fmt.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-09 15:50:21 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-09 15:50:21 +0200
commit795ffc5e62e8ba383575dbcd9943a580d4bd3358 (patch)
treec128889056202b255e2f22afeb7717894d350862 /src/fmt.c
parent5fadc0cbb8577c61d66bd6f19ceaf0507c11e23b (diff)
formatting changes
Manual format adjustments. Comment adjustments. Remove usage of the register keyword.
Diffstat (limited to 'src/fmt.c')
-rw-r--r--src/fmt.c41
1 files changed, 22 insertions, 19 deletions
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;
}