summaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2017-06-20 09:26:43 -0400
committerZack Weinberg <zackw@panix.com>2017-06-20 20:30:06 -0400
commitaf85385f311c574590381f7897461643f8a2fe6f (patch)
treeb1cd7d3f16a4e66a60db7fd714b6cb9823fbdc35 /locale
parentf0be25b6336db7492e47d2e8e72eb8af53b5506d (diff)
downloadglibc-af85385f311c574590381f7897461643f8a2fe6f.tar.gz
Use locale_t, not __locale_t, throughout glibc
<locale.h> is specified to define locale_t in POSIX.1-2008, and so are all of the headers that define functions that take locale_t arguments. Under _GNU_SOURCE, the additional headers that define such functions have also always defined locale_t. Therefore, there is no need to use __locale_t in public function prototypes, nor in any internal code. * ctype/ctype-c99_l.c, ctype/ctype.h, ctype/ctype_l.c * include/monetary.h, include/stdlib.h, include/time.h * include/wchar.h, locale/duplocale.c, locale/freelocale.c * locale/global-locale.c, locale/langinfo.h, locale/locale.h * locale/localeinfo.h, locale/newlocale.c * locale/nl_langinfo_l.c, locale/uselocale.c * localedata/bug-usesetlocale.c, localedata/tst-xlocale2.c * stdio-common/vfscanf.c, stdlib/monetary.h, stdlib/stdlib.h * stdlib/strfmon_l.c, stdlib/strtod_l.c, stdlib/strtof_l.c * stdlib/strtol.c, stdlib/strtol_l.c, stdlib/strtold_l.c * stdlib/strtoll_l.c, stdlib/strtoul_l.c, stdlib/strtoull_l.c * string/strcasecmp.c, string/strcoll_l.c, string/string.h * string/strings.h, string/strncase.c, string/strxfrm_l.c * sysdeps/ieee754/float128/strtof128_l.c * sysdeps/ieee754/float128/wcstof128.c * sysdeps/ieee754/float128/wcstof128_l.c * sysdeps/ieee754/ldbl-128ibm/strtold_l.c * sysdeps/ieee754/ldbl-64-128/strtold_l.c * sysdeps/ieee754/ldbl-opt/nldbl-compat.c * sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c * sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c * sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c * sysdeps/powerpc/powerpc32/power7/strcasecmp.S * sysdeps/powerpc/powerpc64/power7/strcasecmp.S * sysdeps/x86_64/strcasecmp_l-nonascii.c * sysdeps/x86_64/strncase_l-nonascii.c, time/strftime_l.c * time/strptime_l.c, time/time.h, wcsmbs/mbsrtowcs_l.c * wcsmbs/wchar.h, wcsmbs/wcscasecmp.c, wcsmbs/wcsncase.c * wcsmbs/wcstod.c, wcsmbs/wcstod_l.c, wcsmbs/wcstof.c * wcsmbs/wcstof_l.c, wcsmbs/wcstol_l.c, wcsmbs/wcstold.c * wcsmbs/wcstold_l.c, wcsmbs/wcstoll_l.c, wcsmbs/wcstoul_l.c * wcsmbs/wcstoull_l.c, wctype/iswctype_l.c * wctype/towctrans_l.c, wctype/wcfuncs_l.c * wctype/wctrans_l.c, wctype/wctype.h, wctype/wctype_l.c: Change all uses of __locale_t to locale_t.
Diffstat (limited to 'locale')
-rw-r--r--locale/duplocale.c6
-rw-r--r--locale/freelocale.c2
-rw-r--r--locale/global-locale.c2
-rw-r--r--locale/langinfo.h2
-rw-r--r--locale/locale.h12
-rw-r--r--locale/localeinfo.h4
-rw-r--r--locale/newlocale.c8
-rw-r--r--locale/nl_langinfo_l.c2
-rw-r--r--locale/uselocale.c2
9 files changed, 20 insertions, 20 deletions
diff --git a/locale/duplocale.c b/locale/duplocale.c
index 07c2c58646..4bf1d56399 100644
--- a/locale/duplocale.c
+++ b/locale/duplocale.c
@@ -29,8 +29,8 @@
__libc_rwlock_define (extern , __libc_setlocale_lock attribute_hidden)
-__locale_t
-__duplocale (__locale_t dataset)
+locale_t
+__duplocale (locale_t dataset)
{
/* This static object is returned for newlocale (LC_ALL_MASK, "C"). */
if (dataset == _nl_C_locobj_ptr)
@@ -40,7 +40,7 @@ __duplocale (__locale_t dataset)
if (dataset == LC_GLOBAL_LOCALE)
dataset = &_nl_global_locale;
- __locale_t result;
+ locale_t result;
int cnt;
size_t names_len = 0;
diff --git a/locale/freelocale.c b/locale/freelocale.c
index 393fab5ea6..e3263967eb 100644
--- a/locale/freelocale.c
+++ b/locale/freelocale.c
@@ -29,7 +29,7 @@ __libc_rwlock_define (extern , __libc_setlocale_lock attribute_hidden)
void
-__freelocale (__locale_t dataset)
+__freelocale (locale_t dataset)
{
int cnt;
diff --git a/locale/global-locale.c b/locale/global-locale.c
index 3629c72207..cf5f8cf8d8 100644
--- a/locale/global-locale.c
+++ b/locale/global-locale.c
@@ -61,4 +61,4 @@ struct __locale_struct _nl_global_locale attribute_hidden =
#include <tls.h>
/* The tsd macros don't permit an initializer. */
-__thread __locale_t __libc_tsd_LOCALE = &_nl_global_locale;
+__thread locale_t __libc_tsd_LOCALE = &_nl_global_locale;
diff --git a/locale/langinfo.h b/locale/langinfo.h
index 93d84463b5..14039576bc 100644
--- a/locale/langinfo.h
+++ b/locale/langinfo.h
@@ -588,7 +588,7 @@ extern char *nl_langinfo (nl_item __item) __THROW;
# include <bits/types/locale_t.h>
/* Just like nl_langinfo but get the information from the locale object L. */
-extern char *nl_langinfo_l (nl_item __item, __locale_t __l);
+extern char *nl_langinfo_l (nl_item __item, locale_t __l);
#endif
__END_DECLS
diff --git a/locale/locale.h b/locale/locale.h
index 6c1b22051b..ba025f67ba 100644
--- a/locale/locale.h
+++ b/locale/locale.h
@@ -138,8 +138,8 @@ extern struct lconv *localeconv (void) __THROW;
datasets. Unlike for the CATEGORY parameter for `setlocale' the
CATEGORY_MASK parameter here uses a single bit for each category,
made by OR'ing together LC_*_MASK bits above. */
-extern __locale_t newlocale (int __category_mask, const char *__locale,
- __locale_t __base) __THROW;
+extern locale_t newlocale (int __category_mask, const char *__locale,
+ locale_t __base) __THROW;
/* These are the bits that can be set in the CATEGORY_MASK argument to
`newlocale'. In the GNU implementation, LC_FOO_MASK has the value
@@ -173,22 +173,22 @@ extern __locale_t newlocale (int __category_mask, const char *__locale,
/* Return a duplicate of the set of locale in DATASET. All usage
counters are increased if necessary. */
-extern __locale_t duplocale (__locale_t __dataset) __THROW;
+extern locale_t duplocale (locale_t __dataset) __THROW;
/* Free the data associated with a locale dataset previously returned
by a call to `setlocale_r'. */
-extern void freelocale (__locale_t __dataset) __THROW;
+extern void freelocale (locale_t __dataset) __THROW;
/* Switch the current thread's locale to DATASET.
If DATASET is null, instead just return the current setting.
The special value LC_GLOBAL_LOCALE is the initial setting
for all threads and can also be installed any time, meaning
the thread uses the global settings controlled by `setlocale'. */
-extern __locale_t uselocale (__locale_t __dataset) __THROW;
+extern locale_t uselocale (locale_t __dataset) __THROW;
/* This value can be passed to `uselocale' and may be returned by it.
Passing this value to any other function has undefined behavior. */
-# define LC_GLOBAL_LOCALE ((__locale_t) -1L)
+# define LC_GLOBAL_LOCALE ((locale_t) -1L)
#endif
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index f0694dc84e..4e1c8c568a 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -214,9 +214,9 @@ extern struct __locale_struct _nl_global_locale attribute_hidden;
/* This fetches the thread-local locale_t pointer, either one set with
uselocale or &_nl_global_locale. */
-#define _NL_CURRENT_LOCALE (__libc_tsd_get (__locale_t, LOCALE))
+#define _NL_CURRENT_LOCALE (__libc_tsd_get (locale_t, LOCALE))
#include <libc-tsd.h>
-__libc_tsd_define (extern, __locale_t, LOCALE)
+__libc_tsd_define (extern, locale_t, LOCALE)
/* For static linking it is desireable to avoid always linking in the code
diff --git a/locale/newlocale.c b/locale/newlocale.c
index 2190b7351b..828d715c37 100644
--- a/locale/newlocale.c
+++ b/locale/newlocale.c
@@ -39,13 +39,13 @@ __libc_rwlock_define (extern , __libc_setlocale_lock attribute_hidden)
} while (0)
-__locale_t
-__newlocale (int category_mask, const char *locale, __locale_t base)
+locale_t
+__newlocale (int category_mask, const char *locale, locale_t base)
{
/* Intermediate memory for result. */
const char *newnames[__LC_LAST];
struct __locale_struct result;
- __locale_t result_ptr;
+ locale_t result_ptr;
char *locale_path;
size_t locale_path_len;
const char *locpath_var;
@@ -86,7 +86,7 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
dataset using the C locale data. */
if (category_mask == 0)
{
- result_ptr = (__locale_t) malloc (sizeof (struct __locale_struct));
+ result_ptr = (locale_t) malloc (sizeof (struct __locale_struct));
if (result_ptr == NULL)
return NULL;
*result_ptr = result;
diff --git a/locale/nl_langinfo_l.c b/locale/nl_langinfo_l.c
index 89acdbde01..f29a5a550e 100644
--- a/locale/nl_langinfo_l.c
+++ b/locale/nl_langinfo_l.c
@@ -27,7 +27,7 @@
/* Return a string with the data for locale-dependent parameter ITEM. */
char *
-__nl_langinfo_l (nl_item item, __locale_t l)
+__nl_langinfo_l (nl_item item, locale_t l)
{
int category = _NL_ITEM_CATEGORY (item);
unsigned int index = _NL_ITEM_INDEX (item);
diff --git a/locale/uselocale.c b/locale/uselocale.c
index 9ef22d3cf9..a66b9cb5d6 100644
--- a/locale/uselocale.c
+++ b/locale/uselocale.c
@@ -34,7 +34,7 @@ __uselocale (locale_t newloc)
{
const locale_t locobj
= newloc == LC_GLOBAL_LOCALE ? &_nl_global_locale : newloc;
- __libc_tsd_set (__locale_t, LOCALE, locobj);
+ __libc_tsd_set (locale_t, LOCALE, locobj);
#ifdef NL_CURRENT_INDIRECT
/* Now we must update all the per-category thread-local variables to