]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 15 Mar 1999 20:41:16 +0000 (20:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 15 Mar 1999 20:41:16 +0000 (20:41 +0000)
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.

15 files changed:
ChangeLog
INSTALL
iconv/gconv.c
iconv/gconv_int.h
iconv/iconv.c
iconv/skeleton.c
iconvdata/iso-2022-jp.c
wcsmbs/btowc.c
wcsmbs/mbrtowc.c
wcsmbs/mbsnrtowcs.c
wcsmbs/mbsrtowcs.c
wcsmbs/wcrtomb.c
wcsmbs/wcsnrtombs.c
wcsmbs/wcsrtombs.c
wcsmbs/wctob.c

index 748f721639e4e7456ee72fe817ac905824cbdf85..5891c940ce858ca6abca4975504add50ea7f3813 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+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.
+
 1999-03-15  Mark Kettenis  <kettenis@gnu.org>
 
        * sysdeps/mach/hurd/Versions (ld.so) [GLIBC_2.0]: Add
diff --git a/INSTALL b/INSTALL
index 255ba289dc3c81f5b3e290284ce9ee2471aa9f3d..a8dbd6aa43d5998725fc144096ac1331a56d8e70 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -82,7 +82,7 @@ will be used, and CFLAGS sets optimization options for the compiler.
      given with no list, it enables all the add-on packages it finds.
      If you do not wish to use some add-on package that you have
      present in your source tree, give this option a list of the
-     add-ons that you *do* want used, like this:
+     add-ons that you _do_ want used, like this:
      `--enable-add-ons=crypt,linuxthreads'
 
 `--with-binutils=DIRECTORY'
@@ -299,6 +299,7 @@ build the GNU C library:
      Perl is not required, but it is used if present to test the
      installation.  We may decide to use it elsewhere in the future.
 
+
 If you change any of the `configure.in' files you will also need
 
    * GNU `autoconf' 2.12 or higher
@@ -401,7 +402,7 @@ installed there.
 library on your system against the new library for the sake of new code,
 but keep the old libraries around for old binaries to use.  This is
 complicated and difficult.  Consult the Glibc2 HOWTO at
-`http://www.imaxx.net/~thrytis/glibc' for details.
+<http://www.imaxx.net/~thrytis/glibc> for details.
 
    You cannot use `nscd' with 2.0 kernels, due to bugs in the
 kernel-side thread support.  `nscd' happens to hit these bugs
index cc61e03954c917fdf1550351f7ecd552155fcd0b..9022fc3cb36ade94f2ff5b8fe3d9c7ef9779c402 100644 (file)
@@ -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;
index c78d0bb98bb7d944d0b7bd8cdf9685ad626832da..d4ffa551d616244f86e01ff7207030fb8e8dba53 100644 (file)
@@ -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);
index 2f57295097c1c2c80d9ff51b52effc541fee69ca..26fb4177f8970d4905638bf1d23e121a33aed823 100644 (file)
@@ -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;
     }
index 55d938bd7ec0e465f20303f2e4b8ec5372796106..a9fc2495f129d7f61e3d78a2a53236458352314c 100644 (file)
@@ -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
index 10515d2deea0c6ec242e6b707d7741a1a89d4ce9..bb158491f24965177e78b0918f6b3edf255051bd 100644 (file)
@@ -199,7 +199,7 @@ gconv_end (struct gconv_step *data)
        data->statep->count = ASCII_set;                                      \
       else                                                                   \
        {                                                                     \
-         char *outbuf = data->outbuf;                                        \
+         unsigned char *outbuf = data->outbuf;                               \
                                                                              \
          /* We are not in the initial state.  To switch back we have         \
             to emit the sequence `Esc ( B'.  */                              \
index bac99e854761012ab63dda8346404fe2ce9e5c7d..1c6332ee8caacd8d901e5a189b4321b2bb400751 100644 (file)
@@ -31,8 +31,8 @@ __btowc (c)
 {
   wchar_t result;
   struct gconv_step_data data;
-  char inbuf[1];
-  const char *inptr = inbuf;
+  unsigned char inbuf[1];
+  const unsigned char *inptr = inbuf;
   size_t dummy;
   int status;
 
@@ -42,7 +42,7 @@ __btowc (c)
     return WEOF;
 
   /* Tell where we want the result.  */
-  data.outbuf = (char *) &result;
+  data.outbuf = (unsigned char *) &result;
   data.outbufend = data.outbuf + sizeof (wchar_t);
   data.invocation_counter = 0;
   data.internal_use = 1;
index bf995ec713216c42c6ba7083e1b0eace0c3e0739..78ff2a22dd3869bf996cbd1c9fe413fc14e873f5 100644 (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
     {
index fbebc8de4c735778200a819d6499c00f677a2b9d..78e327eeea9d50c3444413aca56a9765a50ab72c 100644 (file)
@@ -44,7 +44,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
      size_t len;
      mbstate_t *ps;
 {
-  const char *srcend;
+  const unsigned char *srcend;
   struct gconv_step_data data;
   size_t result = 0;
   int status;
@@ -66,7 +66,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
   if (dst == NULL)
     {
       wchar_t buf[64];         /* Just an arbitrary size.  */
-      const char *inbuf = *src;
+      const unsigned char *inbuf = *src;
 
       data.outbufend = data.outbuf + sizeof (buf);
       do
@@ -89,12 +89,13 @@ __mbsnrtowcs (dst, src, nmc, len, ps)
       /* This code is based on the safe assumption that all internal
         multi-byte encodings use the NUL byte only to mark the end
         of the string.  */
-      data.outbuf = (char *) dst;
+      data.outbuf = (unsigned char *) dst;
       data.outbufend = data.outbuf + len * sizeof (wchar_t);
 
       status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc,
-                                                &data, src, srcend,
-                                                &result, 0);
+                                                &data,
+                                                (const unsigned char **) src,
+                                                srcend, &result, 0);
 
       /* We have to determine whether the last character converted
         is the NUL character.  */
index 1993e2e7022a2881c5577a2b18031f3de99cdb8c..a10eb85f1a74288a3cbcca1598f1a90a632642e4 100644 (file)
@@ -58,8 +58,8 @@ __mbsrtowcs (dst, src, len, ps)
   if (dst == NULL)
     {
       wchar_t buf[64];         /* Just an arbitrary size.  */
-      const char *srcend = *src + strlen (*src) + 1;
-      const char *inbuf = *src;
+      const unsigned char *inbuf = (const unsigned char *) *src;
+      const unsigned char *srcend = inbuf + strlen (inbuf) + 1;
 
       data.outbufend = data.outbuf + sizeof (buf);
       do
@@ -85,14 +85,19 @@ __mbsrtowcs (dst, src, len, ps)
       /* This code is based on the safe assumption that all internal
         multi-byte encodings use the NUL byte only to mark the end
         of the string.  */
-      const char *srcend = *src + __strnlen (*src, len * MB_CUR_MAX) + 1;
+      const unsigned char *srcend;
 
-      data.outbuf = (char *) dst;
+      srcend = (const unsigned char *) (*src
+                                       + __strnlen (*src, len * MB_CUR_MAX)
+                                       + 1);
+
+      data.outbuf = (unsigned char *) dst;
       data.outbufend = data.outbuf + len * sizeof (wchar_t);
 
       status = (*__wcsmbs_gconv_fcts.towc->fct) (__wcsmbs_gconv_fcts.towc,
-                                                &data, src, srcend,
-                                                &result, 0);
+                                                &data,
+                                                (const unsigned char **) src,
+                                                srcend, &result, 0);
 
       /* We have to determine whether the last character converted
         is the NUL character.  */
index 9f3c303e2a963276765db9b09ebd887d5a903251..b546c7a9d39bfaa46ef95b356eab28a14e9dee0e 100644 (file)
@@ -75,7 +75,7 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
   else
     {
       /* Do a normal conversion.  */
-      const char *inbuf = (const char *) &wc;
+      const unsigned char *inbuf = (const unsigned char *) &wc;
 
       status = (*__wcsmbs_gconv_fcts.tomb->fct) (__wcsmbs_gconv_fcts.tomb,
                                                 &data, &inbuf,
@@ -94,7 +94,7 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
 
   if (status == GCONV_OK || status == GCONV_EMPTY_INPUT
       || status == GCONV_FULL_OUTPUT)
-    result = data.outbuf - s;
+    result = data.outbuf - (unsigned char *) s;
   else
     {
       result = (size_t) -1;
index 18537c2a2413b60f636cdbd9a8c2fb90f91c75f2..f93d404eb12c815fe99fb0b23a48bb5abffe759b 100644 (file)
@@ -64,7 +64,7 @@ __wcsnrtombs (dst, src, nwc, len, ps)
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
     {
-      char buf[256];           /* Just an arbitrary value.  */
+      unsigned char buf[256];          /* Just an arbitrary value.  */
       const wchar_t *inbuf = *src;
       size_t dummy;
 
@@ -77,8 +77,8 @@ __wcsnrtombs (dst, src, nwc, len, ps)
 
          status = (*__wcsmbs_gconv_fcts.tomb->fct) (__wcsmbs_gconv_fcts.tomb,
                                                     &data,
-                                                    (const char **) &inbuf,
-                                                    (const char *) srcend,
+                                                    (const unsigned char **) &inbuf,
+                                                    (const unsigned char *) srcend,
                                                     &dummy, 0);
 
          /* Count the number of bytes.  */
@@ -102,19 +102,20 @@ __wcsnrtombs (dst, src, nwc, len, ps)
       data.outbufend = dst + len;
 
       status = (*__wcsmbs_gconv_fcts.tomb->fct) (__wcsmbs_gconv_fcts.tomb,
-                                                &data, (const char **) src,
-                                                (const char *) srcend,
+                                                &data,
+                                                (const unsigned char **) src,
+                                                (const unsigned char *) srcend,
                                                 &dummy, 0);
 
       /* Count the number of bytes.  */
-      result = data.outbuf - dst;
+      result = data.outbuf - (unsigned char *) dst;
 
       /* We have to determine whether the last character converted
         is the NUL character.  */
       if ((status == GCONV_OK || status == GCONV_EMPTY_INPUT)
          && data.outbuf[-1] == '\0')
        {
-         assert (data.outbuf != dst);
+         assert (data.outbuf != (unsigned char *) dst);
          assert (__mbsinit (data.statep));
          *src = NULL;
          --result;
index fbcf0c7c5c6cc9fefeb31fbfdec6a9dc286acad0..02575992d638d7efd981af4be7d3c2ac56a846ea 100644 (file)
@@ -56,7 +56,7 @@ __wcsrtombs (dst, src, len, ps)
   /* We have to handle DST == NULL special.  */
   if (dst == NULL)
     {
-      char buf[256];           /* Just an arbitrary value.  */
+      unsigned char buf[256];          /* Just an arbitrary value.  */
       const wchar_t *srcend = *src + __wcslen (*src) + 1;
       const wchar_t *inbuf = *src;
       size_t dummy;
@@ -70,8 +70,8 @@ __wcsrtombs (dst, src, len, ps)
 
          status = (*__wcsmbs_gconv_fcts.tomb->fct) (__wcsmbs_gconv_fcts.tomb,
                                                     &data,
-                                                    (const char **) &inbuf,
-                                                    (const char *) srcend,
+                                                    (const unsigned char **) &inbuf,
+                                                    (const unsigned char *) srcend,
                                                     &dummy, 0);
 
          /* Count the number of bytes.  */
@@ -99,12 +99,13 @@ __wcsrtombs (dst, src, len, ps)
       data.outbufend = dst + len;
 
       status = (*__wcsmbs_gconv_fcts.tomb->fct) (__wcsmbs_gconv_fcts.tomb,
-                                                &data, (const char **) src,
-                                                (const char *) srcend,
+                                                &data,
+                                                (const unsigned char **) src,
+                                                (const unsigned char *) srcend,
                                                 &dummy, 0);
 
       /* Count the number of bytes.  */
-      result = data.outbuf - dst;
+      result = data.outbuf - (unsigned char *) dst;
 
       /* We have to determine whether the last character converted
         is the NUL character.  */
@@ -112,7 +113,7 @@ __wcsrtombs (dst, src, len, ps)
           || status == GCONV_FULL_OUTPUT)
          && data.outbuf[-1] == '\0')
        {
-         assert (data.outbuf != dst);
+         assert (data.outbuf != (unsigned char *) dst);
          assert (__mbsinit (data.statep));
          *src = NULL;
          --result;
index 8cbcbe41c3e12aae5037cfa05c255602b7b7e4d5..0fba46ad725464cc33e9b4b9954189ebbd5480f0 100644 (file)
@@ -53,13 +53,13 @@ wctob (c)
   inbuf[0] = c;
 
   status = (*__wcsmbs_gconv_fcts.tomb->fct) (__wcsmbs_gconv_fcts.tomb, &data,
-                                            (const char **) &inptr,
-                                            (const char *) &inbuf[1],
+                                            (const unsigned char **) &inptr,
+                                            (const unsigned char *) &inbuf[1],
                                             &dummy, 0);
   /* The conversion failed or the output is too long.  */
   if ((status != GCONV_OK && status != GCONV_FULL_OUTPUT
        && status != GCONV_EMPTY_INPUT)
-      || data.outbuf != buf + 1)
+      || data.outbuf != (unsigned char *) (buf + 1))
     return EOF;
 
   return buf[0];