This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.h: Remove redundant cast
[perl5.git] / utf8.h
diff --git a/utf8.h b/utf8.h
index e6c7864..5ff24fd 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -77,15 +77,6 @@ the string is invariant.
 
 #define to_uni_fold(c, p, lenp) _to_uni_fold_flags(c, p, lenp, FOLD_FLAGS_FULL)
 
-#define to_utf8_fold(s, r, lenr)                                                \
-    _to_utf8_fold_flags (s, NULL, r, lenr, FOLD_FLAGS_FULL, __FILE__, __LINE__)
-#define to_utf8_lower(s, r, lenr)                                               \
-                  _to_utf8_lower_flags(s, NULL, r ,lenr, 0, __FILE__, __LINE__)
-#define to_utf8_upper(s, r, lenr)                                               \
-                  _to_utf8_upper_flags(s, NULL, r, lenr, 0, __FILE__, __LINE__)
-#define to_utf8_title(s, r, lenr)                                               \
-                  _to_utf8_title_flags(s, NULL, r, lenr ,0, __FILE__, __LINE__)
-
 #define foldEQ_utf8(s1, pe1, l1, u1, s2, pe2, l2, u2) \
                    foldEQ_utf8_flags(s1, pe1, l1, u1, s2, pe2, l2, u2, 0)
 #define FOLDEQ_UTF8_NOMIX_ASCII   (1 << 0)
@@ -204,11 +195,11 @@ adding no time nor space requirements to the implementation.
 */
 
 #ifdef PERL_SMALL_MACRO_BUFFER
-#define NATIVE_TO_LATIN1(ch)     ((U8)(ch))
-#define LATIN1_TO_NATIVE(ch)     ((U8)(ch))
+#  define NATIVE_TO_LATIN1(ch)     ((U8)(ch))
+#  define LATIN1_TO_NATIVE(ch)     ((U8)(ch))
 #else
-#define NATIVE_TO_LATIN1(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
-#define LATIN1_TO_NATIVE(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
+#  define NATIVE_TO_LATIN1(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) | 0)))
+#  define LATIN1_TO_NATIVE(ch)     (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) | 0)))
 #endif
 
 /* I8 is an intermediate version of UTF-8 used only in UTF-EBCDIC.  We thus
@@ -221,12 +212,12 @@ adding no time nor space requirements to the implementation.
 #define NATIVE_UTF8_TO_I8(ch) ((U8) (ch))
 #define I8_TO_NATIVE_UTF8(ch) ((U8) (ch))
 #else
-#define NATIVE_UTF8_TO_I8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
-#define I8_TO_NATIVE_UTF8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) (ch)))
+#define NATIVE_UTF8_TO_I8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) | 0)))
+#define I8_TO_NATIVE_UTF8(ch) (__ASSERT_(FITS_IN_8_BITS(ch)) ((U8) ((ch) | 0)))
 #endif
 
-#define UNI_TO_NATIVE(ch)        ((UV) (ch))
-#define NATIVE_TO_UNI(ch)        ((UV) (ch))
+#define UNI_TO_NATIVE(ch)        ((UV) ((ch) | 0))
+#define NATIVE_TO_UNI(ch)        ((UV) ((ch) | 0))
 
 /*
 
@@ -484,7 +475,7 @@ encoded as UTF-8.  C<cp> is a native (ASCII or EBCDIC) code point if less than
  * code point in process of being generated */
 #define UTF8_ACCUMULATE(old, new) (__ASSERT_(FITS_IN_8_BITS(new))              \
                                    ((old) << UTF_ACCUMULATION_SHIFT)           \
-                                   | ((NATIVE_UTF8_TO_I8((U8)new))             \
+                                   | ((NATIVE_UTF8_TO_I8(new))                 \
                                        & UTF_CONTINUATION_MASK))
 
 /* This works in the face of malformed UTF-8. */