summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-03-18 07:04:01 -0600
committerKarl Williamson <khw@cpan.org>2022-06-12 09:50:10 -0600
commitcfe7bb26390e8266d86ba803a4e68aaaf06b32f6 (patch)
tree8d72e652871e3b9a7ec0e1cea0fb18cf9463d789 /handy.h
parent53049083d3aadeb9e4c06d2185b2008b97f311ed (diff)
downloadperl-cfe7bb26390e8266d86ba803a4e68aaaf06b32f6.tar.gz
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.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/handy.h b/handy.h
index 732cf7ff8d..d516a163c5 100644
--- a/handy.h
+++ b/handy.h
@@ -1896,12 +1896,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
@@ -1909,11 +1909,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) \
@@ -1928,12 +1928,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)
@@ -1958,9 +1958,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