diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 23:14:53 +0100 |
| commit | 169daa11155988a210fac949297381743f3cb400 (patch) | |
| tree | 602ef5df5ae9ea075ab3d5dac3c8ad60da1ea2cc /include | |
| parent | 4e2112e165fdd94dee58378e3ea32892f3710cd7 (diff) | |
feat: clang-tidy fixes
Diffstat (limited to 'include')
48 files changed, 70 insertions, 23 deletions
diff --git a/include/aio.h b/include/aio.h index 8481d9cf..9227cdfc 100644 --- a/include/aio.h +++ b/include/aio.h @@ -1,6 +1,8 @@ #ifndef __AIO_H #define __AIO_H +#include <stddef.h> +#include <time.h> #define __BITS_SIGEVENT_H_ #include <bits/sigevent.h> #undef __BITS_SIGEVENT_H_ diff --git a/include/arch/x86_64/drm/drm.h b/include/arch/x86_64/drm/drm.h index ebd6ebb5..a928f61f 100644 --- a/include/arch/x86_64/drm/drm.h +++ b/include/arch/x86_64/drm/drm.h @@ -253,7 +253,7 @@ enum drm_stat_type { _DRM_STAT_DMA, /**< DMA */ _DRM_STAT_SPECIAL, /**< Special DMA (e.g., priority or polled) */ _DRM_STAT_MISSED /**< Missed DMA opportunity */ - /* Add to the *END* of the list */ + /* Add to the *END* of the list */ }; /* diff --git a/include/arch/x86_64/drm/i915_drm.h b/include/arch/x86_64/drm/i915_drm.h index 68f08e16..e0403cb6 100644 --- a/include/arch/x86_64/drm/i915_drm.h +++ b/include/arch/x86_64/drm/i915_drm.h @@ -2115,10 +2115,10 @@ struct drm_i915_gem_context_param { #define I915_CONTEXT_MAX_USER_PRIORITY 1023 /* inclusive */ #define I915_CONTEXT_DEFAULT_PRIORITY 0 #define I915_CONTEXT_MIN_USER_PRIORITY -1023 /* inclusive */ - /* - * When using the following param, value should be a pointer to - * drm_i915_gem_context_param_sseu. - */ + /* + * When using the following param, value should be a pointer to + * drm_i915_gem_context_param_sseu. + */ #define I915_CONTEXT_PARAM_SSEU 0x7 /* diff --git a/include/arch/x86_64/linux/can/isotp.h b/include/arch/x86_64/linux/can/isotp.h index 3d72f3d3..d986173d 100644 --- a/include/arch/x86_64/linux/can/isotp.h +++ b/include/arch/x86_64/linux/can/isotp.h @@ -85,7 +85,7 @@ struct can_isotp_options { /* __u8 value : content on rx path */ __u8 rx_ext_address; /* set address for extended addressing */ - /* __u8 value : extended address (rx) */ + /* __u8 value : extended address (rx) */ }; struct can_isotp_fc_options { diff --git a/include/arch/x86_64/linux/hdlcdrv.h b/include/arch/x86_64/linux/hdlcdrv.h index 0d3f0ba7..784d1dcf 100644 --- a/include/arch/x86_64/linux/hdlcdrv.h +++ b/include/arch/x86_64/linux/hdlcdrv.h @@ -29,7 +29,7 @@ struct hdlcdrv_channel_params { int slottime; /* the slottime in 10ms; usually 10 = 100ms */ int ppersist; /* the p-persistence 0..255 */ int fulldup; /* some driver do not support full duplex, setting */ - /* this just makes them send even if DCD is on */ + /* this just makes them send even if DCD is on */ }; struct hdlcdrv_old_channel_state { diff --git a/include/arch/x86_64/linux/scc.h b/include/arch/x86_64/linux/scc.h index ac19e3ef..ce9c783b 100644 --- a/include/arch/x86_64/linux/scc.h +++ b/include/arch/x86_64/linux/scc.h @@ -87,7 +87,7 @@ enum CLOCK_sources { CLK_DIVIDER, /* Rx = DPLL, Tx = divider (fullduplex with */ /* modems without clock regeneration */ CLK_BRG /* experimental fullduplex mode with DPLL/BRG for */ - /* MODEMs without clock recovery */ + /* MODEMs without clock recovery */ }; /* Tx state */ diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 030f2f0c..478fb1ac 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -1,6 +1,7 @@ #ifndef __ARPA_INET_H #define __ARPA_INET_H +#include <stdint.h> #define __BITS_IN_ADDR_H_ #include <bits/in_addr.h> #undef __BITS_IN_ADDR_H_ diff --git a/include/complex.h b/include/complex.h index ced87a8f..e8cec9cc 100644 --- a/include/complex.h +++ b/include/complex.h @@ -1,6 +1,7 @@ #ifndef __COMPLEX_H #define __COMPLEX_H +#include <complex.h> #define complex _Complex #define _Complex_I (__extension__(0.0f + 1.0fi)) #define imaginary _Imaginary diff --git a/include/devctl.h b/include/devctl.h index 1010441d..6948af13 100644 --- a/include/devctl.h +++ b/include/devctl.h @@ -1,6 +1,7 @@ #ifndef __DEVCTL_H #define __DEVCTL_H +#include <stddef.h> typedef __SIZE_TYPE__ size_t; int posix_devctl(int, int, void *restrict, size_t, int *restrict); diff --git a/include/dirent.h b/include/dirent.h index f9892928..a926294b 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -1,6 +1,7 @@ #ifndef __DIRENT_H #define __DIRENT_H +#include <stddef.h> #define DT_UNKNOWN 0x0 #define DT_FIFO 0x1 #define DT_CHR 0x2 diff --git a/include/endian.h b/include/endian.h index fd7d900f..e03bc636 100644 --- a/include/endian.h +++ b/include/endian.h @@ -1,6 +1,7 @@ #ifndef __ENDIAN_H #define __ENDIAN_H +#include <stdint.h> #define BYTE_ORDER __BYTE_ORDER__ #define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ #define BIG_ENDIAN __ORDER_BIG_ENDIAN__ diff --git a/include/fenv.h b/include/fenv.h index fa91d389..64c70870 100644 --- a/include/fenv.h +++ b/include/fenv.h @@ -2,6 +2,7 @@ #define __FENV_H #include <bits/fenv.h> +#include <fenv.h> int feclearexcept(int); int fegetenv(fenv_t *); diff --git a/include/glob.h b/include/glob.h index 9cbf80ac..ef253721 100644 --- a/include/glob.h +++ b/include/glob.h @@ -1,6 +1,7 @@ #ifndef __GLOB_H #define __GLOB_H +#include <stddef.h> #define GLOB_APPEND 0x0001 #define GLOB_DOOFFS 0x0002 #define GLOB_ERR 0x0004 @@ -9,9 +10,9 @@ #define GLOB_NOESCAPE 0x0020 #define GLOB_NOSORT 0x0040 -#define GLOB_ABORTED -1 -#define GLOB_NOMATCH -2 -#define GLOB_NOSPACE -3 +#define GLOB_ABORTED (-1) +#define GLOB_NOMATCH (-2) +#define GLOB_NOSPACE (-3) typedef __SIZE_TYPE__ size_t; diff --git a/include/grp.h b/include/grp.h index 02f023af..04ad0e44 100644 --- a/include/grp.h +++ b/include/grp.h @@ -1,6 +1,7 @@ #ifndef __GRP_H #define __GRP_H +#include <stddef.h> typedef __SIZE_TYPE__ size_t; typedef __UINT32_TYPE__ gid_t; diff --git a/include/iconv.h b/include/iconv.h index 5b25d2b2..cbaef7b7 100644 --- a/include/iconv.h +++ b/include/iconv.h @@ -1,6 +1,7 @@ #ifndef __ICONV_H #define __ICONV_H +#include <stddef.h> typedef void *iconv_t; typedef __SIZE_TYPE__ size_t; diff --git a/include/inttypes.h b/include/inttypes.h index 36d4bcba..17b86921 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -202,8 +202,6 @@ #define SCNuPTR __PRIPTR "u" #define SCNxPTR __PRIPTR "x" -typedef __WCHAR_TYPE__ wchar_t; - // TODO: make it private typedef struct { intmax_t quot, rem; @@ -213,7 +211,5 @@ intmax_t imaxabs(intmax_t); imaxdiv_t imaxdiv(intmax_t, intmax_t); intmax_t strtoimax(const char *restrict, char **restrict, int); uintmax_t strtoumax(const char *restrict, char **restrict, int); -intmax_t wcstoimax(const wchar_t *restrict, wchar_t **restrict, int); -uintmax_t wcstoumax(const wchar_t *restrict, wchar_t **restrict, int); #endif diff --git a/include/iso646.h b/include/iso646.h index 109cf6d6..f92457b2 100644 --- a/include/iso646.h +++ b/include/iso646.h @@ -3,14 +3,14 @@ #define and && #define and_eq &= -#define bitand & -#define bitor | +#define bitand (&) +#define bitor (|) #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= -#define xor ^ +#define xor (^) #define xor_eq ^= #endif diff --git a/include/limits.h b/include/limits.h index af981c18..d42cce0a 100644 --- a/include/limits.h +++ b/include/limits.h @@ -1,6 +1,8 @@ #ifndef __LIMITS_H #define __LIMITS_H +#include <limits.h> +#include <stdint.h> #if '\xff' > 0 #define CHAR_MIN 0 #define CHAR_MAX 255 diff --git a/include/locale.h b/include/locale.h index 0a7a01bc..f94b5225 100644 --- a/include/locale.h +++ b/include/locale.h @@ -1,6 +1,7 @@ #ifndef __LOCALE_H #define __LOCALE_H +#include <locale.h> #undef NULL #define NULL ((void *)0) diff --git a/include/math.h b/include/math.h index a8ea9f97..0f672d21 100644 --- a/include/math.h +++ b/include/math.h @@ -1,6 +1,7 @@ #ifndef __MATH_H #define __MATH_H +#include <math.h> extern int signgam; #if FLT_EVAL_METHOD == 1 diff --git a/include/mqueue.h b/include/mqueue.h index 7af98b58..c4582748 100644 --- a/include/mqueue.h +++ b/include/mqueue.h @@ -1,6 +1,8 @@ #ifndef __MQUEUE_H #define __MQUEUE_H +#include <stddef.h> +#include <time.h> #define __BITS_TIMESPEC_H_ #include <bits/timespec.h> #undef __BITS_TIMESPEC_H_ diff --git a/include/ndbm.h b/include/ndbm.h index a0ffc667..35a8f156 100644 --- a/include/ndbm.h +++ b/include/ndbm.h @@ -1,6 +1,7 @@ #ifndef __NDBM_H #define __NDBM_H +#include <stddef.h> #define DBM_INSERT 0 #define DBM_REPLACE 1 diff --git a/include/netdb.h b/include/netdb.h index bdaba1e2..9f7c7195 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -1,6 +1,7 @@ #ifndef __NETDB_H #define __NETDB_H +#include <stdint.h> #define IPPORT_RESERVED 1024 #define AI_PASSIVE 0x00000001 diff --git a/include/netinet/in.h b/include/netinet/in.h index 39b23904..368a61c1 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -1,6 +1,7 @@ #ifndef __NETINET_IN_H #define __NETINET_IN_H +#include <stdint.h> #define __BITS_IN_ADDR_H_ #include <bits/in_addr.h> #undef __BITS_IN_ADDR_H_ diff --git a/include/poll.h b/include/poll.h index 1e7e98bd..948666ba 100644 --- a/include/poll.h +++ b/include/poll.h @@ -1,6 +1,7 @@ #ifndef __POLL_H #define __POLL_H +#include <time.h> #define POLLIN 0x0001 #define POLLRDNORM 0x0040 #define POLLRDBAND 0x0080 diff --git a/include/pthread.h b/include/pthread.h index cc056888..5141a286 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -1,6 +1,8 @@ #ifndef __PTHREAD_H #define __PTHREAD_H +#include <stddef.h> +#include <time.h> #define __BITS_TIMESPEC_H_ #include <bits/timespec.h> #undef __BITS_TIMESPEC_H_ diff --git a/include/pwd.h b/include/pwd.h index f60dd81b..995edb83 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,6 +1,7 @@ #ifndef __PWD_H #define __PWD_H +#include <stddef.h> typedef __SIZE_TYPE__ size_t; typedef __UINT32_TYPE__ gid_t; typedef __UINT32_TYPE__ uid_t; diff --git a/include/setjmp.h b/include/setjmp.h index feea9cc1..3470fd5e 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -2,6 +2,7 @@ #define __SETJMP_H #include <bits/setjmp.h> +#include <setjmp.h> typedef jmp_buf sigjmp_buf; diff --git a/include/signal.h b/include/signal.h index 8e49fc8a..425f56e1 100644 --- a/include/signal.h +++ b/include/signal.h @@ -1,10 +1,15 @@ #ifndef __SIGNAL_H #define __SIGNAL_H +#include <signal.h> +#include <stddef.h> +#include <time.h> + #define __BITS_SIGEVENT_H_ -#include <bits/sigevent.h> #define __BITS_SIGINFO_H_ +#include "signal.h" + #include <bits/siginfo.h> // for siginfo_t union sigval; diff --git a/include/stdatomic.h b/include/stdatomic.h index fcc39f8c..8863815d 100644 --- a/include/stdatomic.h +++ b/include/stdatomic.h @@ -1,6 +1,7 @@ #ifndef __STDATOMIC_H #define __STDATOMIC_H +#include <stdatomic.h> #define atomic_bool _Atomic _Bool #define atomic_char _Atomic char #define atomic_schar _Atomic signed char diff --git a/include/stdint.h b/include/stdint.h index a1a2768d..cb5bd89f 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -1,6 +1,7 @@ #ifndef __STDINT_H #define __STDINT_H +#include <stdint.h> #undef WCHAR_MAX #undef WCHAR_MIN #if L'\0' - 1 > 0 diff --git a/include/stdio.h b/include/stdio.h index c6067775..65aff35c 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,6 +1,8 @@ #ifndef __STDIO_H #define __STDIO_H +#include <stddef.h> +#include <stdio.h> #define __BITS_ERRNO_H_ #include <bits/errno.h> diff --git a/include/stdlib.h b/include/stdlib.h index e9686678..a75dbb43 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,6 +1,7 @@ #ifndef __STDLIB_H #define __STDLIB_H +#include <stddef.h> #define __BITS_WAIT_H_ #include <bits/wait.h> diff --git a/include/string.h b/include/string.h index 707d9eeb..0b46dfa3 100644 --- a/include/string.h +++ b/include/string.h @@ -1,6 +1,7 @@ #ifndef __STRING_H #define __STRING_H +#include <stddef.h> #define __BITS_ERRNO_H_ #include <bits/errno.h> diff --git a/include/strings.h b/include/strings.h index cd8743c4..72f04963 100644 --- a/include/strings.h +++ b/include/strings.h @@ -1,6 +1,7 @@ #ifndef __STRINGS_H #define __STRINGS_H +#include <stddef.h> typedef __SIZE_TYPE__ size_t; int ffs(int); diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index 0d6f6327..4c86d599 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -12,6 +12,7 @@ #define __malloc __attribute__((__malloc__)) #define __pure __attribute__((__pure__)) #define __nodiscard __attribute__((__warn_unused_result__)) +#define __weak __attribute__((__weak__)) #define __predict_true(exp) __builtin_expect((exp) != 0, 1) #define __predict_false(exp) __builtin_expect((exp) != 0, 0) diff --git a/include/sys/mman.h b/include/sys/mman.h index 3e5dbf96..78b72c48 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -1,6 +1,7 @@ #ifndef __SYS_MMAN_H #define __SYS_MMAN_H +#include <stddef.h> typedef __SIZE_TYPE__ size_t; typedef __INT64_TYPE__ off_t; typedef __UINT32_TYPE__ mode_t; diff --git a/include/sys/msg.h b/include/sys/msg.h index b9a16349..60c389bd 100644 --- a/include/sys/msg.h +++ b/include/sys/msg.h @@ -1,7 +1,9 @@ #ifndef __SYS_MSG_H #define __SYS_MSG_H +#include <stddef.h> #include <sys/ipc.h> +#include <time.h> typedef __INT64_TYPE__ pid_t; typedef __INT64_TYPE__ ssize_t; diff --git a/include/sys/resource.h b/include/sys/resource.h index 79fcf235..086d8cd8 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -1,6 +1,7 @@ #ifndef __SYS_RESOURCE_H #define __SYS_RESOURCE_H +#include <time.h> typedef __INT64_TYPE__ time_t; typedef __INT64_TYPE__ suseconds_t; diff --git a/include/sys/select.h b/include/sys/select.h index 16b391d1..9c1edcae 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -1,14 +1,12 @@ #ifndef __SYS_SELECT_H #define __SYS_SELECT_H +#include <time.h> #define __BITS_SELECT_H_ -#include <bits/select.h> +#include <bits/select.h> // for fd_set #define __BITS_TIMESPEC_H_ -#include <bits/timespec.h> - struct timespec; -struct timeval; typedef __UINT64_TYPE__ sigset_t; diff --git a/include/sys/sem.h b/include/sys/sem.h index 2fdaa834..bdfe969e 100644 --- a/include/sys/sem.h +++ b/include/sys/sem.h @@ -1,7 +1,9 @@ #ifndef __SYS_SEM_H #define __SYS_SEM_H +#include <stddef.h> #include <sys/ipc.h> +#include <time.h> #define SEM_UNDO 0x1000 #define GETNCNT 14 diff --git a/include/sys/socket.h b/include/sys/socket.h index d8a48dd0..0dd4f454 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -1,6 +1,7 @@ #ifndef __SYS_SOCKET_H #define __SYS_SOCKET_H +#include <stddef.h> #define SCM_RIGHTS 0x01 #define CMSG_DATA(cmsg) ((void *)(cmsg) + sizeof(struct cmsghdr)) diff --git a/include/sys/stat.h b/include/sys/stat.h index ceb0826f..85efb075 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -1,6 +1,7 @@ #ifndef __SYS_STAT_H #define __SYS_STAT_H +#include <time.h> #define __BITS_STAT_H_ #include <bits/stat.h> #undef __BITS_STAT_H_ diff --git a/include/sys/times.h b/include/sys/times.h index 4cc0e184..a14a6b6a 100644 --- a/include/sys/times.h +++ b/include/sys/times.h @@ -1,6 +1,7 @@ #ifndef __SYS_TIMES_H #define __SYS_TIMES_H +#include <time.h> typedef __INT64_TYPE__ clock_t; struct tms { diff --git a/include/sys/uio.h b/include/sys/uio.h index f14e2328..324dc00a 100644 --- a/include/sys/uio.h +++ b/include/sys/uio.h @@ -1,6 +1,7 @@ #ifndef __SYS_UIO_H #define __SYS_UIO_H +#include <stddef.h> typedef __SIZE_TYPE__ size_t; typedef __INT64_TYPE__ ssize_t; diff --git a/include/threads.h b/include/threads.h index 58fd8c87..54daec7b 100644 --- a/include/threads.h +++ b/include/threads.h @@ -1,6 +1,8 @@ #ifndef __THREADS_H #define __THREADS_H +#include <threads.h> +#include <time.h> #define thread_local _Thread_local #define ONCE_FLAG_INIT #define TSS_DTOR_ITERATIONS diff --git a/include/time.h b/include/time.h index fc089cda..e297ff59 100644 --- a/include/time.h +++ b/include/time.h @@ -1,6 +1,8 @@ #ifndef __TIME_H #define __TIME_H +#include <stddef.h> +#include <time.h> #define __BITS_TIMESPEC_H_ #include <bits/timespec.h> diff --git a/include/unistd.h b/include/unistd.h index 21822aed..dd8dba5a 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1,6 +1,7 @@ #ifndef __UNISTD_H #define __UNISTD_H +#include <stddef.h> #ifndef NULL #define NULL ((void *)0) #endif |
