diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2022-02-02 17:23:14 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2022-02-09 00:42:45 +0000 |
commit | 8a8709c408fcf1570204b3674bfcba2b02b57337 (patch) | |
tree | d5ce2bfec8247fd18717f022f91e7e4c20c0b099 /lib | |
parent | 10007de3d929fba96b9f7c92bccd270448e5d851 (diff) | |
download | src-8a8709c408fcf1570204b3674bfcba2b02b57337.tar.gz src-8a8709c408fcf1570204b3674bfcba2b02b57337.zip |
libc/locale/xlocale.c: minor style
(cherry picked from commit aaa6fa65a6a03ca6cef9bde47341a2ded7c4fed6)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/xlocale.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/libc/locale/xlocale.c b/lib/libc/locale/xlocale.c index d64262da809e..528403693ad4 100644 --- a/lib/libc/locale/xlocale.c +++ b/lib/libc/locale/xlocale.c @@ -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) { |