First argument to he_dup is actually a const HE *
Nicholas Clark [Mon, 19 Sep 2005 18:48:10 +0000 (18:48 +0000)]
p4raw-id: //depot/perl@25497

embed.fnc
hv.c
proto.h
sv.c

index c173151..3fd0ec0 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -954,7 +954,7 @@ Apa |PERL_CONTEXT*|cx_dup   |NULLOK PERL_CONTEXT* cx|I32 ix|I32 max|NN CLONE_PARAM
 Apa    |PERL_SI*|si_dup        |NULLOK PERL_SI* si|NN CLONE_PARAMS* param
 Apa    |ANY*   |ss_dup         |NN PerlInterpreter* proto_perl|NN CLONE_PARAMS* param
 Apa    |void*  |any_dup        |NULLOK void* v|NN const PerlInterpreter* proto_perl
-Apa    |HE*    |he_dup         |NULLOK HE* e|bool shared|NN CLONE_PARAMS* param
+Apa    |HE*    |he_dup         |NULLOK const HE* e|bool shared|NN CLONE_PARAMS* param
 Apa    |HEK*   |hek_dup        |NULLOK HEK* e|NN CLONE_PARAMS* param
 Apa    |REGEXP*|re_dup         |NULLOK const REGEXP* r|NN CLONE_PARAMS* param
 Apa    |PerlIO*|fp_dup         |NULLOK PerlIO* fp|char type|NN CLONE_PARAMS* param
diff --git a/hv.c b/hv.c
index 147efcc..b5ed826 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -145,7 +145,7 @@ Perl_hek_dup(pTHX_ HEK *source, CLONE_PARAMS* param)
 }
 
 HE *
-Perl_he_dup(pTHX_ HE *e, bool shared, CLONE_PARAMS* param)
+Perl_he_dup(pTHX_ const HE *e, bool shared, CLONE_PARAMS* param)
 {
     HE *ret;
 
diff --git a/proto.h b/proto.h
index 98c3fd9..b7d8918 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2603,7 +2603,7 @@ PERL_CALLCONV void*       Perl_any_dup(pTHX_ void* v, const PerlInterpreter* proto_per
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_2);
 
-PERL_CALLCONV HE*      Perl_he_dup(pTHX_ HE* e, bool shared, CLONE_PARAMS* param)
+PERL_CALLCONV HE*      Perl_he_dup(pTHX_ const HE* e, bool shared, CLONE_PARAMS* param)
                        __attribute__malloc__
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_3);
diff --git a/sv.c b/sv.c
index 60a4645..4ebdc10 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -10625,7 +10625,7 @@ Perl_sv_dup(pTHX_ SV *sstr, CLONE_PARAMS* param)
                            char);
                        HvARRAY(dstr) = (HE**)darray;
                        while (i <= sxhv->xhv_max) {
-                           HE *source = HvARRAY(sstr)[i];
+                           const HE *source = HvARRAY(sstr)[i];
                            HvARRAY(dstr)[i] = source
                                ? he_dup(source, sharekeys, param) : 0;
                            ++i;