svn commit: trunk/uClibc/ldso/include

vapier at uclibc.org vapier at uclibc.org
Tue Jan 17 00:59:10 UTC 2006


Author: vapier
Date: 2006-01-16 16:59:09 -0800 (Mon, 16 Jan 2006)
New Revision: 13375

Log:
cleanup whitespace

Modified:
   trunk/uClibc/ldso/include/dl-string.h


Changeset:
Modified: trunk/uClibc/ldso/include/dl-string.h
===================================================================
--- trunk/uClibc/ldso/include/dl-string.h	2006-01-17 00:55:04 UTC (rev 13374)
+++ trunk/uClibc/ldso/include/dl-string.h	2006-01-17 00:59:09 UTC (rev 13375)
@@ -33,8 +33,8 @@
 static __always_inline size_t _dl_strlen(const char * str)
 {
 	register const char *ptr = (char *) str-1;
-
-	while (*++ptr);
+	while (*++ptr)
+		;/* empty */
 	return (ptr - str);
 }
 
@@ -56,7 +56,8 @@
 	register char *ptr = dst;
 
 	dst--;src--;
-	while ((*++dst = *++src) != 0);
+	while ((*++dst = *++src) != 0)
+		;/* empty */
 
 	return ptr;
 }
@@ -70,8 +71,7 @@
 		c2 = (unsigned char) *++s2;
 		if (c1 == '\0')
 			return c1 - c2;
-	}
-	while (c1 == c2);
+	} while (c1 == c2);
 
 	return c1 - c2;
 }
@@ -105,40 +105,38 @@
 	return 0;
 }
 
-static inline char * _dl_strrchr(const char *str, int c)
+static __always_inline char * _dl_strrchr(const char *str, int c)
 {
-    register char *prev = 0;
-    register char *ptr = (char *) str-1;
+	register char *prev = 0;
+	register char *ptr = (char *) str-1;
 
-    while (*++ptr != '\0') {
-	if (*ptr == c)
-	    prev = ptr;
-    }
-    if (c == '\0')
-	return(ptr);
-    return(prev);
+	while (*++ptr != '\0') {
+		if (*ptr == c)
+			prev = ptr;
+	}
+	if (c == '\0')
+		return(ptr);
+	return(prev);
 }
 
-static inline char * _dl_strstr(const char *s1, const char *s2)
+static __always_inline char * _dl_strstr(const char *s1, const char *s2)
 {
-    register const char *s = s1;
-    register const char *p = s2;
+	register const char *s = s1;
+	register const char *p = s2;
 
-    do {
-        if (!*p) {
-	    return (char *) s1;;
-	}
-	if (*p == *s) {
-	    ++p;
-	    ++s;
-	} else {
-	    p = s2;
-	    if (!*s) {
-	      return NULL;
-	    }
-	    s = ++s1;
-	}
-    } while (1);
+	do {
+		if (!*p)
+			return (char *) s1;;
+		if (*p == *s) {
+			++p;
+			++s;
+		} else {
+			p = s2;
+			if (!*s)
+				return NULL;
+			s = ++s1;
+		}
+	} while (1);
 }
 
 static __always_inline void * _dl_memcpy(void * dst, const void * src, size_t len)
@@ -170,27 +168,28 @@
 /* Will generate smaller and faster code due to loop unrolling.*/
 static __always_inline void * _dl_memset(void *to, int c, size_t n)
 {
-        unsigned long chunks;
-        unsigned long *tmp_to;
+	unsigned long chunks;
+	unsigned long *tmp_to;
 	unsigned char *tmp_char;
 
-        chunks = n / 4;
-        tmp_to = to + n;
-        c = c << 8 | c;
-        c = c << 16 | c;
-        if (!chunks)
-                goto lessthan4;
-        do {
-                *--tmp_to = c;
-        } while (--chunks);
- lessthan4:
-        n = n % 4;
-        if (!n ) return to;
-        tmp_char = (unsigned char *)tmp_to;
-        do {
-                *--tmp_char = c;
-        } while (--n);
-        return to;
+	chunks = n / 4;
+	tmp_to = to + n;
+	c = c << 8 | c;
+	c = c << 16 | c;
+	if (!chunks)
+		goto lessthan4;
+	do {
+		*--tmp_to = c;
+	} while (--chunks);
+lessthan4:
+	n = n % 4;
+	if (!n)
+		return to;
+	tmp_char = (unsigned char *)tmp_to;
+	do {
+		*--tmp_char = c;
+	} while (--n);
+	return to;
 }
 #else
 static __always_inline void * _dl_memset(void * str,int c,size_t len)
@@ -232,10 +231,10 @@
 	char *p = &local[22];
 	*--p = '\0';
 	do {
-	    char temp;
-	    do_rem(temp, i, 10);
-	    *--p = '0' + temp;
-	    i /= 10;
+		char temp;
+		do_rem(temp, i, 10);
+		*--p = '0' + temp;
+		i /= 10;
 	} while (i > 0);
 	return p;
 }
@@ -249,9 +248,9 @@
 	do {
 		char temp = i & 0xf;
 		if (temp <= 0x09)
-		    *--p = '0' + temp;
+			*--p = '0' + temp;
 		else
-		    *--p = 'a' - 0x0a + temp;
+			*--p = 'a' - 0x0a + temp;
 		i >>= 4;
 	} while (i > 0);
 	*--p = 'x';
@@ -277,8 +276,8 @@
 
 /* On some arches constant strings are referenced through the GOT.
  * This requires that load_addr must already be defined... */
-#if defined(mc68000) || defined(__arm__) || defined(__mips__)	\
-                     || defined(__sh__) ||  defined(__powerpc__)
+#if defined(mc68000) || defined(__arm__) || defined(__mips__) \
+                     || defined(__sh__)  || defined(__powerpc__)
 # define CONSTANT_STRING_GOT_FIXUP(X) \
 	if ((X) < (const char *) load_addr) (X) += load_addr
 # define NO_EARLY_SEND_STDERR




More information about the uClibc-cvs mailing list