From 8c859b074e557639cbaf4bea7715e1acc94406d7 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 7 Nov 2015 22:57:00 +0000 Subject: [PATCH] Fix build of localedef(1) on arm where wchar_t is an unsigned int --- usr.bin/localedef/charmap.c | 6 +++--- usr.bin/localedef/ctype.c | 2 +- usr.bin/localedef/localedef.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/localedef/charmap.c b/usr.bin/localedef/charmap.c index 0c6487390370..18db8027fe04 100644 --- a/usr.bin/localedef/charmap.c +++ b/usr.bin/localedef/charmap.c @@ -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); diff --git a/usr.bin/localedef/ctype.c b/usr.bin/localedef/ctype.c index a083c81f02ee..d610833fb27c 100644 --- a/usr.bin/localedef/ctype.c +++ b/usr.bin/localedef/ctype.c @@ -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; diff --git a/usr.bin/localedef/localedef.h b/usr.bin/localedef/localedef.h index 7805d376fc4c..8c829399d186 100644 --- a/usr.bin/localedef/localedef.h +++ b/usr.bin/localedef/localedef.h @@ -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);