This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Change no longer used params to dummys
authorKarl Williamson <khw@cpan.org>
Tue, 27 Mar 2018 18:44:54 +0000 (12:44 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 31 Mar 2018 21:36:45 +0000 (15:36 -0600)
The previous commits have caused certain parameters to be ignored in
some calls to these functions.  Change them to dummys, so if a mistake
is made, it can be caught, and not promulgated

embed.fnc
proto.h
utf8.c

index cb26098..095fe3e 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2874,12 +2874,12 @@ sRM     |UV     |check_locale_boundary_crossing                             \
                |NN U8* const ustrp                                         \
                |NN STRLEN *lenp
 iR     |bool   |is_utf8_common |NN const U8 *const p                       \
-                               |NN SV **swash                              \
+                               |NULLOK SV **swash                          \
                                |NN const char * const swashname            \
                                |NULLOK SV* const invlist
 iR     |bool   |is_utf8_common_with_len|NN const U8 *const p               \
                                           |NN const U8 *const e            \
-                                   |NN SV **swash                          \
+                                   |NULLOK SV **swash                      \
                                    |NN const char * const swashname        \
                                    |NULLOK SV* const invlist
 sR     |SV*    |swatch_get     |NN SV* swash|UV start|UV span
diff --git a/proto.h b/proto.h
index 6131abc..6e2f646 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -5996,14 +5996,14 @@ PERL_STATIC_INLINE int  S_isFF_OVERLONG(const U8 * const s, const STRLEN len)
 PERL_STATIC_INLINE bool        S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * const swashname, SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_COMMON        \
-       assert(p); assert(swash); assert(swashname)
+       assert(p); assert(swashname)
 #endif
 
 #ifndef PERL_NO_INLINE_FUNCTIONS
 PERL_STATIC_INLINE bool        S_is_utf8_common_with_len(pTHX_ const U8 *const p, const U8 *const e, SV **swash, const char * const swashname, SV* const invlist)
                        __attribute__warn_unused_result__;
 #define PERL_ARGS_ASSERT_IS_UTF8_COMMON_WITH_LEN       \
-       assert(p); assert(e); assert(swash); assert(swashname)
+       assert(p); assert(e); assert(swashname)
 #endif
 
 #ifndef PERL_NO_INLINE_FUNCTIONS
diff --git a/utf8.c b/utf8.c
index c50fcd6..f83280f 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -2858,7 +2858,9 @@ Perl__is_utf8_idstart(pTHX_ const U8 *p)
 
     if (*p == '_')
        return TRUE;
-    return is_utf8_common(p, &PL_utf8_idstart, "IdStart", PL_utf8_idstart);
+    return is_utf8_common(p, NULL,
+                          "This is buggy if this gets used",
+                          PL_utf8_idstart);
 }
 
 bool
@@ -3216,6 +3218,8 @@ S_is_utf8_common(pTHX_ const U8 *const p, SV **swash,
         return _invlist_contains_cp(invlist, valid_utf8_to_uvchr(p, NULL));
     }
 
+    assert(swash);
+
     if (!*swash) {
         U8 flags = _CORE_SWASH_INIT_ACCEPT_INVLIST;
         *swash = _core_swash_init("utf8",
@@ -3255,6 +3259,8 @@ S_is_utf8_common_with_len(pTHX_ const U8 *const p, const U8 * const e,
         return _invlist_contains_cp(invlist, valid_utf8_to_uvchr(p, NULL));
     }
 
+    assert(swash);
+
     if (!*swash) {
         U8 flags = _CORE_SWASH_INIT_ACCEPT_INVLIST;
         *swash = _core_swash_init("utf8",
@@ -3340,8 +3346,8 @@ Perl__is_utf8_FOO(pTHX_       U8   classnum,
             case _CC_CASED:
 
                 return is_utf8_common(p,
-                                      &PL_utf8_swash_ptrs[classnum],
-                                      swash_property_names[classnum],
+                                      NULL,
+                                      "This is buggy if this gets used",
                                       PL_XPosix_ptrs[classnum]);
 
             case _CC_SPACE:
@@ -3357,11 +3363,13 @@ Perl__is_utf8_FOO(pTHX_       U8   classnum,
             case _CC_VERTSPACE:
                 return is_VERTWS_high(p);
             case _CC_IDFIRST:
-                return is_utf8_common(p, &PL_utf8_perl_idstart,
-                                      "_Perl_IDStart", PL_utf8_perl_idstart);
+                return is_utf8_common(p, NULL,
+                                      "This is buggy if this gets used",
+                                      PL_utf8_perl_idstart);
             case _CC_IDCONT:
-                return is_utf8_common(p, &PL_utf8_perl_idcont,
-                                      "_Perl_IDCont", PL_utf8_perl_idcont);
+                return is_utf8_common(p, NULL,
+                                      "This is buggy if this gets used",
+                                      PL_utf8_perl_idcont);
         }
     }
 
@@ -3402,10 +3410,8 @@ Perl__is_utf8_FOO_with_len(pTHX_ const U8 classnum, const U8 *p,
 
     assert(classnum < _FIRST_NON_SWASH_CC);
 
-    return is_utf8_common_with_len(p,
-                                   e,
-                                   &PL_utf8_swash_ptrs[classnum],
-                                   swash_property_names[classnum],
+    return is_utf8_common_with_len(p, e, NULL,
+                                   "This is buggy if this gets used",
                                    PL_XPosix_ptrs[classnum]);
 }
 
@@ -3414,8 +3420,9 @@ Perl__is_utf8_perl_idstart_with_len(pTHX_ const U8 *p, const U8 * const e)
 {
     PERL_ARGS_ASSERT__IS_UTF8_PERL_IDSTART_WITH_LEN;
 
-    return is_utf8_common_with_len(p, e, &PL_utf8_perl_idstart,
-                                      "_Perl_IDStart", PL_utf8_perl_idstart);
+    return is_utf8_common_with_len(p, e, NULL,
+                                   "This is buggy if this gets used",
+                                   PL_utf8_perl_idstart);
 }
 
 bool
@@ -3433,8 +3440,9 @@ Perl__is_utf8_perl_idcont_with_len(pTHX_ const U8 *p, const U8 * const e)
 {
     PERL_ARGS_ASSERT__IS_UTF8_PERL_IDCONT_WITH_LEN;
 
-    return is_utf8_common_with_len(p, e, &PL_utf8_perl_idcont,
-                                   "_Perl_IDCont", PL_utf8_perl_idcont);
+    return is_utf8_common_with_len(p, e, NULL,
+                                   "This is buggy if this gets used",
+                                   PL_utf8_perl_idcont);
 }
 
 bool