1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -16,7 +16,7 @@ void bzero(void* dest, size_t n)
memset(dest, 0, n);
}
void bcopy(const void* src, void* dest, size_t n)
void bcopy(void const* src, void* dest, size_t n)
{
memmove(dest, src, n);
}
@ -29,23 +29,23 @@ static char foldcase(char ch)
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html
int strcasecmp(const char* s1, const char* s2)
int strcasecmp(char const* s1, char const* s2)
{
for (; foldcase(*s1) == foldcase(*s2); ++s1, ++s2) {
if (*s1 == 0)
return 0;
}
return foldcase(*(const unsigned char*)s1) < foldcase(*(const unsigned char*)s2) ? -1 : 1;
return foldcase(*(unsigned char const*)s1) < foldcase(*(unsigned char const*)s2) ? -1 : 1;
}
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncasecmp.html
int strncasecmp(const char* s1, const char* s2, size_t n)
int strncasecmp(char const* s1, char const* s2, size_t n)
{
if (!n)
return 0;
do {
if (foldcase(*s1) != foldcase(*s2++))
return foldcase(*(const unsigned char*)s1) - foldcase(*(const unsigned char*)--s2);
return foldcase(*(unsigned char const*)s1) - foldcase(*(unsigned char const*)--s2);
if (*s1++ == 0)
break;
} while (--n);