improve readability of stdlib: fix indentation and remove trailing spaces

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>

Change-Id: I7dd90a0816b5376ffc1de4499d56935e0bd574a1
This commit is contained in:
André Goddard Rosa 2010-02-05 18:32:52 -02:00 committed by Jean-Baptiste Queru
parent 1698d9ebfc
commit e734769276
11 changed files with 230 additions and 232 deletions

View File

@ -49,6 +49,6 @@ __assert2(const char *file, int line, const char *func, const char *failedexpr)
(void)fprintf(stderr, (void)fprintf(stderr,
"assertion \"%s\" failed: file \"%s\", line %d, function \"%s\"\n", "assertion \"%s\" failed: file \"%s\", line %d, function \"%s\"\n",
failedexpr, file, line, func); failedexpr, file, line, func);
abort(); abort();
/* NOTREACHED */ /* NOTREACHED */
} }

View File

@ -53,7 +53,7 @@ const char _C_ctype_[1 + CTYPE_NUM_CHARS] = {
_P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L,
_L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L,
_L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L, _L,
/* determine printability based on the IS0 8859 8-bit standard */ /* determine printability based on the IS0 8859 8-bit standard */
_L, _L, _L, _P, _P, _P, _P, _C, _L, _L, _L, _P, _P, _P, _P, _C,
_C, _C, _C, _C, _C, _C, _C, _C, /* 80 */ _C, _C, _C, _C, _C, _C, _C, _C, /* 80 */

View File

@ -62,8 +62,8 @@ __findenv(const char *name, int *offset)
if (i == 0 && *cp++ == '=') { if (i == 0 && *cp++ == '=') {
*offset = p - environ; *offset = p - environ;
return (cp); return (cp);
} }
} }
return (NULL); return (NULL);
} }

View File

@ -42,7 +42,7 @@ putenv(const char *str)
if ((equal = strchr(p, '=')) == NULL) { if ((equal = strchr(p, '=')) == NULL) {
(void)free(p); (void)free(p);
return (-1); return (-1);
} }
*equal = '\0'; *equal = '\0';
rval = setenv(p, equal + 1, 1); rval = setenv(p, equal + 1, 1);
(void)free(p); (void)free(p);

View File

@ -39,11 +39,11 @@ static __inline void swapfunc(char *, char *, int, int);
/* /*
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
*/ */
#define swapcode(TYPE, parmi, parmj, n) { \ #define swapcode(TYPE, parmi, parmj, n) { \
long i = (n) / sizeof (TYPE); \ long i = (n) / sizeof (TYPE); \
TYPE *pi = (TYPE *) (parmi); \ TYPE *pi = (TYPE *) (parmi); \
TYPE *pj = (TYPE *) (parmj); \ TYPE *pj = (TYPE *) (parmj); \
do { \ do { \
TYPE t = *pi; \ TYPE t = *pi; \
*pi++ = *pj; \ *pi++ = *pj; \
*pj++ = t; \ *pj++ = t; \
@ -70,7 +70,7 @@ swapfunc(char *a, char *b, int n, int swaptype)
} else \ } else \
swapfunc(a, b, es, swaptype) swapfunc(a, b, es, swaptype)
#define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype) #define vecswap(a, b, n) if ((n) > 0) swapfunc(a, b, n, swaptype)
static __inline char * static __inline char *
med3(char *a, char *b, char *c, int (*cmp)(const void *, const void *)) med3(char *a, char *b, char *c, int (*cmp)(const void *, const void *))
@ -118,7 +118,7 @@ loop: SWAPINIT(a, es);
swap_cnt = 1; swap_cnt = 1;
swap(pa, pb); swap(pa, pb);
pa += es; pa += es;
} }
pb += es; pb += es;
} }
while (pb <= pc && (r = cmp(pc, a)) >= 0) { while (pb <= pc && (r = cmp(pc, a)) >= 0) {
@ -142,7 +142,7 @@ loop: SWAPINIT(a, es);
pl -= es) pl -= es)
swap(pl, pl - es); swap(pl, pl - es);
return; return;
} }
pn = (char *)a + n * es; pn = (char *)a + n * es;
r = min(pa - (char *)a, pb - pa); r = min(pa - (char *)a, pb - pa);
@ -157,5 +157,5 @@ loop: SWAPINIT(a, es);
n = r / es; n = r / es;
goto loop; goto loop;
} }
/* qsort(pn - r, r / es, es, cmp);*/ /* qsort(pn - r, r / es, es, cmp); */
} }

View File

@ -238,8 +238,7 @@ unsigned char finalcount[8];
while ((context->count[0] & 504) != 448) { while ((context->count[0] & 504) != 448) {
SHA1Update(context, (unsigned char *)"\0", 1); SHA1Update(context, (unsigned char *)"\0", 1);
} }
SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */
*/
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
digest[i] = (unsigned char) digest[i] = (unsigned char)
((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);

File diff suppressed because it is too large Load Diff

View File

@ -387,7 +387,7 @@ size_t wcsxfrm(wchar_t *ws1, const wchar_t *ws2, size_t n)
int wctob(wint_t c) int wctob(wint_t c)
{ {
return c; return c;
} }
wctype_t wctype(const char *property) wctype_t wctype(const char *property)