diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-03-15 20:41:16 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-03-15 20:41:16 +0000 |
commit | b117f744e10e769a5d219cf0b69cc10f81738650 (patch) | |
tree | 35f76b5a32b99735df14db028185e85df3834c33 /iconv | |
parent | 1d0b8e4b8f9c636cfaec78be5ebf819d3d8c2284 (diff) | |
download | glibc-b117f744e10e769a5d219cf0b69cc10f81738650.zip glibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.gz glibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.bz2 |
Update.
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.
Diffstat (limited to 'iconv')
-rw-r--r-- | iconv/gconv.c | 4 | ||||
-rw-r--r-- | iconv/gconv_int.h | 10 | ||||
-rw-r--r-- | iconv/iconv.c | 10 | ||||
-rw-r--r-- | iconv/skeleton.c | 30 |
4 files changed, 27 insertions, 27 deletions
diff --git a/iconv/gconv.c b/iconv/gconv.c index cc61e03..9022fc3 100644 --- a/iconv/gconv.c +++ b/iconv/gconv.c @@ -27,8 +27,8 @@ int internal_function -__gconv (gconv_t cd, const char **inbuf, const char *inbufend, char **outbuf, - char *outbufend, size_t *converted) +__gconv (gconv_t cd, const unsigned char **inbuf, const unsigned char *inbufend, + unsigned char **outbuf, unsigned char *outbufend, size_t *converted) { size_t last_step = cd->nsteps - 1; int result; diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h index c78d0bb..d4ffa55 100644 --- a/iconv/gconv_int.h +++ b/iconv/gconv_int.h @@ -106,8 +106,9 @@ extern int __gconv_close (gconv_t cd) according to rules described by CD and place up to *OUTBYTESLEFT bytes in buffer starting at *OUTBUF. Return number of written characters in *CONVERTED if this pointer is not null. */ -extern int __gconv (gconv_t __cd, const char **__inbuf, const char *inbufend, - char **__outbuf, char *outbufend, size_t *converted) +extern int __gconv (gconv_t __cd, const unsigned char **__inbuf, + const unsigned char *inbufend, unsigned char **__outbuf, + unsigned char *outbufend, size_t *converted) internal_function; /* Return in *HANDLE a pointer to an array with *NSTEPS elements describing @@ -154,8 +155,9 @@ extern void __gconv_get_builtin_trans (const char *__name, #ifdef _LIBC # define __BUILTIN_TRANS(Name) \ extern int Name (struct gconv_step *__step, struct gconv_step_data *__data, \ - const char **__inbuf, const char *__inbufend, \ - size_t *__written, int __do_flush) + const unsigned char **__inbuf, \ + const unsigned char *__inbufend, size_t *__written, \ + int __do_flush) __BUILTIN_TRANS (__gconv_transform_ascii_internal); __BUILTIN_TRANS (__gconv_transform_internal_ascii); diff --git a/iconv/iconv.c b/iconv/iconv.c index 2f57295..26fb417 100644 --- a/iconv/iconv.c +++ b/iconv/iconv.c @@ -38,15 +38,19 @@ iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, if (inbuf == NULL || *inbuf == NULL) { - result = __gconv (gcd, NULL, NULL, outbuf, outstart + *outbytesleft, + result = __gconv (gcd, NULL, NULL, (unsigned char **) outbuf, + (unsigned char *) (outstart + *outbytesleft), &converted); } else { const char *instart = *inbuf; - result = __gconv (gcd, inbuf, *inbuf + *inbytesleft, outbuf, - *outbuf + *outbytesleft, &converted); + result = __gconv (gcd, (unsigned char **) inbuf, + (unsigned char *) (*inbuf + *inbytesleft), + (unsigned char **) outbuf, + (unsigned char *) (*outbuf + *outbytesleft), + &converted); *inbytesleft -= *inbuf - instart; } diff --git a/iconv/skeleton.c b/iconv/skeleton.c index 55d938b..a9fc249 100644 --- a/iconv/skeleton.c +++ b/iconv/skeleton.c @@ -196,8 +196,8 @@ gconv_init (struct gconv_step *step) int FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, - const char **inbuf, const char *inbufend, size_t *written, - int do_flush) + const unsigned char **inbuf, const unsigned char *inbufend, + size_t *written, int do_flush) { struct gconv_step *next_step = step + 1; struct gconv_step_data *next_data = data + 1; @@ -224,10 +224,10 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, else { /* We preserve the initial values of the pointer variables. */ - const char *inptr = *inbuf; - char *outbuf = data->outbuf; - char *outend = data->outbufend; - char *outptr; + const unsigned char *inptr = *inbuf; + unsigned char *outbuf = data->outbuf; + unsigned char *outend = data->outbufend; + unsigned char *outstart; /* This variable is used to count the number of characters we actually converted. */ @@ -242,7 +242,7 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, /* Remember the start value for this round. */ inptr = *inbuf; /* The outbuf buffer is empty. */ - outptr = outbuf; + outstart = outbuf; #ifdef SAVE_RESET_STATE SAVE_RESET_STATE (1); @@ -250,18 +250,12 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, if (FROM_DIRECTION) /* Run the conversion loop. */ - status = FROM_LOOP ((const unsigned char **) inbuf, - (const unsigned char *) inbufend, - (unsigned char **) &outbuf, - (unsigned char *) outend, + status = FROM_LOOP (inbuf, inbufend, &outbuf, outend, data->statep, step->data, &converted EXTRA_LOOP_ARGS); else /* Run the conversion loop. */ - status = TO_LOOP ((const unsigned char **) inbuf, - (const unsigned char *) inbufend, - (unsigned char **) &outbuf, - (unsigned char *) outend, + status = TO_LOOP (inbuf, inbufend, &outbuf, outend, data->statep, step->data, &converted EXTRA_LOOP_ARGS); @@ -279,9 +273,9 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, } /* Write out all output which was produced. */ - if (outbuf > outptr) + if (outbuf > outstart) { - const char *outerr = data->outbuf; + const unsigned char *outerr = data->outbuf; int result; result = DL_CALL_FCT (fct, (next_step, next_data, &outerr, @@ -300,7 +294,7 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, /* Reload the pointers. */ *inbuf = inptr; - outbuf = outptr; + outbuf = outstart; /* Reset the state. */ # ifdef SAVE_RESET_STATE |