libc/locale/xlocale.c: minor style
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34140
This commit is contained in:
parent
e2fe58d61b
commit
aaa6fa65a6
@ -64,13 +64,12 @@ _Thread_local locale_t __thread_locale;
|
||||
* Flag indicating that one or more per-thread locales exist.
|
||||
*/
|
||||
int __has_thread_locale;
|
||||
|
||||
/*
|
||||
* Private functions in setlocale.c.
|
||||
*/
|
||||
const char *
|
||||
__get_locale_env(int category);
|
||||
int
|
||||
__detect_path_locale(void);
|
||||
const char *__get_locale_env(int category);
|
||||
int __detect_path_locale(void);
|
||||
|
||||
struct _xlocale __xlocale_global_locale = {
|
||||
{0},
|
||||
@ -101,7 +100,7 @@ struct _xlocale __xlocale_C_locale = {
|
||||
0
|
||||
};
|
||||
|
||||
static void*(*constructors[])(const char*, locale_t) =
|
||||
static void *(*constructors[])(const char *, locale_t) =
|
||||
{
|
||||
__collate_load,
|
||||
__ctype_load,
|
||||
@ -115,7 +114,8 @@ static pthread_key_t locale_info_key;
|
||||
static int fake_tls;
|
||||
static locale_t thread_local_locale;
|
||||
|
||||
static void init_key(void)
|
||||
static void
|
||||
init_key(void)
|
||||
{
|
||||
|
||||
pthread_key_create(&locale_info_key, xlocale_release);
|
||||
@ -139,7 +139,7 @@ get_thread_locale(void)
|
||||
_once(&once_control, init_key);
|
||||
|
||||
return (fake_tls ? thread_local_locale :
|
||||
pthread_getspecific(locale_info_key));
|
||||
pthread_getspecific(locale_info_key));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -198,6 +198,7 @@ alloc_locale(void)
|
||||
new->numeric_locale_changed = 1;
|
||||
return (new);
|
||||
}
|
||||
|
||||
static void
|
||||
copyflags(locale_t new, locale_t old)
|
||||
{
|
||||
@ -207,7 +208,8 @@ copyflags(locale_t new, locale_t old)
|
||||
new->using_messages_locale = old->using_messages_locale;
|
||||
}
|
||||
|
||||
static int dupcomponent(int type, locale_t base, locale_t new)
|
||||
static int
|
||||
dupcomponent(int type, locale_t base, locale_t new)
|
||||
{
|
||||
/* Always copy from the global locale, since it has mutable components.
|
||||
*/
|
||||
@ -238,7 +240,8 @@ static int dupcomponent(int type, locale_t base, locale_t new)
|
||||
* xlocale interface.
|
||||
*/
|
||||
|
||||
locale_t newlocale(int mask, const char *locale, locale_t base)
|
||||
locale_t
|
||||
newlocale(int mask, const char *locale, locale_t base)
|
||||
{
|
||||
locale_t orig_base;
|
||||
int type;
|
||||
@ -295,7 +298,8 @@ locale_t newlocale(int mask, const char *locale, locale_t base)
|
||||
return (new);
|
||||
}
|
||||
|
||||
locale_t duplocale(locale_t base)
|
||||
locale_t
|
||||
duplocale(locale_t base)
|
||||
{
|
||||
locale_t new = alloc_locale();
|
||||
int type;
|
||||
@ -338,7 +342,8 @@ freelocale(locale_t loc)
|
||||
* Returns the name or version of the locale for a particular component of a
|
||||
* locale_t.
|
||||
*/
|
||||
const char *querylocale(int mask, locale_t loc)
|
||||
const char *
|
||||
querylocale(int mask, locale_t loc)
|
||||
{
|
||||
int type = ffs(mask & ~LC_VERSION_MASK) - 1;
|
||||
FIX_LOCALE(loc);
|
||||
@ -358,7 +363,8 @@ const char *querylocale(int mask, locale_t loc)
|
||||
/*
|
||||
* Installs the specified locale_t as this thread's locale.
|
||||
*/
|
||||
locale_t uselocale(locale_t loc)
|
||||
locale_t
|
||||
uselocale(locale_t loc)
|
||||
{
|
||||
locale_t old = get_thread_locale();
|
||||
if (NULL != loc) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user