mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
[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;
|
||||
if (len) {
|
||||
do {
|
||||
c1 = *s1; c2 = *s2;
|
||||
s1++; s2++;
|
||||
c1 = *s1;
|
||||
c2 = *s2;
|
||||
s1++;
|
||||
s2++;
|
||||
if (!c1)
|
||||
break;
|
||||
if (!c2)
|
||||
|
@ -55,7 +57,6 @@ int strnicmp(const char *s1, const char *s2, size_t len)
|
|||
}
|
||||
return (int)c1 - (int)c2;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(strnicmp);
|
||||
#endif
|
||||
|
||||
|
@ -96,7 +97,8 @@ char * strncpy(char * dest,const char *src,size_t count)
|
|||
char *tmp = dest;
|
||||
|
||||
while (count) {
|
||||
if ((*tmp = *src) != 0) src++;
|
||||
if ((*tmp = *src) != 0)
|
||||
src++;
|
||||
tmp++;
|
||||
count--;
|
||||
}
|
||||
|
@ -176,7 +178,6 @@ char * strncat(char *dest, const char *src, size_t count)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
EXPORT_SYMBOL(strncat);
|
||||
|
@ -224,7 +225,6 @@ int strcmp(const char * cs,const char * ct)
|
|||
if ((__res = *cs - *ct++) != 0 || !*cs++)
|
||||
break;
|
||||
}
|
||||
|
||||
return __res;
|
||||
}
|
||||
EXPORT_SYMBOL(strcmp);
|
||||
|
@ -246,7 +246,6 @@ int strncmp(const char * cs,const char * ct,size_t count)
|
|||
break;
|
||||
count--;
|
||||
}
|
||||
|
||||
return __res;
|
||||
}
|
||||
EXPORT_SYMBOL(strncmp);
|
||||
|
@ -358,7 +357,6 @@ size_t strspn(const char *s, const char *accept)
|
|||
return count;
|
||||
++count;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
@ -384,7 +382,6 @@ size_t strcspn(const char *s, const char *reject)
|
|||
}
|
||||
++count;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
EXPORT_SYMBOL(strcspn);
|
||||
|
@ -424,7 +421,8 @@ EXPORT_SYMBOL(strpbrk);
|
|||
*/
|
||||
char *strsep(char **s, const char *ct)
|
||||
{
|
||||
char *sbegin = *s, *end;
|
||||
char *sbegin = *s;
|
||||
char *end;
|
||||
|
||||
if (sbegin == NULL)
|
||||
return NULL;
|
||||
|
@ -433,10 +431,8 @@ char * strsep(char **s, const char *ct)
|
|||
if (end)
|
||||
*end++ = '\0';
|
||||
*s = end;
|
||||
|
||||
return sbegin;
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(strsep);
|
||||
#endif
|
||||
|
||||
|
@ -455,7 +451,6 @@ void * memset(void * s,int c,size_t count)
|
|||
|
||||
while (count--)
|
||||
*xs++ = c;
|
||||
|
||||
return s;
|
||||
}
|
||||
EXPORT_SYMBOL(memset);
|
||||
|
@ -473,11 +468,11 @@ EXPORT_SYMBOL(memset);
|
|||
*/
|
||||
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--)
|
||||
*tmp++ = *s++;
|
||||
|
||||
return dest;
|
||||
}
|
||||
EXPORT_SYMBOL(memcpy);
|
||||
|
@ -501,14 +496,12 @@ void * memmove(void * dest,const void *src,size_t count)
|
|||
s = (char *)src;
|
||||
while (count--)
|
||||
*tmp++ = *s++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tmp = (char *)dest + count;
|
||||
s = (char *)src + count;
|
||||
while (count--)
|
||||
*--tmp = *--s;
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
EXPORT_SYMBOL(memmove);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue