This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
s/Nullcv/NULL/g
[perl5.git] / sv.c
diff --git a/sv.c b/sv.c
index f48aa8b..2b2f188 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -242,7 +242,7 @@ S_more_sv(pTHX)
 
     if (PL_nice_chunk) {
        sv_add_arena(PL_nice_chunk, PL_nice_chunk_size, 0);
-       PL_nice_chunk = Nullch;
+       PL_nice_chunk = NULL;
         PL_nice_chunk_size = 0;
     }
     else {
@@ -573,13 +573,6 @@ heads and bodies within the arenas must already have been freed.
 
 =cut
 */
-#define free_arena(name)                                       \
-    STMT_START {                                               \
-       S_free_arena(aTHX_ (void**) PL_ ## name ## _arenaroot); \
-       PL_ ## name ## _arenaroot = 0;                          \
-       PL_ ## name ## _root = 0;                               \
-    } STMT_END
-
 void
 Perl_sv_free_arenas(pTHX)
 {
@@ -600,14 +593,13 @@ Perl_sv_free_arenas(pTHX)
            Safefree(sva);
     }
 
-    for (i=0; i<SVt_LAST; i++) {
-       S_free_arena(aTHX_ (void**) PL_body_arenaroots[i]);
-       PL_body_arenaroots[i] = 0;
+    S_free_arena(aTHX_ (void**) PL_body_arenas);
+
+    for (i=0; i<SVt_LAST; i++)
        PL_body_roots[i] = 0;
-    }
 
     Safefree(PL_nice_chunk);
-    PL_nice_chunk = Nullch;
+    PL_nice_chunk = NULL;
     PL_nice_chunk_size = 0;
     PL_sv_arenaroot = 0;
     PL_sv_root = 0;
@@ -652,15 +644,14 @@ STATIC void *
 S_more_bodies (pTHX_ size_t size, svtype sv_type)
 {
     dVAR;
-    void ** const arena_root   = &PL_body_arenaroots[sv_type];
-    void ** const root         = &PL_body_roots[sv_type];
+    void ** const root = &PL_body_roots[sv_type];
     char *start;
     const char *end;
     const size_t count = PERL_ARENA_SIZE / size;
 
     Newx(start, count*size, char);
-    *((void **) start) = *arena_root;
-    *arena_root = (void *)start;
+    *((void **) start) = PL_body_arenas;
+    PL_body_arenas = (void *)start;
 
     end = start + (count-1) * size;
 
@@ -2934,7 +2925,7 @@ S_glob_assign(pTHX_ SV *dstr, SV *sstr, const int dtype)
        /* don't upgrade SVt_PVLV: it can hold a glob */
        if (dtype != SVt_PVLV)
            sv_upgrade(dstr, SVt_PVGV);
-       sv_magic(dstr, dstr, PERL_MAGIC_glob, Nullch, 0);
+       sv_magic(dstr, dstr, PERL_MAGIC_glob, NULL, 0);
        GvSTASH(dstr) = GvSTASH(sstr);
        if (GvSTASH(dstr))
            Perl_sv_add_backref(aTHX_ (SV*)GvSTASH(dstr), dstr);
@@ -3011,7 +3002,7 @@ S_pvgv_assign(pTHX_ SV *dstr, SV *sstr) {
        if (intro) {
            if (GvCVGEN(dstr) && GvCV(dstr) != (CV*)sref) {
                SvREFCNT_dec(GvCV(dstr));
-               GvCV(dstr) = Nullcv;
+               GvCV(dstr) = NULL;
                GvCVGEN(dstr) = 0; /* Switch off cacheness. */
                PL_sub_generation++;
            }
@@ -3051,7 +3042,7 @@ S_pvgv_assign(pTHX_ SV *dstr, SV *sstr) {
                    }
                if (!intro)
                    cv_ckproto(cv, (GV*)dstr,
-                              SvPOK(sref) ? SvPVX_const(sref) : Nullch);
+                              SvPOK(sref) ? SvPVX_const(sref) : NULL);
            }
            GvCV(dstr) = (CV*)sref;
            GvCVGEN(dstr) = 0; /* Switch off cacheness. */
@@ -3146,8 +3137,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            SvIV_set(dstr,  SvIVX(sstr));
            if (SvIsUV(sstr))
                SvIsUV_on(dstr);
-           if (SvTAINTED(sstr))
-               SvTAINT(dstr);
+           /* SvTAINTED can only be true if the SV has taint magic, which in
+              turn means that the SV type is PVMG (or greater). This is the
+              case statement for SVt_IV, so this cannot be true (whatever gcov
+              may say).  */
+           assert(!SvTAINTED(sstr));
            return;
        }
        goto undef_sstr;
@@ -3167,8 +3161,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            }
            SvNV_set(dstr, SvNVX(sstr));
            (void)SvNOK_only(dstr);
-           if (SvTAINTED(sstr))
-               SvTAINT(dstr);
+           /* SvTAINTED can only be true if the SV has taint magic, which in
+              turn means that the SV type is PVMG (or greater). This is the
+              case statement for SVt_NV, so this cannot be true (whatever gcov
+              may say).  */
+           assert(!SvTAINTED(sstr));
            return;
        }
        goto undef_sstr;
@@ -3188,7 +3185,8 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
                GvMULTI_on(dstr);
                return;
            }
-           return S_glob_assign(aTHX_ dstr, sstr, dtype);
+           S_glob_assign(aTHX_ dstr, sstr, dtype);
+           return;
        }
        break;
     case SVt_PVFM:
@@ -3227,7 +3225,8 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
 
     case SVt_PVGV:
        if (dtype <= SVt_PVGV) {
-           return S_glob_assign(aTHX_ dstr, sstr, dtype);
+           S_glob_assign(aTHX_ dstr, sstr, dtype);
+           return;
        }
        /* FALL THROUGH */
 
@@ -3236,8 +3235,10 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            mg_get(sstr);
            if ((int)SvTYPE(sstr) != stype) {
                stype = SvTYPE(sstr);
-               if (stype == SVt_PVGV && dtype <= SVt_PVGV)
-                   return S_glob_assign(aTHX_ dstr, sstr, dtype);
+               if (stype == SVt_PVGV && dtype <= SVt_PVGV) {
+                   S_glob_assign(aTHX_ dstr, sstr, dtype);
+                   return;
+               }
            }
        }
        if (stype == SVt_PVLV)
@@ -3250,8 +3251,10 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
 
     if (sflags & SVf_ROK) {
        if (dtype >= SVt_PV) {
-           if (dtype == SVt_PVGV)
-               return S_pvgv_assign(aTHX_ dstr, sstr);
+           if (dtype == SVt_PVGV) {
+               S_pvgv_assign(aTHX_ dstr, sstr);
+               return;
+           }
            if (SvPVX_const(dstr)) {
                SvPV_free(dstr);
                SvLEN_set(dstr, 0);
@@ -3260,25 +3263,11 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
        }
        (void)SvOK_off(dstr);
        SvRV_set(dstr, SvREFCNT_inc(SvRV(sstr)));
-       SvROK_on(dstr);
-       if (sflags & SVp_NOK) {
-           SvNOKp_on(dstr);
-           /* Only set the public OK flag if the source has public OK.  */
-           if (sflags & SVf_NOK)
-               SvFLAGS(dstr) |= SVf_NOK;
-           SvNV_set(dstr, SvNVX(sstr));
-       }
-       if (sflags & SVp_IOK) {
-           (void)SvIOKp_on(dstr);
-           if (sflags & SVf_IOK)
-               SvFLAGS(dstr) |= SVf_IOK;
-           if (sflags & SVf_IVisUV)
-               SvIsUV_on(dstr);
-           SvIV_set(dstr, SvIVX(sstr));
-       }
-       if (SvAMAGIC(sstr)) {
-           SvAMAGIC_on(dstr);
-       }
+       SvFLAGS(dstr) |= sflags & (SVf_ROK|SVf_AMAGIC);
+       assert(!(sflags & SVp_NOK));
+       assert(!(sflags & SVp_IOK));
+       assert(!(sflags & SVf_NOK));
+       assert(!(sflags & SVf_IOK));
     }
     else if (sflags & SVp_POK) {
         bool isSwipe = 0;
@@ -3401,22 +3390,18 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
                 SvTEMP_off(sstr);
             }
         }
-       if (sflags & SVf_UTF8)
-           SvUTF8_on(dstr);
        if (sflags & SVp_NOK) {
-           SvNOKp_on(dstr);
-           if (sflags & SVf_NOK)
-               SvFLAGS(dstr) |= SVf_NOK;
            SvNV_set(dstr, SvNVX(sstr));
        }
        if (sflags & SVp_IOK) {
-           (void)SvIOKp_on(dstr);
-           if (sflags & SVf_IOK)
-               SvFLAGS(dstr) |= SVf_IOK;
+           SvRELEASE_IVX(dstr);
+           SvIV_set(dstr, SvIVX(sstr));
+           /* Must do this otherwise some other overloaded use of 0x80000000
+              gets confused. I guess SVpbm_VALID */
            if (sflags & SVf_IVisUV)
                SvIsUV_on(dstr);
-           SvIV_set(dstr, SvIVX(sstr));
        }
+       SvFLAGS(dstr) |= sflags & (SVf_IOK|SVp_IOK|SVf_NOK|SVp_NOK|SVf_UTF8);
        {
            const MAGIC * const smg = SvVOK(sstr);
            if (smg) {
@@ -3426,34 +3411,18 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
            }
        }
     }
-    else if (sflags & SVp_IOK) {
-       if (sflags & SVf_IOK)
-           (void)SvIOK_only(dstr);
-       else {
-           (void)SvOK_off(dstr);
-           (void)SvIOKp_on(dstr);
+    else if (sflags & (SVp_IOK|SVp_NOK)) {
+       (void)SvOK_off(dstr);
+       SvFLAGS(dstr) |= sflags & (SVf_IOK|SVp_IOK|SVf_IVisUV|SVf_NOK|SVp_NOK);
+       if (sflags & SVp_IOK) {
+           /* XXXX Do we want to set IsUV for IV(ROK)?  Be extra safe... */
+           SvIV_set(dstr, SvIVX(sstr));
        }
-       /* XXXX Do we want to set IsUV for IV(ROK)?  Be extra safe... */
-       if (sflags & SVf_IVisUV)
-           SvIsUV_on(dstr);
-       SvIV_set(dstr, SvIVX(sstr));
        if (sflags & SVp_NOK) {
-           if (sflags & SVf_NOK)
-               (void)SvNOK_on(dstr);
-           else
-               (void)SvNOKp_on(dstr);
+           SvFLAGS(dstr) |= sflags & (SVf_NOK|SVp_NOK);
            SvNV_set(dstr, SvNVX(sstr));
        }
     }
-    else if (sflags & SVp_NOK) {
-       if (sflags & SVf_NOK)
-           (void)SvNOK_only(dstr);
-       else {
-           (void)SvOK_off(dstr);
-           SvNOKp_on(dstr);
-       }
-       SvNV_set(dstr, SvNVX(sstr));
-    }
     else {
        if (dtype == SVt_PVGV) {
            if (ckWARN(WARN_MISC))
@@ -3711,7 +3680,7 @@ S_sv_release_COW(pTHX_ register SV *sv, const char *pvx, STRLEN len, SV *after)
 {
     if (len) { /* this SV was SvIsCOW_normal(sv) */
          /* we need to find the SV pointing to us.  */
-        SV * const current = SV_COW_NEXT_SV(after);
+        SV *current = SV_COW_NEXT_SV(after);
 
         if (current == sv) {
             /* The SV we point to points back to us (there were only two of us
@@ -3811,7 +3780,7 @@ Perl_sv_force_normal_flags(pTHX_ register SV *sv, U32 flags)
            const STRLEN len = SvCUR(sv);
            SvFAKE_off(sv);
            SvREADONLY_off(sv);
-           SvPV_set(sv, Nullch);
+           SvPV_set(sv, NULL);
            SvLEN_set(sv, 0);
            SvGROW(sv, len + 1);
            Move(pvx,SvPVX(sv),len,char);
@@ -5447,7 +5416,7 @@ Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2)
     const char *pv2;
     STRLEN cur2;
     I32  eq     = 0;
-    char *tpv   = Nullch;
+    char *tpv   = NULL;
     SV* svrecode = Nullsv;
 
     if (!sv1) {
@@ -5540,7 +5509,7 @@ Perl_sv_cmp(pTHX_ register SV *sv1, register SV *sv2)
     dVAR;
     STRLEN cur1, cur2;
     const char *pv1, *pv2;
-    char *tpv = Nullch;
+    char *tpv = NULL;
     I32  cmp;
     SV *svrecode = Nullsv;
 
@@ -6084,7 +6053,7 @@ screamer2:
     }
 
 return_string_or_null:
-    return (SvCUR(sv) - append) ? SvPVX(sv) : Nullch;
+    return (SvCUR(sv) - append) ? SvPVX(sv) : NULL;
 }
 
 /*
@@ -6822,7 +6791,7 @@ Perl_sv_reset(pTHX_ register const char *s, HV *stash)
                    SvOK_off(sv);
                    if (SvTYPE(sv) >= SVt_PV) {
                        SvCUR_set(sv, 0);
-                       if (SvPVX_const(sv) != Nullch)
+                       if (SvPVX_const(sv) != NULL)
                            *SvPVX(sv) = '\0';
                        SvTAINT(sv);
                    }
@@ -6904,10 +6873,10 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
 {
     dVAR;
     GV *gv = Nullgv;
-    CV *cv = Nullcv;
+    CV *cv = NULL;
 
     if (!sv)
-       return *st = NULL, *gvp = Nullgv, Nullcv;
+       return *st = NULL, *gvp = Nullgv, NULL;
     switch (SvTYPE(sv)) {
     case SVt_PVCV:
        *st = CvSTASH(sv);
@@ -6917,7 +6886,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
     case SVt_PVAV:
        *st = NULL;
        *gvp = Nullgv;
-       return Nullcv;
+       return NULL;
     case SVt_PVGV:
        gv = (GV*)sv;
        *gvp = gv;
@@ -6949,7 +6918,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
        *gvp = gv;
        if (!gv) {
            *st = NULL;
-           return Nullcv;
+           return NULL;
        }
        /* Some flags to gv_fetchsv mean don't really create the GV  */
        if (SvTYPE(gv) != SVt_PVGV) {
@@ -6962,7 +6931,7 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **st, GV **gvp, I32 lref)
            SV *tmpsv;
            ENTER;
            tmpsv = newSV(0);
-           gv_efullname3(tmpsv, gv, Nullch);
+           gv_efullname3(tmpsv, gv, NULL);
            /* XXX this is probably not what they think they're getting.
             * It has the same effect as "sub name;", i.e. just a forward
             * declaration! */
@@ -7277,7 +7246,7 @@ Copies a pointer into a new SV, optionally blessing the SV.  The C<rv>
 argument will be upgraded to an RV.  That RV will be modified to point to
 the new SV.  If the C<pv> argument is NULL then C<PL_sv_undef> will be placed
 into the SV.  The C<classname> argument indicates the package for the
-blessing.  Set C<classname> to C<Nullch> to avoid the blessing.  The new SV
+blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
 will have a reference count of 1, and the RV will be returned.
 
 Do not use with other Perl types such as HV, AV, SV, CV, because those
@@ -7307,7 +7276,7 @@ Perl_sv_setref_pv(pTHX_ SV *rv, const char *classname, void *pv)
 Copies an integer into a new SV, optionally blessing the SV.  The C<rv>
 argument will be upgraded to an RV.  That RV will be modified to point to
 the new SV.  The C<classname> argument indicates the package for the
-blessing.  Set C<classname> to C<Nullch> to avoid the blessing.  The new SV
+blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
 will have a reference count of 1, and the RV will be returned.
 
 =cut
@@ -7326,7 +7295,7 @@ Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv)
 Copies an unsigned integer into a new SV, optionally blessing the SV.  The C<rv>
 argument will be upgraded to an RV.  That RV will be modified to point to
 the new SV.  The C<classname> argument indicates the package for the
-blessing.  Set C<classname> to C<Nullch> to avoid the blessing.  The new SV
+blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
 will have a reference count of 1, and the RV will be returned.
 
 =cut
@@ -7345,7 +7314,7 @@ Perl_sv_setref_uv(pTHX_ SV *rv, const char *classname, UV uv)
 Copies a double into a new SV, optionally blessing the SV.  The C<rv>
 argument will be upgraded to an RV.  That RV will be modified to point to
 the new SV.  The C<classname> argument indicates the package for the
-blessing.  Set C<classname> to C<Nullch> to avoid the blessing.  The new SV
+blessing.  Set C<classname> to C<NULL> to avoid the blessing.  The new SV
 will have a reference count of 1, and the RV will be returned.
 
 =cut
@@ -7365,7 +7334,7 @@ Copies a string into a new SV, optionally blessing the SV.  The length of the
 string must be specified with C<n>.  The C<rv> argument will be upgraded to
 an RV.  That RV will be modified to point to the new SV.  The C<classname>
 argument indicates the package for the blessing.  Set C<classname> to
-C<Nullch> to avoid the blessing.  The new SV will have a reference count
+C<NULL> to avoid the blessing.  The new SV will have a reference count
 of 1, and the RV will be returned.
 
 Note that C<sv_setref_pv> copies the pointer while this copies the string.
@@ -7831,7 +7800,7 @@ S_F0convert(NV nv, char *endbuf, STRLEN *len)
        *len = endbuf - p;
        return p;
     }
-    return Nullch;
+    return NULL;
 }
 
 
@@ -7971,7 +7940,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
        U8 utf8buf[UTF8_MAXBYTES+1];
        STRLEN esignlen = 0;
 
-       const char *eptr = Nullch;
+       const char *eptr = NULL;
        STRLEN elen = 0;
        SV *vecsv = Nullsv;
        const U8 *vecstr = Null(U8*);
@@ -9061,7 +9030,7 @@ Perl_re_dup(pTHX_ const REGEXP *r, CLONE_PARAMS *param)
     if (RX_MATCH_COPIED(ret))
        ret->subbeg  = SAVEPVN(r->subbeg, r->sublen);
     else
-       ret->subbeg = Nullch;
+       ret->subbeg = NULL;
 #ifdef PERL_OLD_COPY_ON_WRITE
     ret->saved_copy = Nullsv;
 #endif
@@ -9603,7 +9572,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
                    }
                }
                else {
-                   SvPV_set(dstr, Nullch);
+                   SvPV_set(dstr, NULL);
                    AvALLOC((AV*)dstr)  = (SV**)NULL;
                }
                break;
@@ -9651,7 +9620,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
                        }
                    }
                    else {
-                       SvPV_set(dstr, Nullch);
+                       SvPV_set(dstr, NULL);
                    }
                    /* Record stashes for possible cloning in Perl_clone(). */
                    if(hvname)
@@ -10309,7 +10278,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     param->flags = flags;
     param->proto_perl = proto_perl;
 
-    Zero(&PL_body_arenaroots, 1, PL_body_arenaroots);
+    PL_body_arenas = NULL;
     Zero(&PL_body_roots, 1, PL_body_roots);
     
     PL_nice_chunk      = NULL;
@@ -10523,7 +10492,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     if (proto_perl->Iop_mask)
        PL_op_mask      = SAVEPVN(proto_perl->Iop_mask, PL_maxo);
     else
-       PL_op_mask      = Nullch;
+       PL_op_mask      = NULL;
     /* PL_asserting        = proto_perl->Iasserting; */
 
     /* current interpreter roots */
@@ -10541,7 +10510,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_lastfd          = proto_perl->Ilastfd;
     PL_oldname         = proto_perl->Ioldname;         /* XXX not quite right */
     PL_Argv            = NULL;
-    PL_Cmd             = Nullch;
+    PL_Cmd             = NULL;
     PL_gensym          = proto_perl->Igensym;
     PL_preambled       = proto_perl->Ipreambled;
     PL_preambleav      = av_dup_inc(proto_perl->Ipreambleav, param);
@@ -10778,7 +10747,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_glob_index      = proto_perl->Iglob_index;
     PL_srand_called    = proto_perl->Isrand_called;
     PL_uudmap['M']     = 0;            /* reinits on demand */
-    PL_bitcount                = Nullch;       /* reinits on demand */
+    PL_bitcount                = NULL; /* reinits on demand */
 
     if (proto_perl->Ipsig_pend) {
        Newxz(PL_psig_pend, SIG_SIZE, int);
@@ -10914,7 +10883,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_sortstash       = hv_dup(proto_perl->Tsortstash, param);
     PL_firstgv         = gv_dup(proto_perl->Tfirstgv, param);
     PL_secondgv                = gv_dup(proto_perl->Tsecondgv, param);
-    PL_efloatbuf       = Nullch;               /* reinits on demand */
+    PL_efloatbuf       = NULL;         /* reinits on demand */
     PL_efloatsize      = 0;                    /* reinits on demand */
 
     /* regex stuff */
@@ -10925,26 +10894,26 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_lastscream      = Nullsv;
 
     PL_watchaddr       = NULL;
-    PL_watchok         = Nullch;
+    PL_watchok         = NULL;
 
     PL_regdummy                = proto_perl->Tregdummy;
-    PL_regprecomp      = Nullch;
+    PL_regprecomp      = NULL;
     PL_regnpar         = 0;
     PL_regsize         = 0;
     PL_colorset                = 0;            /* reinits PL_colors[] */
     /*PL_colors[6]     = {0,0,0,0,0,0};*/
-    PL_reginput                = Nullch;
-    PL_regbol          = Nullch;
-    PL_regeol          = Nullch;
+    PL_reginput                = NULL;
+    PL_regbol          = NULL;
+    PL_regeol          = NULL;
     PL_regstartp       = (I32*)NULL;
     PL_regendp         = (I32*)NULL;
     PL_reglastparen    = (U32*)NULL;
     PL_reglastcloseparen       = (U32*)NULL;
-    PL_regtill         = Nullch;
+    PL_regtill         = NULL;
     PL_reg_start_tmp   = (char**)NULL;
     PL_reg_start_tmpl  = 0;
     PL_regdata         = (struct reg_data*)NULL;
-    PL_bostr           = Nullch;
+    PL_bostr           = NULL;
     PL_reg_flags       = 0;
     PL_reg_eval_set    = 0;
     PL_regnarrate      = 0;
@@ -10953,21 +10922,21 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_regcc           = (CURCUR*)NULL;
     PL_reg_call_cc     = (struct re_cc_state*)NULL;
     PL_reg_re          = (regexp*)NULL;
-    PL_reg_ganch       = Nullch;
+    PL_reg_ganch       = NULL;
     PL_reg_sv          = Nullsv;
     PL_reg_match_utf8  = FALSE;
     PL_reg_magic       = (MAGIC*)NULL;
     PL_reg_oldpos      = 0;
     PL_reg_oldcurpm    = (PMOP*)NULL;
     PL_reg_curpm       = (PMOP*)NULL;
-    PL_reg_oldsaved    = Nullch;
+    PL_reg_oldsaved    = NULL;
     PL_reg_oldsavedlen = 0;
 #ifdef PERL_OLD_COPY_ON_WRITE
     PL_nrs             = Nullsv;
 #endif
     PL_reg_maxiter     = 0;
     PL_reg_leftiter    = 0;
-    PL_reg_poscache    = Nullch;
+    PL_reg_poscache    = NULL;
     PL_reg_poscache_size= 0;
 
     /* RE engine - function pointers */