This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add flags param to hv_ename_*
authorFather Chrysostomos <sprout@cpan.org>
Sun, 21 Nov 2010 02:27:55 +0000 (18:27 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 21 Nov 2010 05:04:19 +0000 (21:04 -0800)
We will need this for making the API UTF8-aware in 5.16
or whenever.

embed.fnc
embed.h
hv.c
mro.c
proto.h

index 6245965..c91adb1 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2118,8 +2118,10 @@ ApoR     |HE**   |hv_eiter_p     |NN HV *hv
 Apo    |void   |hv_riter_set   |NN HV *hv|I32 riter
 Apo    |void   |hv_eiter_set   |NN HV *hv|NULLOK HE *eiter
 Ap     |void   |hv_name_set    |NN HV *hv|NULLOK const char *name|U32 len|U32 flags
-p      |void   |hv_ename_add   |NN HV *hv|NN const char *name|U32 len
-p      |void   |hv_ename_delete|NN HV *hv|NN const char *name|U32 len
+p      |void   |hv_ename_add   |NN HV *hv|NN const char *name|U32 len \
+                               |U32 flags
+p      |void   |hv_ename_delete|NN HV *hv|NN const char *name|U32 len \
+                               |U32 flags
 : Used in dump.c and hv.c
 poM    |AV**   |hv_backreferences_p    |NN HV *hv
 #if defined(PERL_IN_DUMP_C) || defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C)
diff --git a/embed.h b/embed.h
index 51ab229..ca582b7 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define get_no_modify()                Perl_get_no_modify(aTHX)
 #define get_opargs()           Perl_get_opargs(aTHX)
 #define gv_try_downgrade(a)    Perl_gv_try_downgrade(aTHX_ a)
-#define hv_ename_add(a,b,c)    Perl_hv_ename_add(aTHX_ a,b,c)
-#define hv_ename_delete(a,b,c) Perl_hv_ename_delete(aTHX_ a,b,c)
+#define hv_ename_add(a,b,c,d)  Perl_hv_ename_add(aTHX_ a,b,c,d)
+#define hv_ename_delete(a,b,c,d)       Perl_hv_ename_delete(aTHX_ a,b,c,d)
 #define init_argv_symbols(a,b) Perl_init_argv_symbols(aTHX_ a,b)
 #define init_debugger()                Perl_init_debugger(aTHX)
 #define intro_my()             Perl_intro_my(aTHX)
diff --git a/hv.c b/hv.c
index fb9dfec..ee95b25 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -2173,13 +2173,14 @@ table.
 */
 
 void
-Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len)
+Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
 {
     dVAR;
     struct xpvhv_aux *aux = SvOOK(hv) ? HvAUX(hv) : hv_auxinit(hv);
     U32 hash;
 
     PERL_ARGS_ASSERT_HV_ENAME_ADD;
+    PERL_UNUSED_ARG(flags);
 
     if (len > I32_MAX)
        Perl_croak(aTHX_ "panic: hv name too long (%"UVuf")", (UV) len);
@@ -2229,12 +2230,13 @@ This is called when a stash is deleted from the symbol table.
 */
 
 void
-Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len)
+Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
 {
     dVAR;
     struct xpvhv_aux *aux;
 
     PERL_ARGS_ASSERT_HV_ENAME_DELETE;
+    PERL_UNUSED_ARG(flags);
 
     if (len > I32_MAX)
        Perl_croak(aTHX_ "panic: hv name too long (%"UVuf")", (UV) len);
diff --git a/mro.c b/mro.c
index d1b6d2f..9fd15de 100644 (file)
--- a/mro.c
+++ b/mro.c
@@ -841,7 +841,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
          if(PL_stashcache)
            (void)
             hv_delete(PL_stashcache, name, namlen, G_DISCARD);
-         hv_ename_delete(oldstash, name, namlen);
+         hv_ename_delete(oldstash, name, namlen, 0);
 
         /* If the name deletion caused a name change, then we are not
          * going to call mro_isa_changed_in with this name (and not at all
@@ -859,7 +859,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
     }
    check_stash:
     if(stash) {
-       hv_ename_add(stash, name, namlen);
+       hv_ename_add(stash, name, namlen, 0);
 
        /* Add it to the big list if it needs
        * mro_isa_changed_in called on it. That happens if it was
diff --git a/proto.h b/proto.h
index a24a9cb..8a76cea 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -1297,13 +1297,13 @@ PERL_CALLCONV void      Perl_hv_eiter_set(pTHX_ HV *hv, HE *eiter)
 #define PERL_ARGS_ASSERT_HV_EITER_SET  \
        assert(hv)
 
-PERL_CALLCONV void     Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len)
+PERL_CALLCONV void     Perl_hv_ename_add(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_HV_ENAME_ADD  \
        assert(hv); assert(name)
 
-PERL_CALLCONV void     Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len)
+PERL_CALLCONV void     Perl_hv_ename_delete(pTHX_ HV *hv, const char *name, U32 len, U32 flags)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_HV_ENAME_DELETE       \