From 12cfa6444cd239dbc04391027ad3161f53b6901c Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 20 Oct 2021 00:05:11 +0200 Subject: 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 --- util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index 44ba980..1fc2983 100644 --- a/util.h +++ b/util.h @@ -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); -- cgit v1.2.3