OSDN Git Service

alpha: Add some spaces to ensure format specification
authorZhang Jiaming <jiaming@nfschina.com>
Tue, 21 Jun 2022 08:15:06 +0000 (16:15 +0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 14 Feb 2023 17:37:18 +0000 (12:37 -0500)
Add a space after ','.
Add spaces around the '=', '>' and '=='.

Signed-off-by: Zhang Jiaming <jiaming@nfschina.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
arch/alpha/boot/stdio.c

index 60f73cc..e6d1ebf 100644 (file)
@@ -42,8 +42,8 @@ static int skip_atoi(const char **s)
 
 static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
 {
-       char c,sign,tmp[66];
-       const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
+       char c, sign, tmp[66];
+       const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
        int i;
 
        if (type & LARGE)
@@ -83,14 +83,14 @@ static char * number(char * str, unsigned long long num, int base, int size, int
                precision = i;
        size -= precision;
        if (!(type&(ZEROPAD+LEFT)))
-               while(size-->0)
+               while (size-- > 0)
                        *str++ = ' ';
        if (sign)
                *str++ = sign;
        if (type & SPECIAL) {
                if (base==8)
                        *str++ = '0';
-               else if (base==16) {
+               else if (base == 16) {
                        *str++ = '0';
                        *str++ = digits[33];
                }
@@ -125,7 +125,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
                                /* 'z' changed to 'Z' --davidm 1/25/99 */
 
 
-       for (str=buf ; *fmt ; ++fmt) {
+       for (str = buf ; *fmt ; ++fmt) {
                if (*fmt != '%') {
                        *str++ = *fmt;
                        continue;
@@ -296,7 +296,7 @@ int sprintf(char * buf, const char *fmt, ...)
        int i;
 
        va_start(args, fmt);
-       i=vsprintf(buf,fmt,args);
+       i = vsprintf(buf, fmt, args);
        va_end(args);
        return i;
 }