summaryrefslogtreecommitdiff
path: root/gv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-02 13:57:19 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:02 -0700
commit04ec7e598cf9b8c51b752c7cbcd2ea2b582dfcbd (patch)
treebce3e4830fe7dfbd25fcac158ca7f125b7e76e4c /gv.h
parent0be4d16f8f8037c260cd860eed59d47166fbdd12 (diff)
downloadperl-04ec7e598cf9b8c51b752c7cbcd2ea2b582dfcbd.tar.gz
Merge multi and flags params to gv_init_*
Since multi is a boolean (even though it’s typed as an int), there is no need to have a separate parameter. We can just use a flag bit.
Diffstat (limited to 'gv.h')
-rw-r--r--gv.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gv.h b/gv.h
index 3140de46a9..a393262016 100644
--- a/gv.h
+++ b/gv.h
@@ -205,7 +205,8 @@ Return the SV from the GV.
#define GV_ADD 0x01 /* add, if symbol not already there
For gv_name_set, adding a HEK for the first
time, so don't try to free what's there. */
-#define GV_ADDMULTI 0x02 /* add, pretending it has been added already */
+#define GV_ADDMULTI 0x02 /* add, pretending it has been added
+ already; used also by gv_init_* */
#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */
#define GV_ADDINEVAL 0x08 /* add, as though we're doing so within an eval */
#define GV_NOINIT 0x10 /* add, but don't init symbol, if type != PVGV */
@@ -226,7 +227,7 @@ Return the SV from the GV.
#define GV_AUTOLOAD_ISMETHOD 1 /* autoloading a method? */
/* SVf_UTF8 (more accurately the return value from SvUTF8) is also valid
- as a flag to gv_fetchpvn_flags and gv_autoload_*, so ensure it lies
+ as a flag to various gv_* functions, so ensure it lies
outside this range.
*/
@@ -240,7 +241,8 @@ Return the SV from the GV.
#define gv_efullname3(sv,gv,prefix) gv_efullname4(sv,gv,prefix,TRUE)
#define gv_fetchmethod(stash, name) gv_fetchmethod_autoload(stash, name, TRUE)
#define gv_fetchsv_nomg(n,f,t) gv_fetchsv(n,(f)|GV_NO_SVGMAGIC,t)
-#define gv_init(gv,stash,name,len,multi) gv_init_pvn(gv,stash,name,len,multi,0)
+#define gv_init(gv,stash,name,len,multi) \
+ gv_init_pvn(gv,stash,name,len,GV_ADDMULTI*!!(multi))
#define gv_fetchmeth(stash,name,len,level) gv_fetchmeth_pvn(stash, name, len, level, 0)
#define gv_fetchmeth_autoload(stash,name,len,level) gv_fetchmeth_pvn_autoload(stash, name, len, level, 0)
#define gv_fetchmethod_flags(stash,name,flags) gv_fetchmethod_pv_flags(stash, name, flags)