From patchwork Wed Jul 2 17:18:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 1855 Received: (qmail 2716 invoked by alias); 2 Jul 2014 17:17:18 -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 2699 invoked by uid 89); 2 Jul 2014 17:17:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Date: Wed, 2 Jul 2014 22:48:48 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [PATCH] Don't use __glibc_{,un}likely macros in loadmsgcat.c Message-ID: <20140702171848.GM20796@spoyarek.pnq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Hi, The __glibc_{,un}likely macros produce an unnecessary difference between our version of loadmsgcat.c and that of gettext. Can we make it a policy not to use them in shared code? Siddhesh * intl/loadmsgcat.c (_nl_load_domain): Use __builtin_expect. diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 325d699..7497172 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -820,7 +820,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); - if (__glibc_likely (data != MAP_FAILED)) + if (__builtin_expect (data != MAP_FAILED, 1)) { /* mmap() call was successful. */ close (fd); @@ -1248,7 +1248,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, /* Get the header entry and look for a plural specification. */ nullentry = _nl_find_msg (domain_file, domainbinding, "", 0, &nullentrylen); - if (__glibc_unlikely (nullentry == (char *) -1)) + if (__builtin_expect (nullentry == (char *) -1, 0)) { __libc_rwlock_fini (domain->conversions_lock); goto invalid;