Fix build of localedef(1) on arm where wchar_t is an unsigned int

This commit is contained in:
Baptiste Daroussin 2015-11-07 22:57:00 +00:00
parent 7535619977
commit 8c859b074e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290517
3 changed files with 5 additions and 5 deletions

View File

@ -227,7 +227,7 @@ add_charmap_impl(const char *sym, wchar_t wc, int nodups)
* also possibly insert the wide mapping, although note that there
* can only be one of these per wide character code.
*/
if ((wc != -1) && ((RB_FIND(cmap_wc, &cmap_wc, &srch)) == NULL)) {
if ((wc != (wchar_t)-1) && ((RB_FIND(cmap_wc, &cmap_wc, &srch)) == NULL)) {
if ((n = calloc(1, sizeof (*n))) == NULL) {
errf("out of memory");
return;
@ -269,7 +269,7 @@ add_charmap_undefined(char *sym)
srch.name = sym;
cm = RB_FIND(cmap_sym, &cmap_sym, &srch);
if ((undefok == 0) && ((cm == NULL) || (cm->wc == -1))) {
if ((undefok == 0) && ((cm == NULL) || (cm->wc == (wchar_t)-1))) {
warn("undefined symbol <%s>", sym);
add_charmap_impl(sym, -1, 0);
} else {
@ -344,7 +344,7 @@ lookup_charmap(const char *sym, wchar_t *wc)
srch.name = sym;
n = RB_FIND(cmap_sym, &cmap_sym, &srch);
if (n && n->wc != -1) {
if (n && n->wc != (wchar_t)-1) {
if (wc)
*wc = n->wc;
return (0);

View File

@ -199,7 +199,7 @@ add_ctype(int val)
}
void
add_ctype_range(int end)
add_ctype_range(wchar_t end)
{
ctype_node_t *ctn;
wchar_t cur;

View File

@ -124,7 +124,7 @@ wchar_t * wsncpy(wchar_t *, const wchar_t *, size_t);
/* ctype.c - LC_CTYPE handling */
void init_ctype(void);
void add_ctype(int);
void add_ctype_range(int);
void add_ctype_range(wchar_t);
void add_width(int, int);
void add_width_range(int, int, int);
void add_caseconv(int, int);