diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 21:17:12 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 21:17:12 +0100 |
| commit | b5cd18739a64c8d923a55b61c89ae3900faafd84 (patch) | |
| tree | d192f7b25257ae9a8a4760c68f5314dcbc0d9b91 /lib/libc/string | |
| parent | 119aed5bc787ccbf23d2f151759ec1f3a80977e1 (diff) | |
Fix include paths and formatting inconsistencies
Diffstat (limited to 'lib/libc/string')
30 files changed, 50 insertions, 43 deletions
diff --git a/lib/libc/string/memccpy.c b/lib/libc/string/memccpy.c index 29828182..4b3c83cd 100644 --- a/lib/libc/string/memccpy.c +++ b/lib/libc/string/memccpy.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for NULL, size_t void *memccpy(void *restrict s1, const void *restrict s2, int c, size_t n) { diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c index 38850aed..230e042f 100644 --- a/lib/libc/string/memchr.c +++ b/lib/libc/string/memchr.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for NULL, size_t void *memchr(const void *s, int c, size_t n) { diff --git a/lib/libc/string/memcmp.c b/lib/libc/string/memcmp.c index 5efb282f..da1766c4 100644 --- a/lib/libc/string/memcmp.c +++ b/lib/libc/string/memcmp.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for size_t int memcmp(const void *s1, const void *s2, size_t n) { diff --git a/lib/libc/string/memcpy.c b/lib/libc/string/memcpy.c index 05586b55..8af4577c 100644 --- a/lib/libc/string/memcpy.c +++ b/lib/libc/string/memcpy.c @@ -1,6 +1,6 @@ -#include <errno.h> -#include <string.h> -#include <features.h> +#include <errno.h> // for EINVAL, ERANGE +#include <features.h> // for __weak +#include <string.h> // for rsize_t, NULL, memcpy, size_t, errno_t, memcpy_s __weak void *memcpy(void *restrict s1, const void *restrict s2, size_t n); diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c index 7a450cf7..b30a700a 100644 --- a/lib/libc/string/memmem.c +++ b/lib/libc/string/memmem.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for memcmp, size_t, NULL, memmem void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen) diff --git a/lib/libc/string/memmove.c b/lib/libc/string/memmove.c index 88968185..db83694f 100644 --- a/lib/libc/string/memmove.c +++ b/lib/libc/string/memmove.c @@ -1,5 +1,5 @@ -#include <stddef.h> -#include <stdint.h> +#include <stddef.h> // for size_t +#include <stdint.h> // for uint8_t, uintptr_t void *memmove(void *dst, const void *src, size_t n) { diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index da969d16..316a1873 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for memset, size_t void *memset(void *s, int c, size_t n) { diff --git a/lib/libc/string/stpcpy.c b/lib/libc/string/stpcpy.c index 04c3a17f..f3619557 100644 --- a/lib/libc/string/stpcpy.c +++ b/lib/libc/string/stpcpy.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for stpcpy char *stpcpy(char *restrict s1, const char *restrict s2) { diff --git a/lib/libc/string/stpncpy.c b/lib/libc/string/stpncpy.c index 8f7ebd01..1afa59fc 100644 --- a/lib/libc/string/stpncpy.c +++ b/lib/libc/string/stpncpy.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for size_t char *strncpy(char *restrict s1, const char *restrict s2, size_t n) { diff --git a/lib/libc/string/strchr.c b/lib/libc/string/strchr.c index db632a2e..06fb51bc 100644 --- a/lib/libc/string/strchr.c +++ b/lib/libc/string/strchr.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for strchr, NULL char *strchr(const char *s, int c) { diff --git a/lib/libc/string/strcmp.c b/lib/libc/string/strcmp.c index 836522f1..e3e5ca03 100644 --- a/lib/libc/string/strcmp.c +++ b/lib/libc/string/strcmp.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for NULL int strcmp(const char *s1, const char *s2) { diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c index 6efaa3d3..7a1502f0 100644 --- a/lib/libc/string/strcoll.c +++ b/lib/libc/string/strcoll.c @@ -1,6 +1,8 @@ -#include <libc.h> -#include <string.h> -#include <locale.h> +#include "features.h" // for __weak + +#include <libc.h> // for __unused +#include <locale.h> // for locale_t +#include <string.h> // for strcmp, strcoll, strcoll_l int strcoll(const char *s1, const char *s2) { diff --git a/lib/libc/string/strcspn.c b/lib/libc/string/strcspn.c index 9f1f2bcd..4efb38ae 100644 --- a/lib/libc/string/strcspn.c +++ b/lib/libc/string/strcspn.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for size_t, strchr, strcspn, NULL size_t strcspn(const char *s1, const char *s2) { diff --git a/lib/libc/string/strdup.c b/lib/libc/string/strdup.c index 1210bfdc..97b5d712 100644 --- a/lib/libc/string/strdup.c +++ b/lib/libc/string/strdup.c @@ -1,5 +1,5 @@ -#include <stdlib.h> -#include <string.h> +#include <stdlib.h> // for NULL, malloc +#include <string.h> // for memcpy, strlen, size_t, strdup char *strdup(const char *s) { diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c index c091ac79..e7800d08 100644 --- a/lib/libc/string/strerror.c +++ b/lib/libc/string/strerror.c @@ -1,7 +1,10 @@ -#include <libc.h> -#include <errno.h> -#include <string.h> -#include <locale.h> +#include "__stdio.h" // for size_t +#include "features.h" // for __weak + +#include <errno.h> // for ERANGE, E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL +#include <libc.h> // for __unused +#include <locale.h> // for locale_t +#include <string.h> // for memcpy, strerror, strlen, strerror_l, strerror_r char *strerror(int errnum) { diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c index a2c333e0..751f1616 100644 --- a/lib/libc/string/strlcat.c +++ b/lib/libc/string/strlcat.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for size_t, strlen, memcpy, strlcat size_t strlcat(char *restrict dst, const char *restrict src, size_t dstsize) { diff --git a/lib/libc/string/strlcpy.c b/lib/libc/string/strlcpy.c index 2f2f6a3b..fcbcebab 100644 --- a/lib/libc/string/strlcpy.c +++ b/lib/libc/string/strlcpy.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for size_t, memcpy, strlen, strlcpy size_t strlcpy(char *restrict dst, const char *restrict src, size_t dstsize) { diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index 0eb222fa..6371b588 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for size_t, NULL size_t strlen(const char *str) { diff --git a/lib/libc/string/strncat.c b/lib/libc/string/strncat.c index ce0d8e24..1a957e43 100644 --- a/lib/libc/string/strncat.c +++ b/lib/libc/string/strncat.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for strncat, size_t char *strncat(char *restrict s1, const char *restrict s2, size_t n) { diff --git a/lib/libc/string/strncmp.c b/lib/libc/string/strncmp.c index 2fbc2395..1675890a 100644 --- a/lib/libc/string/strncmp.c +++ b/lib/libc/string/strncmp.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for size_t int strncmp(const char *s1, const char *s2, size_t n) { diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c index c43b88c8..b0541b44 100644 --- a/lib/libc/string/strncpy.c +++ b/lib/libc/string/strncpy.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for size_t char *strncpy(char *restrict s1, const char *restrict s2, size_t n) { diff --git a/lib/libc/string/strndup.c b/lib/libc/string/strndup.c index 70e10501..318561ca 100644 --- a/lib/libc/string/strndup.c +++ b/lib/libc/string/strndup.c @@ -1,5 +1,5 @@ -#include <stdlib.h> -#include <string.h> +#include <stdlib.h> // for NULL, malloc +#include <string.h> // for memcpy, size_t, strndup char *strndup(const char *s, size_t size) { diff --git a/lib/libc/string/strnlen.c b/lib/libc/string/strnlen.c index 11da22ec..d1dc98bb 100644 --- a/lib/libc/string/strnlen.c +++ b/lib/libc/string/strnlen.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for size_t size_t strnlen(const char *s, size_t maxlen) { diff --git a/lib/libc/string/strpbrk.c b/lib/libc/string/strpbrk.c index 21d6507f..a03bb31a 100644 --- a/lib/libc/string/strpbrk.c +++ b/lib/libc/string/strpbrk.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for NULL char *strpbrk(const char *s1, const char *s2) { diff --git a/lib/libc/string/strrchr.c b/lib/libc/string/strrchr.c index d2807569..5d66035e 100644 --- a/lib/libc/string/strrchr.c +++ b/lib/libc/string/strrchr.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for NULL char *strrchr(const char *s, int c) { diff --git a/lib/libc/string/strspn.c b/lib/libc/string/strspn.c index 78277ae7..3b7036cc 100644 --- a/lib/libc/string/strspn.c +++ b/lib/libc/string/strspn.c @@ -1,5 +1,4 @@ -#include <stddef.h> -#include <string.h> +#include <string.h> // for size_t, strchr, strspn, NULL size_t strspn(const char *s1, const char *s2) { diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c index c3e2d5dd..1c35e826 100644 --- a/lib/libc/string/strstr.c +++ b/lib/libc/string/strstr.c @@ -1,4 +1,4 @@ -#include <stddef.h> +#include <stddef.h> // for NULL char *strstr(const char *s1, const char *s2) { diff --git a/lib/libc/string/strtok.c b/lib/libc/string/strtok.c index 33d0d685..918765b1 100644 --- a/lib/libc/string/strtok.c +++ b/lib/libc/string/strtok.c @@ -1,5 +1,4 @@ -#include <stddef.h> -#include <string.h> +#include <string.h> // for NULL, strchr, strtok char *strtok(char *restrict s, const char *restrict sep) { diff --git a/lib/libc/string/strtok_r.c b/lib/libc/string/strtok_r.c index 57555b14..ee3fc243 100644 --- a/lib/libc/string/strtok_r.c +++ b/lib/libc/string/strtok_r.c @@ -1,4 +1,4 @@ -#include <string.h> +#include <string.h> // for NULL, strchr, strtok_r char *strtok_r(char *restrict s, const char *restrict sep, char **restrict state) diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c index d216733b..947a4331 100644 --- a/lib/libc/string/strxfrm.c +++ b/lib/libc/string/strxfrm.c @@ -1,5 +1,9 @@ -#include <libc.h> -#include <string.h> +#include "__stdio.h" // for size_t +#include "features.h" // for __weak + +#include <libc.h> // for __unused +#include <locale.h> // for locale_t +#include <string.h> // for strlcpy, strlen, strxfrm, strxfrm_l size_t strxfrm(char *restrict s1, const char *restrict s2, size_t n) { |
