diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-25 19:24:38 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-25 20:35:03 +0100 |
| commit | a984eb367c032dbe2577f01238c3d1268526be70 (patch) | |
| tree | 437fef40379b2758b129ccea39df3570fa2d145e /include/sys/socket.h | |
| parent | 8834571b202cf4dc9c649cfb096c213b6ecf1566 (diff) | |
Clang-tidy fixes
Diffstat (limited to 'include/sys/socket.h')
| -rw-r--r-- | include/sys/socket.h | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/include/sys/socket.h b/include/sys/socket.h index 0dd4f454..ca3553ae 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -6,22 +6,18 @@ #define CMSG_DATA(cmsg) ((void *)(cmsg) + sizeof(struct cmsghdr)) -#define CMSG_NXTHDR(mhdr, cmsg) \ - ((cmsg)->cmsg_len < sizeof(struct cmsghdr) || \ - (((cmsg)->cmsg_len + sizeof(long) - 1) & \ - ~(long)(sizeof(long) - 1)) + \ - sizeof(struct cmsghdr) >= \ - ((unsigned char *)(mhdr)->msg_control + \ - (mhdr)->msg_controllen) - \ - (unsigned char *)(cmsg) ? \ - 0 : \ - (struct cmsghdr *)((unsigned char *)(cmsg) + \ - __CMSG_LEN(cmsg))) - -#define CMSG_FIRSTHDR(mhdr) \ - ((size_t)(mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ - (struct cmsghdr *)(mhdr)->msg_control : \ - (struct cmsghdr *)0) +#define CMSG_NXTHDR(mhdr, cmsg) \ + ((cmsg)->cmsg_len < sizeof(struct cmsghdr) || \ + (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1)) + \ + sizeof(struct cmsghdr) >= \ + ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen) - \ + (unsigned char *)(cmsg) ? \ + 0 : \ + (struct cmsghdr *)((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))) + +#define CMSG_FIRSTHDR(mhdr) \ + ((size_t)(mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(mhdr)->msg_control : \ + (struct cmsghdr *)0) #define CMSG_SPACE(len) (CMSG_ALIGN(len) + CMSG_ALIGN(sizeof(struct cmsghdr))) @@ -127,13 +123,11 @@ int getsockname(int, struct sockaddr *restrict, socklen_t *restrict); int getsockopt(int, int, int, void *restrict, socklen_t *restrict); int listen(int, int); ssize_t recv(int, void *, size_t, int); -ssize_t recvfrom(int, void *restrict, size_t, int, struct sockaddr *restrict, - socklen_t *restrict); +ssize_t recvfrom(int, void *restrict, size_t, int, struct sockaddr *restrict, socklen_t *restrict); ssize_t recvmsg(int, struct msghdr *, int); ssize_t send(int, const void *, size_t, int); ssize_t sendmsg(int, const struct msghdr *, int); -ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, - socklen_t); +ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); int setsockopt(int, int, int, const void *, socklen_t); int shutdown(int, int); int sockatmark(int); |
