Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/citrus/modules/citrus_utf7.c,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libc/citrus/modules/citrus_utf7.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.6.22.2 retrieving revision 1.7 diff -u -p -r1.6.22.2 -r1.7 --- src/lib/libc/citrus/modules/citrus_utf7.c 2017/07/21 20:22:29 1.6.22.2 +++ src/lib/libc/citrus/modules/citrus_utf7.c 2022/04/19 20:32:14 1.7 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_utf7.c,v 1.6.22.2 2017/07/21 20:22:29 perseant Exp $ */ +/* $NetBSD: citrus_utf7.c,v 1.7 2022/04/19 20:32:14 rillig Exp $ */ /*- * Copyright (c)2004, 2005 Citrus Project, @@ -29,7 +29,7 @@ #include #if defined(LIB_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_utf7.c,v 1.6.22.2 2017/07/21 20:22:29 perseant Exp $"); +__RCSID("$NetBSD: citrus_utf7.c,v 1.7 2022/04/19 20:32:14 rillig Exp $"); #endif /* LIB_SCCS and not lint */ #include @@ -98,8 +98,6 @@ typedef struct { #define _ENCODING_IS_STATE_DEPENDENT 1 #define _STATE_NEEDS_EXPLICIT_INIT(_ps_) 0 -#include "citrus_u2k_template.h" - static __inline void /*ARGSUSED*/ _citrus_UTF7_init_state(_UTF7EncodingInfo * __restrict ei, @@ -273,7 +271,7 @@ ilseq: static int _citrus_UTF7_mbrtowc_priv(_UTF7EncodingInfo * __restrict ei, - wchar_ucs4_t * __restrict pwc, const char ** __restrict s, size_t n, + wchar_t * __restrict pwc, const char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { const char *s0; @@ -328,7 +326,7 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI done: *s = s0; if (pwc != NULL) - _citrus_UTF7_kt2ucs(ei, pwc, (wchar_kuten_t)u32); + *pwc = (wchar_t)u32; if (u32 == (uint32_t)0) { *nresult = (size_t)0; _citrus_UTF7_init_state(ei, psenc); @@ -393,7 +391,7 @@ _citrus_UTF7_utf16tomb(_UTF7EncodingInfo static int _citrus_UTF7_wcrtomb_priv(_UTF7EncodingInfo * __restrict ei, - char * __restrict s, size_t n, wchar_ucs4_t wchar, + char * __restrict s, size_t n, wchar_t wchar, _UTF7State * __restrict psenc, size_t * __restrict nresult) { uint32_t u32; @@ -406,8 +404,6 @@ _citrus_UTF7_wcrtomb_priv(_UTF7EncodingI _DIAGASSERT(psenc != NULL); _DIAGASSERT(nresult != NULL); - _citrus_UTF7_ucs2kt(ei, &wchar, wchar); - u32 = (uint32_t)wchar; if (u32 <= UTF16_MAX) { u16[0] = (uint16_t)u32; @@ -478,11 +474,11 @@ _citrus_UTF7_put_state_reset(_UTF7Encodi return 0; } -static int +static __inline int /*ARGSUSED*/ -_citrus_UTF7_stdenc_wctocs(struct _citrus_stdenc *ce, +_citrus_UTF7_stdenc_wctocs(_UTF7EncodingInfo * __restrict ei, _csid_t * __restrict csid, - _index_t * __restrict idx, wchar_kuten_t wc) + _index_t * __restrict idx, wchar_t wc) { /* ei seem to be unused */ _DIAGASSERT(csid != NULL); @@ -494,10 +490,10 @@ _citrus_UTF7_stdenc_wctocs(struct _citru return 0; } -static int +static __inline int /*ARGSUSED*/ -_citrus_UTF7_stdenc_cstowc(struct _citrus_stdenc *ce, - wchar_kuten_t * __restrict wc, +_citrus_UTF7_stdenc_cstowc(_UTF7EncodingInfo * __restrict ei, + wchar_t * __restrict wc, _csid_t csid, _index_t idx) { /* ei seem to be unused */ @@ -505,7 +501,7 @@ _citrus_UTF7_stdenc_cstowc(struct _citru if (csid != 0) return EILSEQ; - *wc = (wchar_kuten_t)idx; + *wc = (wchar_t)idx; return 0; } @@ -548,7 +544,7 @@ _citrus_UTF7_encoding_module_init(_UTF7E do { \ for (s = str; *s != '\0'; s++) \ ei->cell[*s & 0x7f] |= flag; \ -} while (/*CONSTCOND*/0) +} while (0) FILL(base64, (s - base64) + 1); FILL(direct, EI_DIRECT);