[PATCH] lib/string.c cleanup: whitespace and CodingStyle cleanups
Removes some blank lines, removes some trailing whitespace, adds spaces after commas and a few similar changes. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
d97b321425
commit
51a0f0f658
1 changed files with 53 additions and 60 deletions
29
lib/string.c
29
lib/string.c
|
@ -39,8 +39,10 @@ int strnicmp(const char *s1, const char *s2, size_t len)
|
||||||
c1 = 0; c2 = 0;
|
c1 = 0; c2 = 0;
|
||||||
if (len) {
|
if (len) {
|
||||||
do {
|
do {
|
||||||
c1 = *s1; c2 = *s2;
|
c1 = *s1;
|
||||||
s1++; s2++;
|
c2 = *s2;
|
||||||
|
s1++;
|
||||||
|
s2++;
|
||||||
if (!c1)
|
if (!c1)
|
||||||
break;
|
break;
|
||||||
if (!c2)
|
if (!c2)
|
||||||
|
@ -55,7 +57,6 @@ int strnicmp(const char *s1, const char *s2, size_t len)
|
||||||
}
|
}
|
||||||
return (int)c1 - (int)c2;
|
return (int)c1 - (int)c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(strnicmp);
|
EXPORT_SYMBOL(strnicmp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -96,7 +97,8 @@ char * strncpy(char * dest,const char *src,size_t count)
|
||||||
char *tmp = dest;
|
char *tmp = dest;
|
||||||
|
|
||||||
while (count) {
|
while (count) {
|
||||||
if ((*tmp = *src) != 0) src++;
|
if ((*tmp = *src) != 0)
|
||||||
|
src++;
|
||||||
tmp++;
|
tmp++;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +178,6 @@ char * strncat(char *dest, const char *src, size_t count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(strncat);
|
EXPORT_SYMBOL(strncat);
|
||||||
|
@ -224,7 +225,6 @@ int strcmp(const char * cs,const char * ct)
|
||||||
if ((__res = *cs - *ct++) != 0 || !*cs++)
|
if ((__res = *cs - *ct++) != 0 || !*cs++)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return __res;
|
return __res;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(strcmp);
|
EXPORT_SYMBOL(strcmp);
|
||||||
|
@ -246,7 +246,6 @@ int strncmp(const char * cs,const char * ct,size_t count)
|
||||||
break;
|
break;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return __res;
|
return __res;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(strncmp);
|
EXPORT_SYMBOL(strncmp);
|
||||||
|
@ -358,7 +357,6 @@ size_t strspn(const char *s, const char *accept)
|
||||||
return count;
|
return count;
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +382,6 @@ size_t strcspn(const char *s, const char *reject)
|
||||||
}
|
}
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(strcspn);
|
EXPORT_SYMBOL(strcspn);
|
||||||
|
@ -424,7 +421,8 @@ EXPORT_SYMBOL(strpbrk);
|
||||||
*/
|
*/
|
||||||
char *strsep(char **s, const char *ct)
|
char *strsep(char **s, const char *ct)
|
||||||
{
|
{
|
||||||
char *sbegin = *s, *end;
|
char *sbegin = *s;
|
||||||
|
char *end;
|
||||||
|
|
||||||
if (sbegin == NULL)
|
if (sbegin == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -433,10 +431,8 @@ char * strsep(char **s, const char *ct)
|
||||||
if (end)
|
if (end)
|
||||||
*end++ = '\0';
|
*end++ = '\0';
|
||||||
*s = end;
|
*s = end;
|
||||||
|
|
||||||
return sbegin;
|
return sbegin;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(strsep);
|
EXPORT_SYMBOL(strsep);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -455,7 +451,6 @@ void * memset(void * s,int c,size_t count)
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
*xs++ = c;
|
*xs++ = c;
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(memset);
|
EXPORT_SYMBOL(memset);
|
||||||
|
@ -473,11 +468,11 @@ EXPORT_SYMBOL(memset);
|
||||||
*/
|
*/
|
||||||
void *memcpy(void *dest, const void *src, size_t count)
|
void *memcpy(void *dest, const void *src, size_t count)
|
||||||
{
|
{
|
||||||
char *tmp = (char *) dest, *s = (char *) src;
|
char *tmp = (char *)dest;
|
||||||
|
char *s = (char *)src;
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
*tmp++ = *s++;
|
*tmp++ = *s++;
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(memcpy);
|
EXPORT_SYMBOL(memcpy);
|
||||||
|
@ -501,14 +496,12 @@ void * memmove(void * dest,const void *src,size_t count)
|
||||||
s = (char *)src;
|
s = (char *)src;
|
||||||
while (count--)
|
while (count--)
|
||||||
*tmp++ = *s++;
|
*tmp++ = *s++;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
tmp = (char *)dest + count;
|
tmp = (char *)dest + count;
|
||||||
s = (char *)src + count;
|
s = (char *)src + count;
|
||||||
while (count--)
|
while (count--)
|
||||||
*--tmp = *--s;
|
*--tmp = *--s;
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(memmove);
|
EXPORT_SYMBOL(memmove);
|
||||||
|
|
Loading…
Reference in a new issue