1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
1999-03-15  Ulrich Drepper  <drepper@cygnus.com>

	* iconv/gconv.h (gconv_fct): Change parameter from `char' to
	`unsigned char'.
	(gconv_step_data): Likewise.
	* iconv/gconv_int.h (__gconv): Likewise.
	(__BUILINT_TRANS): Likewise.
	* iconv/gconv.c (__gconv): Likewise.
	* iconv/iconv.c (iconv): Add casts for call of __gconv.
	* iconv/skeleton.c: Change local parameters and variable from `char' to
	`unsigned char'.  Remove casts from calls into modules.
	* iconvdata/iso-2022-jp.c (gconv): Change local variable outbuf from
	`char' to `unsigned char'.
	* wcsmbs/btowc.c: Change pointers from `char *' to `unsigned char *'.
	* wcsmbs/mbrtowc.c: Likewise.
	* wcsmbs/mbsnrtowcs.c: Likewise.
	* wcsmbs/mbsrtowcs.c: Likewise.
	* wcsmbs/wcrtomb.c: Likewise.
	* wcsmbs/wcsnrtombs.c: Likewise.
	* wcsmbs/wcsrtombs.c: Likewise.
	* wcsmbs/wctob.c: Likewise.
This commit is contained in:
Ulrich Drepper
1999-03-15 20:41:16 +00:00
parent 1d0b8e4b8f
commit b117f744e1
15 changed files with 99 additions and 67 deletions

View File

@ -39,7 +39,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
int status;
size_t result;
size_t dummy;
const char *inbuf;
const unsigned char *inbuf;
char *outbuf = (char *) (pwc ?: buf);
/* Tell where we want the result. */
@ -63,7 +63,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
update_conversion_ptrs ();
/* Do a normal conversion. */
inbuf = s;
inbuf = (const unsigned char *) s;
status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc,
&data, &inbuf, inbuf + n,
&dummy, 0);
@ -80,14 +80,15 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
if (status == GCONV_OK || status == GCONV_EMPTY_INPUT
|| status == GCONV_FULL_OUTPUT)
{
if (data.outbuf != outbuf && *(wchar_t *)outbuf == L'\0')
if (data.outbuf != (unsigned char *) outbuf
&& *(wchar_t *) outbuf == L'\0')
{
/* The converted character is the NUL character. */
assert (__mbsinit (data.statep));
result = 0;
}
else
result = inbuf - s;
result = inbuf - (const unsigned char *) s;
}
else
{