This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Don't use __glibc_{,un}likely macros in loadmsgcat.c


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;

Attachment: pgpRzMAXvRPlX.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]