svn commit: trunk/uClibc/libc/stdlib

vda at uclibc.org vda at uclibc.org
Mon Jun 2 23:22:44 UTC 2008


Author: vda
Date: 2008-06-02 16:22:43 -0700 (Mon, 02 Jun 2008)
New Revision: 22192

Log:
libc/stdlib/stdlib.c: fix whitespace damage. No code changes
(verified with objdump)



Modified:
   trunk/uClibc/libc/stdlib/stdlib.c


Changeset:
Modified: trunk/uClibc/libc/stdlib/stdlib.c
===================================================================
--- trunk/uClibc/libc/stdlib/stdlib.c	2008-06-02 23:21:40 UTC (rev 22191)
+++ trunk/uClibc/libc/stdlib/stdlib.c	2008-06-02 23:22:43 UTC (rev 22192)
@@ -328,9 +328,9 @@
 
 libc_hidden_proto(__XL_NPP(strtol))
 long __XL_NPP(strtol)(const char * __restrict str, char ** __restrict endptr,
-				  int base   __LOCALE_PARAM )
+				  int base __LOCALE_PARAM)
 {
-    return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 1   __LOCALE_ARG );
+	return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 1 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(strtol))
 
@@ -359,10 +359,9 @@
 libc_hidden_proto(__XL_NPP(strtoll))
 long long __XL_NPP(strtoll)(const char * __restrict str,
 						char ** __restrict endptr, int base
-						__LOCALE_PARAM )
+						__LOCALE_PARAM)
 {
-    return (long long) __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 1
-												  __LOCALE_ARG );
+	return (long long) __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 1 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(strtoll))
 
@@ -382,9 +381,9 @@
 libc_hidden_proto(__XL_NPP(strtoul))
 unsigned long __XL_NPP(strtoul)(const char * __restrict str,
 							char ** __restrict endptr, int base
-							__LOCALE_PARAM )
+							__LOCALE_PARAM)
 {
-    return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 0   __LOCALE_ARG );
+	return __XL_NPP(_stdlib_strto_l)(str, endptr, base, 0 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(strtoul))
 
@@ -414,9 +413,9 @@
 libc_hidden_proto(__XL_NPP(strtoull))
 unsigned long long __XL_NPP(strtoull)(const char * __restrict str,
 								  char ** __restrict endptr, int base
-								  __LOCALE_PARAM )
+								  __LOCALE_PARAM)
 {
-    return __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 0   __LOCALE_ARG );
+	return __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 0 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(strtoull))
 
@@ -511,31 +510,31 @@
 										Wchar ** __restrict endptr, int base,
 										int sflag __LOCALE_PARAM)
 {
-    unsigned long number, cutoff;
+	unsigned long number, cutoff;
 #if _STRTO_ENDPTR
-    const Wchar *fail_char;
-#define SET_FAIL(X)       fail_char = (X)
+	const Wchar *fail_char;
+#define SET_FAIL(X) fail_char = (X)
 #else
-#define SET_FAIL(X)       ((void)(X)) /* Keep side effects. */
+#define SET_FAIL(X) ((void)(X)) /* Keep side effects. */
 #endif
-    unsigned char negative, digit, cutoff_digit;
+	unsigned char negative, digit, cutoff_digit;
 
 	assert(((unsigned int)sflag) <= 1);
 
 	SET_FAIL(str);
 
-    while (ISSPACE(*str)) { /* Skip leading whitespace. */
+	while (ISSPACE(*str)) { /* Skip leading whitespace. */
 		++str;
-    }
+	}
 
-    /* Handle optional sign. */
-    negative = 0;
-    switch (*str) {
+	/* Handle optional sign. */
+	negative = 0;
+	switch (*str) {
 		case '-': negative = 1;	/* Fall through to increment str. */
 		case '+': ++str;
-    }
+	}
 
-    if (!(base & ~0x10)) {		/* Either dynamic (base = 0) or base 16. */
+	if (!(base & ~0x10)) {		/* Either dynamic (base = 0) or base 16. */
 		base += 10;				/* Default is 10 (26). */
 		if (*str == '0') {
 			SET_FAIL(++str);
@@ -549,11 +548,11 @@
 		if (base > 16) {		/* Adjust in case base wasn't dynamic. */
 			base = 16;
 		}
-    }
+	}
 
 	number = 0;
 
-    if (((unsigned)(base - 2)) < 35) { /* Legal base. */
+	if (((unsigned)(base - 2)) < 35) { /* Legal base. */
 		cutoff_digit = ULONG_MAX % base;
 		cutoff = ULONG_MAX / base;
 		do {
@@ -581,13 +580,13 @@
 	}
 
 #if _STRTO_ENDPTR
-    if (endptr) {
+	if (endptr) {
 		*endptr = (Wchar *) fail_char;
-    }
+	}
 #endif
 
 	{
-		unsigned long tmp = ((negative)
+		unsigned long tmp = (negative
 							 ? ((unsigned long)(-(1+LONG_MIN)))+1
 							 : LONG_MAX);
 		if (sflag && (number > tmp)) {
@@ -661,34 +660,34 @@
 
 unsigned long long attribute_hidden __XL_NPP(_stdlib_strto_ll)(register const Wchar * __restrict str,
 											  Wchar ** __restrict endptr, int base,
-											  int sflag   __LOCALE_PARAM )
+											  int sflag __LOCALE_PARAM)
 {
-    unsigned long long number;
+	unsigned long long number;
 #if _STRTO_ENDPTR
-    const Wchar *fail_char;
-#define SET_FAIL(X)       fail_char = (X)
+	const Wchar *fail_char;
+#define SET_FAIL(X) fail_char = (X)
 #else
-#define SET_FAIL(X)       ((void)(X)) /* Keep side effects. */
+#define SET_FAIL(X) ((void)(X)) /* Keep side effects. */
 #endif
 	unsigned int n1;
-    unsigned char negative, digit;
+	unsigned char negative, digit;
 
 	assert(((unsigned int)sflag) <= 1);
 
 	SET_FAIL(str);
 
-    while (ISSPACE(*str)) {		/* Skip leading whitespace. */
+	while (ISSPACE(*str)) {		/* Skip leading whitespace. */
 		++str;
-    }
+	}
 
-    /* Handle optional sign. */
-    negative = 0;
-    switch (*str) {
+	/* Handle optional sign. */
+	negative = 0;
+	switch (*str) {
 		case '-': negative = 1;	/* Fall through to increment str. */
 		case '+': ++str;
-    }
+	}
 
-    if (!(base & ~0x10)) {		/* Either dynamic (base = 0) or base 16. */
+	if (!(base & ~0x10)) {		/* Either dynamic (base = 0) or base 16. */
 		base += 10;				/* Default is 10 (26). */
 		if (*str == '0') {
 			SET_FAIL(++str);
@@ -702,11 +701,11 @@
 		if (base > 16) {		/* Adjust in case base wasn't dynamic. */
 			base = 16;
 		}
-    }
+	}
 
 	number = 0;
 
-    if (((unsigned)(base - 2)) < 35) { /* Legal base. */
+	if (((unsigned)(base - 2)) < 35) { /* Legal base. */
 		do {
 			digit = ((Wuchar)(*str - '0') <= 9)
 				? /* 0..9 */ (*str - '0')
@@ -743,9 +742,9 @@
 	}
 
 #if _STRTO_ENDPTR
-    if (endptr) {
+	if (endptr) {
 		*endptr = (Wchar *) fail_char;
-    }
+	}
 #endif
 
 	{
@@ -818,16 +817,16 @@
  * bcc and gcc. */
 
 libc_hidden_proto(qsort)
-void qsort (void  *base,
-            size_t nel,
-            size_t width,
-            int (*comp)(const void *, const void *))
+void qsort(void  *base,
+           size_t nel,
+           size_t width,
+           int (*comp)(const void *, const void *))
 {
 	size_t wgap, i, j, k;
 	char tmp;
 
 	if ((nel > 1) && (width > 0)) {
-		assert( nel <= ((size_t)(-1)) / width ); /* check for overflow */
+		assert(nel <= ((size_t)(-1)) / width); /* check for overflow */
 		wgap = 0;
 		do {
 			wgap = 3 * wgap + 1;
@@ -847,7 +846,7 @@
 					j -= wgap;
 					a = j + ((char *)base);
 					b = a + wgap;
-					if ( (*comp)(a, b) <= 0 ) {
+					if ((*comp)(a, b) <= 0) {
 						break;
 					}
 					k = width;
@@ -855,7 +854,7 @@
 						tmp = *a;
 						*a++ = *b;
 						*b++ = tmp;
-					} while ( --k );
+					} while (--k);
 				} while (j >= wgap);
 				i += width;
 			} while (i < nel);
@@ -876,40 +875,36 @@
 
 #include <stddef.h>
 
-void ssort (void  *base,
-            size_t nel,
-            size_t width,
-            int (*comp)(const void *, const void *))
+void ssort(void  *base,
+           size_t nel,
+           size_t width,
+           int (*comp)(const void *, const void *))
 {
-      size_t wnel, gap, wgap, i, j, k;
-      char *a, *b, tmp;
+	size_t wnel, gap, wgap, i, j, k;
+	char *a, *b, tmp;
 
-      wnel = width * nel;
-      for (gap = 0; ++gap < nel;)
-            gap *= 3;
-      while ( gap /= 3 )
-      {
-            wgap = width * gap;
-            for (i = wgap; i < wnel; i += width)
-            {
-                  for (j = i - wgap; ;j -= wgap)
-                  {
-                        a = j + (char *)base;
-                        b = a + wgap;
-                        if ( (*comp)(a, b) <= 0 )
-                              break;
-                        k = width;
-                        do
-                        {
-                              tmp = *a;
-                              *a++ = *b;
-                              *b++ = tmp;
-                        } while ( --k );
-                        if (j < wgap)
-                              break;
-                  }
-            }
-      }
+	wnel = width * nel;
+	for (gap = 0; ++gap < nel;)
+		gap *= 3;
+	while ((gap /= 3) != 0) {
+		wgap = width * gap;
+		for (i = wgap; i < wnel; i += width) {
+			for (j = i - wgap; ;j -= wgap) {
+				a = j + (char *)base;
+				b = a + wgap;
+				if ((*comp)(a, b) <= 0)
+					break;
+				k = width;
+				do {
+					tmp = *a;
+					*a++ = *b;
+					*b++ = tmp;
+				} while (--k);
+				if (j < wgap)
+					break;
+			}
+		}
+	}
 }
 #endif
 
@@ -1045,9 +1040,9 @@
 
 libc_hidden_proto(__XL_NPP(wcstol))
 long __XL_NPP(wcstol)(const wchar_t * __restrict str,
-				  wchar_t ** __restrict endptr, int base   __LOCALE_PARAM )
+				  wchar_t ** __restrict endptr, int base __LOCALE_PARAM)
 {
-    return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 1   __LOCALE_ARG );
+	return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 1 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(wcstol))
 
@@ -1076,10 +1071,9 @@
 libc_hidden_proto(__XL_NPP(wcstoll))
 long long __XL_NPP(wcstoll)(const wchar_t * __restrict str,
 						wchar_t ** __restrict endptr, int base
-						__LOCALE_PARAM )
+						__LOCALE_PARAM)
 {
-    return (long long) __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 1
-												  __LOCALE_ARG );
+	return (long long) __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 1 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(wcstoll))
 
@@ -1099,9 +1093,9 @@
 libc_hidden_proto(__XL_NPP(wcstoul))
 unsigned long __XL_NPP(wcstoul)(const wchar_t * __restrict str,
 							wchar_t ** __restrict endptr, int base
-							__LOCALE_PARAM )
+							__LOCALE_PARAM)
 {
-    return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 0   __LOCALE_ARG );
+	return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 0 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(wcstoul))
 
@@ -1130,9 +1124,9 @@
 libc_hidden_proto(__XL_NPP(wcstoull))
 unsigned long long __XL_NPP(wcstoull)(const wchar_t * __restrict str,
 								  wchar_t ** __restrict endptr, int base
-								  __LOCALE_PARAM )
+								  __LOCALE_PARAM)
 {
-    return __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 0   __LOCALE_ARG );
+	return __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 0 __LOCALE_ARG);
 }
 libc_hidden_def(__XL_NPP(wcstoull))
 




More information about the uClibc-cvs mailing list