From 1646e5cdc4169d75ec866fed7cc305c283f7132e Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 18 Mar 2021 07:04:01 -0600 Subject: [PATCH] handy.h: Rmv unnecessary parameter to internal macros The cast is required to be U8 by the POSIX standard. There is no need to have this added generality. --- handy.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/handy.h b/handy.h index cc3bcd195fb3..3dbd1388d25c 100644 --- a/handy.h +++ b/handy.h @@ -1886,12 +1886,12 @@ END_EXTERN_C * system function is defective; it ensures uniform results that conform to the * Unicode standard. It does not handle the anomalies in UTF-8 Turkic * locales. */ -#define generic_toLOWER_LC_(c, function, cast) \ +#define generic_toLOWER_LC_(c, function) \ (! FITS_IN_8_BITS(c) \ ? (c) \ : (IN_UTF8_CTYPE_LOCALE) \ ? PL_latin1_lc[ (U8) (c) ] \ - : (cast)function((cast)(c))) + : (U8) function((U8) (c))) /* Note that the result can be larger than a byte in a UTF-8 locale. It * returns a single value, so can't adequately return the upper case of LATIN @@ -1899,11 +1899,11 @@ END_EXTERN_C * values "SS"); instead it asserts against that under DEBUGGING, and * otherwise returns its input. It does not handle the anomalies in UTF-8 * Turkic locales. */ -#define generic_toUPPER_LC_(c, function, cast) \ +#define generic_toUPPER_LC_(c, function) \ (! FITS_IN_8_BITS(c) \ ? (c) \ : ((! IN_UTF8_CTYPE_LOCALE) \ - ? (cast)function((cast)(c)) \ + ? (U8) function((U8) (c)) \ : (UNLIKELY(((U8)(c)) == MICRO_SIGN) \ ? GREEK_CAPITAL_LETTER_MU \ : (UNLIKELY(((U8)(c)) == LATIN_SMALL_LETTER_Y_WITH_DIAERESIS) \ @@ -1918,12 +1918,12 @@ END_EXTERN_C * values "ss"); instead it asserts against that under DEBUGGING, and * otherwise returns its input. It does not handle the anomalies in UTF-8 * Turkic locales */ -#define generic_toFOLD_LC_(c, function, cast) \ +#define generic_toFOLD_LC_(c, function) \ ((UNLIKELY((c) == MICRO_SIGN) && IN_UTF8_CTYPE_LOCALE) \ ? GREEK_SMALL_LETTER_MU \ : (__ASSERT_( ! IN_UTF8_CTYPE_LOCALE \ || LIKELY((c) != LATIN_SMALL_LETTER_SHARP_S)) \ - generic_toLOWER_LC_(c, function, cast))) + generic_toLOWER_LC_(c, function))) /* Use the libc versions for these if available. */ #if defined(HAS_ISASCII) @@ -1948,9 +1948,9 @@ END_EXTERN_C # define isIDFIRST_LC(c) (UNLIKELY((c) == '_') || isALPHA_LC(c)) # define isWORDCHAR_LC(c) (UNLIKELY((c) == '_') || isALPHANUMERIC_LC(c)) -# define toLOWER_LC(c) generic_toLOWER_LC_((c), tolower, U8) -# define toUPPER_LC(c) generic_toUPPER_LC_((c), toupper, U8) -# define toFOLD_LC(c) generic_toFOLD_LC_((c), tolower, U8) +# define toLOWER_LC(c) generic_toLOWER_LC_((c), tolower) +# define toUPPER_LC(c) generic_toUPPER_LC_((c), toupper) +# define toFOLD_LC(c) generic_toFOLD_LC_((c), tolower) # ifdef WIN32