Date: Sat, 7 Nov 2015 22:57:00 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290517 - head/usr.bin/localedef Message-ID: <201511072257.tA7Mv0uL014680@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Sat Nov 7 22:57:00 2015 New Revision: 290517 URL: https://svnweb.freebsd.org/changeset/base/290517 Log: Fix build of localedef(1) on arm where wchar_t is an unsigned int Modified: head/usr.bin/localedef/charmap.c head/usr.bin/localedef/ctype.c head/usr.bin/localedef/localedef.h Modified: head/usr.bin/localedef/charmap.c ============================================================================== --- head/usr.bin/localedef/charmap.c Sat Nov 7 22:52:06 2015 (r290516) +++ head/usr.bin/localedef/charmap.c Sat Nov 7 22:57:00 2015 (r290517) @@ -227,7 +227,7 @@ add_charmap_impl(const char *sym, wchar_ * 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 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); Modified: head/usr.bin/localedef/ctype.c ============================================================================== --- head/usr.bin/localedef/ctype.c Sat Nov 7 22:52:06 2015 (r290516) +++ head/usr.bin/localedef/ctype.c Sat Nov 7 22:57:00 2015 (r290517) @@ -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; Modified: head/usr.bin/localedef/localedef.h ============================================================================== --- head/usr.bin/localedef/localedef.h Sat Nov 7 22:52:06 2015 (r290516) +++ head/usr.bin/localedef/localedef.h Sat Nov 7 22:57:00 2015 (r290517) @@ -124,7 +124,7 @@ wchar_t * wsncpy(wchar_t *, const wchar_ /* 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511072257.tA7Mv0uL014680>