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: 810213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-84191-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="o/VM7meT"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xms5t0Xbbz9ryk for ; Wed, 6 Sep 2017 02:06:25 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=fx+whuXaL7QmW9EdFCXNBMQ7HFhMmWcxLAq2IQULKO9 4L0QmAuAl0nKR2oXwKdomvc17XuPF7h4N+wHWEu8oju4oiARvyNrX8no7m7rcr2c iiAGu0r1XSQURo7Eon1qKz9d7qbvtU/sB50ohGtu/nYlcIjNTltSXOBhoOt6c900 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=ompHDxv7UiGT45NLsoewRIWHarw=; b=o/VM7meTeSH1OhRSD foCzYXV0Cl5aSQVgPXQyJaad/LsJRiozW44eOx5LD8Cf8fBgnGNCC0fY/zgxlWZ8 IIKT4zOodSFX6q+7Rq8v0rmmpUFL7apDXK6iZCJ6Mjw8yZGXx0Izo5bamtKr8L8J q2POE1W18WfpBmFTSlC9nMdVBE= 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_Stelmach?= To: libc-alpha@sourceware.org Cc: =?utf-8?q?=C5=81ukasz_Stelmach?= 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;