From nobody Wed Feb 09 00:48:05 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BC99519B6E28; Wed, 9 Feb 2022 00:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jth7T4vzNz4tb7; Wed, 9 Feb 2022 00:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644367685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0Y5GuUCndqevSShtcrYeno4JjGlyn5RyGbJ0WeiZ+A=; b=IPRa9+z4wVsNnJzwURx7brYCSSBYsWHJTjZ87JdOaPyJXEmsIiJR0jrnFl22DDXjX2UEmf mJvElrDlV8ZYVb4zLPEAD5Z157lygnsZsxcGsdCpJaLb1U9Nj1FD9lCbrnbvhN8bIsqWPo +JzLmxJ+uDvA+MkSnUHo7sZvcRXIsw4/n1pCzPfZb0trY+Rh/uj0X2KY2WO2tb3nHTdHJT yey75gK7+Nb6Oku0beFQj/opm6YMTm/D7BQfwCfibQEQgN1eBMaZSYelR8TTPYJOrvGzQh OatqEqYZts3lyfP7FMDrrGQmdvZP2Q5cB5QfLkZCSAibrhsp4r++HE5Ip/nl4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89546235CD; Wed, 9 Feb 2022 00:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2190m5rS083641; Wed, 9 Feb 2022 00:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2190m5O7083640; Wed, 9 Feb 2022 00:48:05 GMT (envelope-from git) Date: Wed, 9 Feb 2022 00:48:05 GMT Message-Id: <202202090048.2190m5O7083640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8a8709c408fc - stable/13 - libc/locale/xlocale.c: minor style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a8709c408fcf1570204b3674bfcba2b02b57337 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644367685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q0Y5GuUCndqevSShtcrYeno4JjGlyn5RyGbJ0WeiZ+A=; b=HoTWNKzDvqGmw99x7xGC9XFCjH17YHGDtmDwxQq5tY//H3aiEUo3V/qfTk9zfFA8KhJkMy b4bJXrvtvjVta6HeVdHDBe+GbGtIsyZKBSQkzX+uliPLK294rhG5Jh1ifb30X0TCedddi2 CqxwogvhyzZPgQQjUUrYflzpjHjc+G2TDXJz7xSsemmqs4YDGUaNK66txRB5qniQfrjIAo wccTUvSBSRrA6FX6qhRTvRE2l7cPrqQ0Fu7glbQWlnFgs4zNNra8aOgoOjP5njd//vmgbw 0Pqha7v3siCo17Yy69WWOfjybhTJ4KhJt+qduUkAkvh4MbXv6CAbSv11WJ1eNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644367685; a=rsa-sha256; cv=none; b=THDtpWNpEiFHXi85GSumUB6aaufRBdduSzBWyr7q/C+LtVnk+gOgbjClAF34zyFeRMFTk/ XZpdFY9G4UJjp9vlbBPkGTUZCAT5ftQArvFb1U2hlt0Uq9RXOW37fYd6W/VsEpkERqshNA fDOQ4Rt9Z29qjWe6Dt4LRFofzVV8Z4PO5hSmjGRAWTSXWhuW1FuCV/jaKjK0ktOvBImeYk HCtx8yWrx/zq6F6dw97KUyOfZ4jYtEUkhWa4+9iUMkOakK032Jf9kTRkdq6g1U0IUC4Mum 0iuwu3Zi0ZzM3S76XxoN6QuKo4AenukQ/yKTYuM+duD45IyW3FArIfqxfr3v9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8a8709c408fcf1570204b3674bfcba2b02b57337 commit 8a8709c408fcf1570204b3674bfcba2b02b57337 Author: Konstantin Belousov AuthorDate: 2022-02-02 17:23:14 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-09 00:42:45 +0000 libc/locale/xlocale.c: minor style (cherry picked from commit aaa6fa65a6a03ca6cef9bde47341a2ded7c4fed6) --- lib/libc/locale/xlocale.c | 30 ++++++++++++++++++------------ 1 file 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) {