about summary refs log tree commit diff
path: root/iconv/skeleton.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-03-15 20:41:16 +0000
committerUlrich Drepper <drepper@redhat.com>1999-03-15 20:41:16 +0000
commitb117f744e10e769a5d219cf0b69cc10f81738650 (patch)
tree35f76b5a32b99735df14db028185e85df3834c33 /iconv/skeleton.c
parent1d0b8e4b8f9c636cfaec78be5ebf819d3d8c2284 (diff)
downloadglibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.gz
glibc-b117f744e10e769a5d219cf0b69cc10f81738650.tar.xz
glibc-b117f744e10e769a5d219cf0b69cc10f81738650.zip
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/skeleton.c')
-rw-r--r--iconv/skeleton.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/iconv/skeleton.c b/iconv/skeleton.c
index 55d938bd7e..a9fc2495f1 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