aboutsummaryrefslogtreecommitdiff
path: root/iconv
diff options
context:
space:
mode:
Diffstat (limited to 'iconv')
-rw-r--r--iconv/gconv.c4
-rw-r--r--iconv/gconv_int.h10
-rw-r--r--iconv/iconv.c10
-rw-r--r--iconv/skeleton.c30
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