From nobody Thu Feb 03 02:49:32 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 D8DA319A0A77; Thu, 3 Feb 2022 02:49:33 +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 4Jq36N4L1kz4b3n; Thu, 3 Feb 2022 02:49:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643856573; 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=Trjrdp2NPACxganS6uUeksXZcPphbILz/H7QhmaNQQw=; b=JCOfMtLYEb9gkRiMaHCsmqBfkD+Zf8E/nu+Q9XnA8FJ61tLpALJZcAw0nRfjsaI5lqokP2 9DSgLFkVUFW3H1TpOnzvpIswmJryLoe4VT9MX8dcAiCMdfvCWdzVQegO208Q298vhoOHs+ eDOY8nLWJtpOQ9UUBArlDFUvBr9LAvyscL5mol/YnrKtWvghkeTnBr6gMape1/QXstazNt nS2SdEAwy7lInVx3Ak0DOEapf7KNuqiLdIRqSLpkuiBRoHek9iz2lrktS/+CDviGJ08Nsw kUg/e/lkefZEQsNH6SHJjfyTM6ao4digVSOgFcMRXqoToOmms1ka98d1dmlMSg== 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 5B22D100FD; Thu, 3 Feb 2022 02:49:32 +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 2132nWHh087085; Thu, 3 Feb 2022 02:49:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2132nWZA087084; Thu, 3 Feb 2022 02:49:32 GMT (envelope-from git) Date: Thu, 3 Feb 2022 02:49:32 GMT Message-Id: <202202030249.2132nWZA087084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5b7e92d48fbc - main - libc/locale/lmessages.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/main X-Git-Reftype: branch X-Git-Commit: 5b7e92d48fbc94b8a95a9f96ab501de5af1ed115 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643856573; 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=Trjrdp2NPACxganS6uUeksXZcPphbILz/H7QhmaNQQw=; b=FT4mhvpMtWmvXwQQuC2g948O4OCEaIwmHwKtGuSdnr+M8AM+Yqpr/xUC/QL/ktpG8cUH9C /g5n55rl22FBsyfXPSeqR/AlcCOtLeds4p8dMPMpx8Mp6UmeBp0KacDSJYuIaViKlaSLRF vPhc6X32iYmvTMf0sy2UZSL1GugtOruO3FE3q3bLm36DQ1qCucZplg3/SJjFzm3ZuXdhni DdnpEUFWO/TB5okikSWY/3cKGQqrqmVLAa+vhFYya4ZmdU9lszLDbDpvHiJ0edOQEWKYNj C5peV6p8FQuTlNaEDwlTSSHRqw0GWrS8G0A+AS/+ho9d84A6q/dFbZ1a1Q8cng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643856573; a=rsa-sha256; cv=none; b=dwxsroEjK6zPiIhHUK5opXzNfCSjxIQCvz5pjTKcwH6FBPaypJi+JLrrWXFx0mbeuS60A4 XZuWqN5MAiC/lBozVrU7lvfLqBxpRvVqerPG3OhqkCaGHzsO3h6QjW108hUdo6RCTwH760 cjDJwzvdADPvVPAHPBoRtJ/wzUNHNQcCCcCxDUTB7d6KONeXRat7vjt5BK7Kyw5BRYMxZD FpMEfCpeBamDRpCDHKqo9aCcFTC1t4vwcubxucB5sisi66yCPSQVZmaJvxA5NEpSfarys9 HLeCSIIIUFumQ085xTcoP+kYgFaTeiBVQcUdAwlEgR74su7mJ3fOa+7GVt1gog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5b7e92d48fbc94b8a95a9f96ab501de5af1ed115 commit 5b7e92d48fbc94b8a95a9f96ab501de5af1ed115 Author: Konstantin Belousov AuthorDate: 2022-02-02 18:06:39 +0000 Commit: Konstantin Belousov CommitDate: 2022-02-03 01:03:17 +0000 libc/locale/lmessages.c: minor style Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34140 --- lib/libc/locale/lmessages.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/libc/locale/lmessages.c b/lib/libc/locale/lmessages.c index 9c442dc3d7a1..fd00fc16a4ea 100644 --- a/lib/libc/locale/lmessages.c +++ b/lib/libc/locale/lmessages.c @@ -60,7 +60,8 @@ static const struct lc_messages_T _C_messages_locale = { "no" /* nostr */ }; -static void destruct_messages(void *v) +static void +destruct_messages(void *v) { struct xlocale_messages *l = v; if (l->buffer) @@ -69,7 +70,8 @@ static void destruct_messages(void *v) } static int -messages_load_locale(struct xlocale_messages *loc, int *using_locale, const char *name) +messages_load_locale(struct xlocale_messages *loc, int *using_locale, + const char *name) { int ret; struct lc_messages_T *l = &loc->locale; @@ -86,35 +88,39 @@ messages_load_locale(struct xlocale_messages *loc, int *using_locale, const char } return (ret); } + int __messages_load_locale(const char *name) { - return messages_load_locale(&__xlocale_global_messages, - &__xlocale_global_locale.using_messages_locale, name); + return (messages_load_locale(&__xlocale_global_messages, + &__xlocale_global_locale.using_messages_locale, name)); } + void * __messages_load(const char *name, locale_t l) { - struct xlocale_messages *new = calloc(sizeof(struct xlocale_messages), 1); + struct xlocale_messages *new = calloc(sizeof(struct xlocale_messages), + 1); new->header.header.destructor = destruct_messages; - if (messages_load_locale(new, &l->using_messages_locale, name) == _LDP_ERROR) { + if (messages_load_locale(new, &l->using_messages_locale, name) == + _LDP_ERROR) { xlocale_release(new); - return NULL; + return (NULL); } - return new; + return (new); } struct lc_messages_T * __get_current_messages_locale(locale_t loc) { - return (loc->using_messages_locale - ? &((struct xlocale_messages *)loc->components[XLC_MESSAGES])->locale - : (struct lc_messages_T *)&_C_messages_locale); + return (loc->using_messages_locale ? &((struct xlocale_messages *) + loc->components[XLC_MESSAGES])->locale : + (struct lc_messages_T *)&_C_messages_locale); } #ifdef LOCALE_DEBUG void -msgdebug() { +msgdebug(void) { printf( "yesexpr = %s\n" "noexpr = %s\n" "yesstr = %s\n"