mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 10:50:07 +00:00
Update.
2000-01-18 Ulrich Drepper <drepper@cygnus.com> * iconv/loop.c (COUNT_CONVERTED): Remove macro, comment, and all uses. Remove done variable and all uses. * iconv/skeleton.c: Update comment for *written modification. * iconv/gconv_int.h (__gconv): Update comment.
This commit is contained in:
parent
ea6eb38329
commit
63e04088bf
@ -1,3 +1,10 @@
|
||||
2000-01-18 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* iconv/loop.c (COUNT_CONVERTED): Remove macro, comment, and all uses.
|
||||
Remove done variable and all uses.
|
||||
* iconv/skeleton.c: Update comment for *written modification.
|
||||
* iconv/gconv_int.h (__gconv): Update comment.
|
||||
|
||||
2000-01-18 Bruno Haible <haible@ilog.fr>
|
||||
|
||||
* posix/fnmatch.c (ISWCTYPE): New macro.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
@ -111,8 +111,8 @@ extern int __gconv_close (__gconv_t cd)
|
||||
|
||||
/* Transform at most *INBYTESLEFT bytes from buffer starting at *INBUF
|
||||
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. */
|
||||
bytes in buffer starting at *OUTBUF. Return number of non-identical
|
||||
conversions in *CONVERTED if this pointer is not null. */
|
||||
extern int __gconv (__gconv_t __cd, const unsigned char **__inbuf,
|
||||
const unsigned char *inbufend, unsigned char **__outbuf,
|
||||
unsigned char *outbufend, size_t *converted)
|
||||
|
52
iconv/loop.c
52
iconv/loop.c
@ -1,5 +1,5 @@
|
||||
/* Conversion loop frame work.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -36,11 +36,6 @@
|
||||
the name is `loop' but this prevents the use
|
||||
of multiple functions in the same file.
|
||||
|
||||
COUNT_CONVERTED optional macro which is used to count the actual
|
||||
number of characters converted. For some conversion
|
||||
it is easy to compute the value afterwards, but for
|
||||
others explicit counting is cheaper.
|
||||
|
||||
BODY this is supposed to expand to the body of the loop.
|
||||
The user must provide this.
|
||||
|
||||
@ -87,30 +82,6 @@
|
||||
# error "Definition of BODY missing for function" LOOPFCT
|
||||
#endif
|
||||
|
||||
/* We can calculate the number of converted characters easily if one
|
||||
of the character sets has a fixed width. */
|
||||
#ifndef COUNT_CONVERTED
|
||||
# if MIN_NEEDED_INPUT == MAX_NEEDED_INPUT
|
||||
# if MIN_NEEDED_OUTPUT == MAX_NEEDED_OUTPUT
|
||||
/* Decide whether one of the charsets has size 1. */
|
||||
# if MIN_NEEDED_INPUT == 1
|
||||
# define COUNT_CONVERTED (inptr - *inptrp)
|
||||
# elif MIN_NEEDED_OUTPUT == 1
|
||||
# define COUNT_CONVERTED (outptr - *outptrp)
|
||||
# else
|
||||
/* Else we should see whether one of the two numbers is a power of 2. */
|
||||
# define COUNT_CONVERTED \
|
||||
((MIN_NEEDED_INPUT & (-MIN_NEEDED_INPUT)) == MIN_NEEDED_INPUT \
|
||||
? (inptr - *inptrp) : (outptr - *outptrp))
|
||||
# endif
|
||||
# else
|
||||
# define COUNT_CONVERTED ((inptr - *inptrp) / MIN_NEEDED_INPUT)
|
||||
# endif
|
||||
# elif MIN_NEEDED_OUTPUT == MAX_NEEDED_OUTPUT
|
||||
# define COUNT_CONVERTED ((outptr - *outptrp) / MIN_NEEDED_OUTPUT)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* If no arguments have to passed to the loop function define the macro
|
||||
as empty. */
|
||||
@ -128,9 +99,6 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend,
|
||||
int result = __GCONV_OK;
|
||||
const unsigned char *inptr = *inptrp;
|
||||
unsigned char *outptr = *outptrp;
|
||||
#ifndef COUNT_CONVERTED
|
||||
size_t done = 0;
|
||||
#endif
|
||||
|
||||
/* We run one loop where we avoid checks for underflow/overflow of the
|
||||
buffers to speed up the conversion a bit. */
|
||||
@ -151,11 +119,6 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend,
|
||||
vary in size), GCONV_ILLEGAL_INPUT, or GCONV_FULL_OUTPUT (if the
|
||||
output characters vary in size. */
|
||||
BODY
|
||||
|
||||
/* If necessary count the successful conversion. */
|
||||
#ifndef COUNT_CONVERTED
|
||||
++done;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (result == __GCONV_OK)
|
||||
@ -205,22 +168,10 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend,
|
||||
input characters vary in size), GCONV_ILLEGAL_INPUT, or
|
||||
GCONV_FULL_OUTPUT (if the output characters vary in size). */
|
||||
BODY
|
||||
|
||||
/* If necessary count the successful conversion. */
|
||||
# ifndef COUNT_CONVERTED
|
||||
++done;
|
||||
# endif
|
||||
}
|
||||
#endif /* Input and output charset are not both fixed width. */
|
||||
}
|
||||
|
||||
/* Add the number of characters we actually converted. */
|
||||
#ifdef COUNT_CONVERTED
|
||||
*converted += COUNT_CONVERTED;
|
||||
#else
|
||||
*converted += done;
|
||||
#endif
|
||||
|
||||
/* Update the pointers pointed to by the parameters. */
|
||||
*inptrp = inptr;
|
||||
*outptrp = outptr;
|
||||
@ -239,7 +190,6 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend,
|
||||
#undef MIN_NEEDED_OUTPUT
|
||||
#undef MAX_NEEDED_OUTPUT
|
||||
#undef LOOPFCT
|
||||
#undef COUNT_CONVERTED
|
||||
#undef BODY
|
||||
#undef LOOPFCT
|
||||
#undef EXTRA_LOOP_DECLS
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Skeleton for a conversion module.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
|
||||
@ -264,7 +264,7 @@ FUNCTION_NAME (struct __gconv_step *step, struct __gconv_step_data *data,
|
||||
/* Store information about how many bytes are available. */
|
||||
data->__outbuf = outbuf;
|
||||
|
||||
/* Remember how many characters we converted. */
|
||||
/* Remember how many non-identical characters we converted. */
|
||||
*written += converted;
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user