Module Name: src
Committed By: riastradh
Date: Fri Jun 7 13:53:02 UTC 2024
Modified Files:
src/lib/libc/locale: global_locale.c
Log Message:
libc/locale/global_locale.c: Nix confusing NBCHAR_MAX.
NBCHAR_MAX is used only in the usr.bin/mklocale build, but that
doesn't use global_locale.c. This was added when inserting char
casts, but using the mklocale's hook just to insert a char cast is
unnecessarily confusing -- and the char casts are unnecessary anyway.
No functional change intended. No binary change to aarch64 libc.
Raised in PR lib/58319.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/locale/global_locale.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/locale/global_locale.c
diff -u src/lib/libc/locale/global_locale.c:1.25 src/lib/libc/locale/global_locale.c:1.26
--- src/lib/libc/locale/global_locale.c:1.25 Fri Apr 29 16:26:48 2016
+++ src/lib/libc/locale/global_locale.c Fri Jun 7 13:53:02 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: global_locale.c,v 1.25 2016/04/29 16:26:48 joerg Exp $ */
+/* $NetBSD: global_locale.c,v 1.26 2024/06/07 13:53:02 riastradh Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: global_locale.c,v 1.25 2016/04/29 16:26:48 joerg Exp $");
+__RCSID("$NetBSD: global_locale.c,v 1.26 2024/06/07 13:53:02 riastradh Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -43,10 +43,6 @@ __RCSID("$NetBSD: global_locale.c,v 1.25
#include "runetype_local.h"
#include "setlocale_local.h"
-#ifndef NBCHAR_MAX
-#define NBCHAR_MAX (char)CHAR_MAX
-#endif
-
static const _MessagesLocale _DefaultMessagesLocale = {
"^[Yy]",
"^[Nn]",
@@ -124,20 +120,20 @@ __dso_hidden const struct _locale_cache_
.mon_grouping = __UNCONST(""),
.positive_sign = __UNCONST(""),
.negative_sign = __UNCONST(""),
- .int_frac_digits = NBCHAR_MAX,
- .frac_digits = NBCHAR_MAX,
- .p_cs_precedes = NBCHAR_MAX,
- .p_sep_by_space = NBCHAR_MAX,
- .n_cs_precedes = NBCHAR_MAX,
- .n_sep_by_space = NBCHAR_MAX,
- .p_sign_posn = NBCHAR_MAX,
- .n_sign_posn = NBCHAR_MAX,
- .int_p_cs_precedes = NBCHAR_MAX,
- .int_n_cs_precedes = NBCHAR_MAX,
- .int_p_sep_by_space = NBCHAR_MAX,
- .int_n_sep_by_space = NBCHAR_MAX,
- .int_p_sign_posn = NBCHAR_MAX,
- .int_n_sign_posn = NBCHAR_MAX,
+ .int_frac_digits = CHAR_MAX,
+ .frac_digits = CHAR_MAX,
+ .p_cs_precedes = CHAR_MAX,
+ .p_sep_by_space = CHAR_MAX,
+ .n_cs_precedes = CHAR_MAX,
+ .n_sep_by_space = CHAR_MAX,
+ .p_sign_posn = CHAR_MAX,
+ .n_sign_posn = CHAR_MAX,
+ .int_p_cs_precedes = CHAR_MAX,
+ .int_n_cs_precedes = CHAR_MAX,
+ .int_p_sep_by_space = CHAR_MAX,
+ .int_n_sep_by_space = CHAR_MAX,
+ .int_p_sign_posn = CHAR_MAX,
+ .int_n_sign_posn = CHAR_MAX,
},
.monetary_name = _lc_C_locale_name,
.numeric_name = _lc_C_locale_name,