From patchwork Tue Sep 5 16:05:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Stelmach?= X-Patchwork-Id: 22623 Received: (qmail 117717 invoked by alias); 5 Sep 2017 16:06:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 117650 invoked by uid 89); 5 Sep 2017 16:06:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=canon X-HELO: smtpo.poczta.interia.pl X-Interia-R: Interia X-Interia-R-IP: 89.64.33.181 X-Interia-R-Helo: From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= To: libc-alpha@sourceware.org Cc: =?UTF-8?q?=C5=81ukasz=20Stelmach?= Subject: [RFC][PATCH 1/4][BZ 17083] getaddrinfo: Add comments for #else and #endif directives Date: Tue, 5 Sep 2017 18:05:27 +0200 Message-Id: <20170905160530.19525-2-stlman@poczta.fm> In-Reply-To: <20170905160530.19525-1-stlman@poczta.fm> References: <20170905160530.19525-1-stlman@poczta.fm> MIME-Version: 1.0 X-Interia-Antivirus: OK X-IPL-POID: 4 X-IPL-SAS-SPAS: -0.6 X-IPL-SAS-UREP: 0 X-IPL-SAS-UREP-PRIV: 0 X-IPL-Envelope-To: stlman@poczta.fm Add comments after #else and #endif directives to help matching them with appropriate #ifdef lines. Fix a typo in a comment block. Signed-off-by: Ɓukasz Stelmach --- sysdeps/posix/getaddrinfo.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index ce099bdf9c..4b4e192e89 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -90,7 +90,7 @@ extern int __idna_to_ascii_lz (const char *input, char **output, int flags); extern int __idna_to_unicode_lzlz (const char *input, char **output, int flags); # include -#endif +#endif /* HAVE_LIBIDN */ struct gaih_service { @@ -129,14 +129,14 @@ static const struct gaih_typeproto gaih_inet_typeproto[] = { SOCK_DGRAM, IPPROTO_UDP, 0, true, "udp" }, #if defined SOCK_DCCP && defined IPPROTO_DCCP { SOCK_DCCP, IPPROTO_DCCP, 0, false, "dccp" }, -#endif +#endif /* SOCK_DCCP && IPPROTO_DCCP */ #ifdef IPPROTO_UDPLITE { SOCK_DGRAM, IPPROTO_UDPLITE, 0, false, "udplite" }, -#endif +#endif /* IPPROTO_UDPLITE */ #ifdef IPPROTO_SCTP { SOCK_STREAM, IPPROTO_SCTP, 0, false, "sctp" }, { SOCK_SEQPACKET, IPPROTO_SCTP, 0, false, "sctp" }, -#endif +#endif /* IPPROTO_SCTP */ { SOCK_RAW, 0, GAI_PROTO_PROTOANY|GAI_PROTO_NOSERVICE, true, "raw" }, { 0, 0, 0, false, "" } }; @@ -505,7 +505,7 @@ gaih_inet (const char *name, const struct gaih_service *service, malloc_name = true; } } -#endif +#endif /* HAVE_LIBIDN */ if (__inet_aton (name, (struct in_addr *) at->addr) != 0) { @@ -753,7 +753,7 @@ gaih_inet (const char *name, const struct gaih_service *service, goto free_and_return; } } -#endif +#endif /* USE_NSCD */ if (__nss_hosts_database == NULL) no_more = __nss_database_lookup ("hosts", NULL, @@ -1060,11 +1060,11 @@ gaih_inet (const char *name, const struct gaih_service *service, canon = out; } else -#endif +#endif /* HAVE_LIBIDN */ { #ifdef HAVE_LIBIDN make_copy: -#endif +#endif /* HAVE_LIBIDN */ if (canonbuf != NULL) /* We already allocated the string using malloc, but the buffer is now owned by canon. */ @@ -1193,9 +1193,9 @@ struct sort_result_combo #if __BYTE_ORDER == __BIG_ENDIAN # define htonl_c(n) n -#else +#else /* __BYTE_ORDER == __BIG_ENDIAN */ # define htonl_c(n) __bswap_constant_32 (n) -#endif +#endif /* __BYTE_ORDER == __BIG_ENDIAN */ static const struct scopeentry { @@ -1297,7 +1297,7 @@ static const struct prefixentry default_labels[] = }, 96, 4 }, /* The next two entries differ from RFC 3484. We need to treat IPv6 site-local addresses special because they are never NATed, - unlike site-locale IPv4 addresses. If this would not happen, on + unlike site-local IPv4 addresses. If this would not happen, on machines which have only IPv4 and IPv6 site-local addresses, the sorting would prefer the IPv6 site-local addresses, causing unnecessary delays when trying to connect to a global IPv6 address @@ -1715,7 +1715,7 @@ check_gaiconf_mtime (const struct stat64 *st) && st->st_mtim.tv_nsec == gaiconf_mtime.tv_nsec); } -#else +#else /* _STATBUF_ST_NSEC */ static time_t gaiconf_mtime; @@ -1731,7 +1731,7 @@ check_gaiconf_mtime (const struct stat64 *st) return st->st_mtime == gaiconf_mtime; } -#endif +#endif /* _STATBUF_ST_NSEC */ libc_freeres_fn(fini) @@ -2228,7 +2228,7 @@ getaddrinfo (const char *name, const char *service, #ifdef HAVE_LIBIDN |AI_IDN|AI_CANONIDN|AI_IDN_ALLOW_UNASSIGNED |AI_IDN_USE_STD3_ASCII_RULES -#endif +#endif /* HAVE_LIBIDN */ |AI_NUMERICSERV|AI_ALL)) return EAI_BADFLAGS;