[PATCH] Remove PRI_MACROS_BROKEN define usage
Adhemerval Zanella
azanella@linux.vnet.ibm.com
Thu Mar 20 19:20:00 GMT 2014
On 20-03-2014 15:51, Joseph S. Myers wrote:
> On Thu, 20 Mar 2014, Adhemerval Zanella wrote:
>
>> Do we still want to keep code that no longer makes sense in our context?
>> GLIBC does not even have configure check for PRI_MACROS_BROKEN, so
>> should we keep aiming a possible sync? I personally aim for simplicity
>> and maintainability in this case, which means get rid of legacy code
>> that does not make sense for GLIBC.
> We want all files shared with other projects to be identical with the
> copies in those projects as far as possible (there may sometimes be cases
> where license notices need to be different, as with the files from GMP),
> to facilitate merging in both directions. This includes files shared with
> gnulib and gettext.
>
> (This does not necessarily mean a particular conditional is still relevant
> to the other projects; they too may remove support for some older systems,
> although supporting a much wider range of systems than glibc. But you'd
> need to consult with the gettext and gnulib communities to determine
> whether a conditional is still relevant there.)
>
Ok, I check with gettext implementation 'gettext-runtime/intl/loadmsgcat.c' and changed
the initial patch based on your suggestion (I also added some changes to make
glibc one similar to gettext one).
---
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index b96a997..d47b903 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -62,6 +62,7 @@ char *alloca ();
#ifdef _LIBC
# include <langinfo.h>
# include <locale.h>
+# define PRI_MACROS_BROKEN 0
#endif
#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
@@ -486,8 +487,7 @@ int _nl_msg_cat_cntr;
/* Expand a system dependent string segment. Return NULL if unsupported. */
static const char *
-get_sysdep_segment_value (name)
- const char *name;
+get_sysdep_segment_value (const char *name)
{
/* Test for an ISO C 99 section 7.8.1 format string directive.
Syntax:
@@ -756,9 +756,8 @@ get_sysdep_segment_value (name)
message catalog do nothing. */
void
internal_function
-_nl_load_domain (domain_file, domainbinding)
- struct loaded_l10nfile *domain_file;
- struct binding *domainbinding;
+_nl_load_domain (struct loaded_l10nfile *domain_file,
+ struct binding *domainbinding)
{
__libc_lock_define_initialized_recursive (static, lock);
int fd = -1;
@@ -821,7 +820,7 @@ _nl_load_domain (domain_file, domainbinding)
|| __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
|| __builtin_expect (size < sizeof (struct mo_file_header), 0))
/* Something went wrong. */
- goto out;;
+ goto out;
#ifdef HAVE_MMAP
/* Now we are ready to load the file. If mmap() is available we try
@@ -1277,8 +1276,7 @@ _nl_load_domain (domain_file, domainbinding)
#ifdef _LIBC
void
internal_function __libc_freeres_fn_section
-_nl_unload_domain (domain)
- struct loaded_domain *domain;
+_nl_unload_domain (struct loaded_domain *domain)
{
size_t i;
@@ -1289,7 +1287,7 @@ _nl_unload_domain (domain)
{
struct converted_domain *convd = &domain->conversions[i];
- free ((char *) convd->encoding);
+ free (convd->encoding);
if (convd->conv_tab != NULL && convd->conv_tab != (char **) -1)
free (convd->conv_tab);
if (convd->conv != (__gconv_t) -1)
More information about the Libc-alpha
mailing list