From 6cdaa304a84d70193dba4620caa2db3e97e6e266 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 19 Jan 2000 03:21:12 +0000 Subject: [PATCH] (COUNT_CONVERTED): Remove macro, comment, and all uses. Remove done variable and all uses. --- iconv/loop.c | 52 +--------------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/iconv/loop.c b/iconv/loop.c index eac4c758e0a..baf57531d15 100644 --- a/iconv/loop.c +++ b/iconv/loop.c @@ -1,5 +1,5 @@ /* Conversion loop frame work. - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 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. @@ -86,30 +81,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. */ @@ -127,9 +98,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. */ @@ -150,11 +118,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) @@ -204,22 +167,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; @@ -238,7 +189,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 -- 2.47.2