This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove some _get variants of *NAMEUTF8 macros in [gh]v.h
authorFather Chrysostomos <sprout@cpan.org>
Sat, 24 Sep 2011 17:17:58 +0000 (10:17 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 6 Oct 2011 20:00:58 +0000 (13:00 -0700)
For macros that returns flags, the _get convention implies that there
could be a _set variant some day.  But we don’t do that for flags.

gv.h
hv.h

diff --git a/gv.h b/gv.h
index b75da5a..9aa4eff 100644 (file)
--- a/gv.h
+++ b/gv.h
@@ -56,7 +56,7 @@ struct gp {
         }))
 #  define GvNAME_get(gv)       ({ assert(GvNAME_HEK(gv)); (char *)HEK_KEY(GvNAME_HEK(gv)); })
 #  define GvNAMELEN_get(gv)    ({ assert(GvNAME_HEK(gv)); HEK_LEN(GvNAME_HEK(gv)); })
         }))
 #  define GvNAME_get(gv)       ({ assert(GvNAME_HEK(gv)); (char *)HEK_KEY(GvNAME_HEK(gv)); })
 #  define GvNAMELEN_get(gv)    ({ assert(GvNAME_HEK(gv)); HEK_LEN(GvNAME_HEK(gv)); })
-#  define GvNAMEUTF8_get(gv)   ({ assert(GvNAME_HEK(gv)); HEK_UTF8(GvNAME_HEK(gv)); })
+#  define GvNAMEUTF8(gv)       ({ assert(GvNAME_HEK(gv)); HEK_UTF8(GvNAME_HEK(gv)); })
 #else
 #  define GvGP(gv)     (0+(gv)->sv_u.svu_gp)
 #  define GvGP_set(gv,gp)      ((gv)->sv_u.svu_gp = (gp))
 #else
 #  define GvGP(gv)     (0+(gv)->sv_u.svu_gp)
 #  define GvGP_set(gv,gp)      ((gv)->sv_u.svu_gp = (gp))
@@ -65,12 +65,11 @@ struct gp {
 #  define GvNAME_HEK(gv)       (GvXPVGV(gv)->xiv_u.xivu_namehek)
 #  define GvNAME_get(gv)       HEK_KEY(GvNAME_HEK(gv))
 #  define GvNAMELEN_get(gv)    HEK_LEN(GvNAME_HEK(gv))
 #  define GvNAME_HEK(gv)       (GvXPVGV(gv)->xiv_u.xivu_namehek)
 #  define GvNAME_get(gv)       HEK_KEY(GvNAME_HEK(gv))
 #  define GvNAMELEN_get(gv)    HEK_LEN(GvNAME_HEK(gv))
-#  define GvNAMEUTF8_get(gv)   HEK_UTF8(GvNAME_HEK(gv))
+#  define GvNAMEUTF8(gv)       HEK_UTF8(GvNAME_HEK(gv))
 #endif
 
 #define GvNAME(gv)     GvNAME_get(gv)
 #define GvNAMELEN(gv)  GvNAMELEN_get(gv)
 #endif
 
 #define GvNAME(gv)     GvNAME_get(gv)
 #define GvNAMELEN(gv)  GvNAMELEN_get(gv)
-#define GvNAMEUTF8(gv) GvNAMEUTF8_get(gv)
 
 #define        GvASSIGN_GENERATION(gv)         (0 + ((XPV*) SvANY(gv))->xpv_len)
 #define        GvASSIGN_GENERATION_set(gv,val)                 \
 
 #define        GvASSIGN_GENERATION(gv)         (0 + ((XPV*) SvANY(gv))->xpv_len)
 #define        GvASSIGN_GENERATION_set(gv,val)                 \
diff --git a/hv.h b/hv.h
index f97f159..4eafcc6 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -259,10 +259,8 @@ C<SV*>.
 #define HvEITER_get(hv)        (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : NULL)
 #define HvNAME(hv)     HvNAME_get(hv)
 #define HvNAMELEN(hv)   HvNAMELEN_get(hv)
 #define HvEITER_get(hv)        (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : NULL)
 #define HvNAME(hv)     HvNAME_get(hv)
 #define HvNAMELEN(hv)   HvNAMELEN_get(hv)
-#define HvNAMEUTF8(hv)  HvNAMEUTF8_get(hv)
 #define HvENAME(hv)    HvENAME_get(hv)
 #define HvENAMELEN(hv)  HvENAMELEN_get(hv)
 #define HvENAME(hv)    HvENAME_get(hv)
 #define HvENAMELEN(hv)  HvENAMELEN_get(hv)
-#define HvENAMEUTF8(hv) HvENAMEUTF8_get(hv)
 
 /* Checking that hv is a valid package stash is the
    caller's responsibility */
 
 /* Checking that hv is a valid package stash is the
    caller's responsibility */
@@ -287,7 +285,7 @@ C<SV*>.
 #define HvNAMELEN_get(hv) \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvNAME_HEK_NN(hv)) \
                                 ? HEK_LEN(HvNAME_HEK_NN(hv)) : 0)
 #define HvNAMELEN_get(hv) \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvNAME_HEK_NN(hv)) \
                                 ? HEK_LEN(HvNAME_HEK_NN(hv)) : 0)
-#define HvNAMEUTF8_get(hv) \
+#define HvNAMEUTF8(hv) \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvNAME_HEK_NN(hv)) \
                                 ? HEK_UTF8(HvNAME_HEK_NN(hv)) : 0)
 #define HvENAME_HEK_NN(hv)                                             \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvNAME_HEK_NN(hv)) \
                                 ? HEK_UTF8(HvNAME_HEK_NN(hv)) : 0)
 #define HvENAME_HEK_NN(hv)                                             \
@@ -305,7 +303,7 @@ C<SV*>.
 #define HvENAMELEN_get(hv) \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
                                 ? HEK_LEN(HvENAME_HEK_NN(hv)) : 0)
 #define HvENAMELEN_get(hv) \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
                                 ? HEK_LEN(HvENAME_HEK_NN(hv)) : 0)
-#define HvENAMEUTF8_get(hv) \
+#define HvENAMEUTF8(hv) \
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
                                 ? HEK_UTF8(HvENAME_HEK_NN(hv)) : 0)
 
        ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvENAME_HEK_NN(hv)) \
                                 ? HEK_UTF8(HvENAME_HEK_NN(hv)) : 0)