OSDN Git Service

improve readability of string: fix indentation and remove trailing spaces
authorAndré Goddard Rosa <andre.goddard@gmail.com>
Sun, 31 Jan 2010 00:28:49 +0000 (22:28 -0200)
committerAndré Goddard Rosa <andre.goddard@gmail.com>
Sun, 31 Jan 2010 00:28:49 +0000 (22:28 -0200)
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
13 files changed:
libc/string/strcasecmp.c
libc/string/strchr.c
libc/string/strcoll.c
libc/string/strlcat.c
libc/string/strlcpy.c
libc/string/strncat.c
libc/string/strncmp.c
libc/string/strncpy.c
libc/string/strpbrk.c
libc/string/strrchr.c
libc/string/strsep.c
libc/string/strstr.c
libc/string/strxfrm.c

index 12f3a09..2be0913 100644 (file)
@@ -98,8 +98,8 @@ strncasecmp(const char *s1, const char *s2, size_t n)
                        if (cm[*us1] != cm[*us2++])
                                return (cm[*us1] - cm[*--us2]);
                        if (*us1++ == '\0')
-      break;
+                               break;
                } while (--n != 0);
-  }
+       }
        return (0);
 }
index e33694c..31ba4e2 100644 (file)
@@ -38,6 +38,6 @@ strchr(const char *p, int ch)
                        return((char *)p);
                if (!*p)
                        return((char *)NULL);
-  }
+       }
        /* NOTREACHED */
 }
index 365cad5..e3b1ec3 100755 (executable)
@@ -36,5 +36,5 @@
 int
 strcoll(const char *s1, const char *s2)
 {
-       return strcmp (s1, s2);
+       return strcmp(s1, s2);
 }
index ad2215b..ceab094 100644 (file)
@@ -46,9 +46,9 @@ strlcat(char *dst, const char *src, size_t siz)
                if (n != 1) {
                        *d++ = *s;
                        n--;
-  }
+               }
                s++;
-  }
+       }
        *d = '\0';
 
        return(dlen + (s - src));       /* count does not include NUL */
index 38277eb..d32b659 100644 (file)
@@ -37,7 +37,7 @@ strlcpy(char *dst, const char *src, size_t siz)
                        if ((*d++ = *s++) == '\0')
                                break;
                }
-  }
+       }
 
        /* Not enough room in dst, add NUL and traverse rest of src */
        if (n == 0) {
index 1cb9405..c4df4f2 100644 (file)
@@ -52,6 +52,6 @@ strncat(char *dst, const char *src, size_t n)
                        d++;
                } while (--n != 0);
                *d = 0;
-  }
+       }
        return (dst);
 }
index 9da41ab..1768808 100644 (file)
 int
 strncmp(const char *s1, const char *s2, size_t n)
 {
-
        if (n == 0)
                return (0);
        do {
                if (*s1 != *s2++)
                        return (*(unsigned char *)s1 - *(unsigned char *)--s2);
                if (*s1++ == 0)
-      break;
+                       break;
        } while (--n != 0);
        return (0);
 }
index b91091b..4426cbe 100644 (file)
@@ -54,8 +54,8 @@ strncpy(char *dst, const char *src, size_t n)
                                /* NUL pad the remaining n-1 bytes */
                                while (--n != 0)
                                        *d++ = 0;
-      break;
-  }
+                               break;
+                       }
                } while (--n != 0);
        }
        return (dst);
index 6ba3796..cd3b71c 100644 (file)
@@ -38,7 +38,7 @@ strpbrk(const char *s1, const char *s2)
 {
        const char *scanp;
        int c, sc;
-  
+
        while ((c = *s1++) != 0) {
                for (scanp = s2; (sc = *scanp++) != 0;)
                        if (sc == c)
index 2800781..4918f82 100644 (file)
@@ -34,12 +34,12 @@ char *
 strrchr(const char *p, int ch)
 {
        char *save;
-  
+
        for (save = NULL;; ++p) {
                if (*p == ch)
                        save = (char *)p;
                if (!*p)
                        return(save);
-  }
+       }
        /* NOTREACHED */
 }
index bcca681..c44bc5b 100644 (file)
@@ -34,7 +34,7 @@
 
 /*
  * Get next token from string *stringp, where tokens are possibly-empty
- * strings separated by characters from delim.  
+ * strings separated by characters from delim.
  *
  * Writes NULs into the string at *stringp to end tokens.
  * delim need not remain constant from call to call.
index debe96c..95a865b 100644 (file)
@@ -51,6 +51,6 @@ strstr(const char *s, const char *find)
                        } while (sc != c);
                } while (strncmp(s, find, len) != 0);
                s--;
-    }
+       }
        return ((char *)s);
 }
index f1843b5..3c4d707 100755 (executable)
@@ -29,7 +29,7 @@
 
 /*
  * Transform string s2 to string s1 using the current locale so that
- * strcmp of transformed strings yields the same result as strcoll. 
+ * strcmp of transformed strings yields the same result as strcoll.
  * Since Bionic really does not support locales, we assume we always use
  * the C locale.
  *