[klibc] format code

This commit is contained in:
Meco Man 2024-12-20 19:42:18 -05:00
parent 16093369b2
commit 7772d4619a
2 changed files with 6 additions and 6 deletions

View File

@ -13,13 +13,13 @@
#include <rtthread.h> #include <rtthread.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef RT_USING_PICOLIBC
/** /**
* @brief erases the data in the n bytes of the memory starting at the * @brief erases the data in the n bytes of the memory starting at the
* location pointed to by s, by writing zeros (bytes containing '\0') to that area. * location pointed to by s, by writing zeros (bytes containing '\0') to that area.
* *
* @note The bzero() function is deprecated (marked as LEGACY in POSIX. 1-2001). * @note The bzero() function is deprecated (marked as LEGACY in POSIX. 1-2001).
*/ */
#ifndef RT_USING_PICOLIBC
void bzero(void* s, size_t n) void bzero(void* s, size_t n)
{ {
rt_memset(s, 0, n); rt_memset(s, 0, n);
@ -46,12 +46,12 @@ void explicit_bzero(void* s, size_t n)
} }
} }
char* index(const char* s, int c) char *index(const char* s, int c)
{ {
return strchr(s, c); return strchr(s, c);
} }
char* rindex(const char* s, int c) char *rindex(const char* s, int c)
{ {
return strrchr(s, c); return strrchr(s, c);
} }
@ -99,7 +99,7 @@ int ffsll(long long i)
* *
* @note This function is GNU extension, available since glibc 2.1.91. * @note This function is GNU extension, available since glibc 2.1.91.
*/ */
void* memrchr(const void* ptr, int ch, size_t pos) void *memrchr(const void* ptr, int ch, size_t pos)
{ {
char* end = (char*)ptr + pos - 1; char* end = (char*)ptr + pos - 1;
while (end != ptr) while (end != ptr)
@ -118,7 +118,7 @@ size_t strnlen(const char *s, size_t maxlen)
return sc - s; return sc - s;
} }
char* strchrnul(const char* s, int c) char *strchrnul(const char* s, int c)
{ {
while (*s != '\0' && *s != c) while (*s != '\0' && *s != c)
s++; s++;

View File

@ -18,7 +18,7 @@
#undef DBG_TAG #undef DBG_TAG
#undef DBG_LVL #undef DBG_LVL
#define DBG_TAG "testcase" #define DBG_TAG "utest"
#ifdef UTEST_DEBUG #ifdef UTEST_DEBUG
#define DBG_LVL DBG_LOG #define DBG_LVL DBG_LOG
#else #else