1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-20 13:55:35 +02:00

passt: Add clang-tidy Makefile target and test, take care of warnings

Most are just about style and form, but a few were actually
serious mistakes (NDP-related).

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-20 00:05:11 +02:00
parent 7f1e7019cb
commit 12cfa6444c
14 changed files with 172 additions and 73 deletions

6
util.h
View file

@ -36,7 +36,7 @@ void debug(const char *format, ...);
#define SWAP(a, b) \
do { \
typeof(a) __x = (a); (a) = (b); (b) = __x; \
__typeof__(a) __x = (a); (a) = (b); (b) = __x; \
} while (0) \
#define STRINGIFY(x) #x
@ -152,7 +152,7 @@ enum bind_type {
struct ctx;
void __openlog(const char *ident, int option, int facility);
void passt_vsyslog(int pri, const char *fmt, va_list ap);
void passt_vsyslog(int pri, const char *format, va_list ap);
void __setlogmask(int mask);
char *ipv6_l4hdr(struct ipv6hdr *ip6h, uint8_t *proto);
int sock_l4(struct ctx *c, int af, uint8_t proto, uint16_t port,
@ -161,7 +161,7 @@ void sock_probe_mem(struct ctx *c);
int timespec_diff_ms(struct timespec *a, struct timespec *b);
void bitmap_set(uint8_t *map, int bit);
void bitmap_clear(uint8_t *map, int bit);
int bitmap_isset(uint8_t *map, int bit);
int bitmap_isset(const uint8_t *map, int bit);
char *line_read(char *buf, size_t len, int fd);
void procfs_scan_listen(char *name, uint8_t *map, uint8_t *exclude);
int ns_enter(struct ctx *c);