From ab878576bbdb42feb7d0be4393caaa6c55166d33 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 21 Apr 2022 11:09:33 +0200 Subject: [PATCH] LibC: Make nameinfo (NI_*) constants bitfield-friendly These are supposed to be used as flags in a bitfield, so let's make them powers of two. --- Userland/Libraries/LibC/netdb.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibC/netdb.h b/Userland/Libraries/LibC/netdb.h index 72561ebb79..eec4f3b496 100644 --- a/Userland/Libraries/LibC/netdb.h +++ b/Userland/Libraries/LibC/netdb.h @@ -90,11 +90,11 @@ struct addrinfo { #define NI_MAXHOST 1025 #define NI_MAXSERV 32 -#define NI_NUMERICHOST 1 -#define NI_NUMERICSERV 2 -#define NI_NAMEREQD 3 -#define NI_NOFQDN 4 -#define NI_DGRAM 5 +#define NI_NUMERICHOST (1 << 0) +#define NI_NUMERICSERV (1 << 1) +#define NI_NAMEREQD (1 << 2) +#define NI_NOFQDN (1 << 3) +#define NI_DGRAM (1 << 4) int getaddrinfo(char const* __restrict node, char const* __restrict service, const struct addrinfo* __restrict hints, struct addrinfo** __restrict res); void freeaddrinfo(struct addrinfo* res);