Deprecate valid_utf8_to_uvuni()
authorKarl Williamson <public@khwilliamson.com>
Tue, 26 Feb 2013 03:26:44 +0000 (20:26 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 29 Aug 2013 15:55:57 +0000 (09:55 -0600)
Now that all the tables are stored in native format, there is very
little reason to use this function; and those who do need this kind of
functionality should be using the bottom level routine, so as to make it
clear they are doing nonstandard stuff.

According to grep.cpan.me, there are no uses of this function in CPAN.

embed.fnc
proto.h
utf8.c

index 6960b13..a0bf3bf 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1542,7 +1542,7 @@ ApMd      |U8*    |bytes_from_utf8|NN const U8 *s|NN STRLEN *len|NULLOK bool *is_utf8
 ApMd   |U8*    |bytes_to_utf8  |NN const U8 *s|NN STRLEN *len
 ApdD   |UV     |utf8_to_uvchr  |NN const U8 *s|NULLOK STRLEN *retlen
 ApdD   |UV     |utf8_to_uvuni  |NN const U8 *s|NULLOK STRLEN *retlen
-ApM    |UV     |valid_utf8_to_uvuni    |NN const U8 *s|NULLOK STRLEN *retlen
+ApMD   |UV     |valid_utf8_to_uvuni    |NN const U8 *s|NULLOK STRLEN *retlen
 Apd    |UV     |utf8_to_uvchr_buf      |NN const U8 *s|NN const U8 *send|NULLOK STRLEN *retlen
 Apd    |UV     |utf8_to_uvuni_buf      |NN const U8 *s|NN const U8 *send|NULLOK STRLEN *retlen
 pM     |bool   |check_utf8_print       |NN const U8 *s|const STRLEN len
diff --git a/proto.h b/proto.h
index 458b073..9a170b8 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -4792,6 +4792,7 @@ PERL_CALLCONV UV  Perl_valid_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN *retlen)
        assert(s)
 
 PERL_CALLCONV UV       Perl_valid_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN *retlen)
+                       __attribute__deprecated__
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_VALID_UTF8_TO_UVUNI   \
        assert(s)
diff --git a/utf8.c b/utf8.c
index 4ab8c7c..4cc12d6 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1026,7 +1026,8 @@ Perl_utf8_to_uvuni_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen)
                               ckWARN_d(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY);
 }
 
-/* Like L</utf8_to_uvuni_buf>(), but should only be called when it is known that
+/* DEPRECATED!
+ * Like L</utf8_to_uvuni_buf>(), but should only be called when it is known that
  * there are no malformations in the input UTF-8 string C<s>.  Surrogates,
  * non-character code points, and non-Unicode code points are allowed */
 
@@ -1068,7 +1069,7 @@ Perl_utf8_to_uvuni(pTHX_ const U8 *s, STRLEN *retlen)
 {
     PERL_ARGS_ASSERT_UTF8_TO_UVUNI;
 
-    return valid_utf8_to_uvuni(s, retlen);
+    return NATIVE_TO_UNI(valid_utf8_to_uvchr(s, retlen));
 }
 
 /*