summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-23 09:22:01 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-23 09:22:01 +0000
commit3ae1b22641a16d4d08aba688616c0f7cefb7d1f5 (patch)
tree328fb3e73472d14b47df8b7777382e58d14ab433
parent3134ad69d93db50cabc8276feb0660bf859dbad1 (diff)
downloadperl-3ae1b22641a16d4d08aba688616c0f7cefb7d1f5.tar.gz
Deprecate (and remove core use of ) Nullav, Nullcv, Nullgv, Nullhe,
Nullhek and Nullhv. Nullop is going to be a bit less simple. p4raw-id: //depot/perl@33051
-rw-r--r--av.h6
-rw-r--r--cv.h6
-rw-r--r--ext/B/B.xs2
-rw-r--r--ext/DynaLoader/dl_symbian.xs2
-rw-r--r--gv.h4
-rw-r--r--hv.h15
-rw-r--r--pod/perlapi.pod6
7 files changed, 32 insertions, 9 deletions
diff --git a/av.h b/av.h
index 3c40dc8fe8..8874045099 100644
--- a/av.h
+++ b/av.h
@@ -57,6 +57,8 @@ typedef struct {
=for apidoc AmU||Nullav
Null AV pointer.
+(deprecated - use C<(AV *)NULL> instead)
+
=head1 Array Manipulation Functions
=for apidoc Am|int|AvFILL|AV* av
@@ -65,7 +67,9 @@ Same as C<av_len()>. Deprecated, use C<av_len()> instead.
=cut
*/
-#define Nullav Null(AV*)
+#ifndef PERL_CORE
+# define Nullav Null(AV*)
+#endif
#define AvARRAY(av) ((av)->sv_u.svu_array)
#define AvALLOC(av) (*((SV***)&((XPVAV*) SvANY(av))->xav_alloc))
diff --git a/cv.h b/cv.h
index 806fa826ac..aca3748936 100644
--- a/cv.h
+++ b/cv.h
@@ -28,6 +28,8 @@ typedef struct {
=for apidoc AmU||Nullcv
Null CV pointer.
+(deprecated - use C<(CV *)NULL> instead)
+
=head1 CV Manipulation Functions
=for apidoc Am|HV*|CvSTASH|CV* cv
@@ -36,7 +38,9 @@ Returns the stash of the CV.
=cut
*/
-#define Nullcv Null(CV*)
+#ifndef PERL_CORE
+# define Nullcv Null(CV*)
+#endif
#define CvSTASH(sv) ((XPVCV*)SvANY(sv))->xcv_stash
#define CvSTART(sv) ((XPVCV*)SvANY(sv))->xcv_start_u.xcv_start
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 30635f73c4..c9a4c99d26 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -1142,7 +1142,7 @@ SVOP_gv(o)
#define PADOP_sv(o) (o->op_padix ? PAD_SVl(o->op_padix) : Nullsv)
#define PADOP_gv(o) ((o->op_padix \
&& SvTYPE(PAD_SVl(o->op_padix)) == SVt_PVGV) \
- ? (GV*)PAD_SVl(o->op_padix) : Nullgv)
+ ? (GV*)PAD_SVl(o->op_padix) : (GV *)NULL)
MODULE = B PACKAGE = B::PADOP PREFIX = PADOP_
diff --git a/ext/DynaLoader/dl_symbian.xs b/ext/DynaLoader/dl_symbian.xs
index f7ddc09e4a..1461142ef3 100644
--- a/ext/DynaLoader/dl_symbian.xs
+++ b/ext/DynaLoader/dl_symbian.xs
@@ -78,7 +78,7 @@ void* dlopen(const char *filename, int flags) {
h = new PerlSymbianLibHandle;
if (h) {
h->error = KErrNone;
- h->symbols = Nullhv;
+ h->symbols = (HV *)NULL;
} else
error = KErrNoMemory;
}
diff --git a/gv.h b/gv.h
index fbd7e344f3..16aa058fa5 100644
--- a/gv.h
+++ b/gv.h
@@ -176,7 +176,9 @@ Return the SV from the GV.
#undef GV_UNIQUE_CHECK
#endif
-#define Nullgv Null(GV*)
+#ifndef PERL_CORE
+# define Nullgv Null(GV*)
+#endif
#define DM_UID 0x003
#define DM_RUID 0x001
diff --git a/hv.h b/hv.h
index f21307d0f6..5be19590dd 100644
--- a/hv.h
+++ b/hv.h
@@ -165,6 +165,8 @@ is to be expected. (For information only--not to be used).
=for apidoc AmU||Nullhv
Null HV pointer.
+(deprecated - use C<(HV *)NULL> instead)
+
=head1 Hash Manipulation Functions
=for apidoc Am|char*|HvNAME|HV* stash
@@ -230,8 +232,9 @@ C<SV*>.
/* these hash entry flags ride on hent_klen (for use only in magic/tied HVs) */
#define HEf_SVKEY -2 /* hent_key is an SV* */
-
-#define Nullhv Null(HV*)
+#ifndef PERL_CORE
+# define Nullhv Null(HV*)
+#endif
#define HvARRAY(hv) ((hv)->sv_u.svu_hash)
#define HvFILL(hv) ((XPVHV*) SvANY(hv))->xhv_fill
#define HvMAX(hv) ((XPVHV*) SvANY(hv))->xhv_max
@@ -300,7 +303,9 @@ C<SV*>.
#define HvREHASH_on(hv) (SvFLAGS(hv) |= SVphv_REHASH)
#define HvREHASH_off(hv) (SvFLAGS(hv) &= ~SVphv_REHASH)
-#define Nullhe Null(HE*)
+#ifndef PERL_CORE
+# define Nullhe Null(HE*)
+#endif
#define HeNEXT(he) (he)->hent_next
#define HeKEY_hek(he) (he)->hent_hek
#define HeKEY(he) HEK_KEY(HeKEY_hek(he))
@@ -332,7 +337,9 @@ C<SV*>.
&PL_sv_undef)
#define HeSVKEY_set(he,sv) ((HeKLEN(he) = HEf_SVKEY), (HeKEY_sv(he) = sv))
-#define Nullhek Null(HEK*)
+#ifndef PERL_CORE
+# define Nullhek Null(HEK*)
+#endif
#define HEK_BASESIZE STRUCT_OFFSET(HEK, hek_key[0])
#define HEK_HASH(hek) (hek)->hek_hash
#define HEK_LEN(hek) (hek)->hek_len
diff --git a/pod/perlapi.pod b/pod/perlapi.pod
index 15875dc9f3..ce39d2ac26 100644
--- a/pod/perlapi.pod
+++ b/pod/perlapi.pod
@@ -1399,6 +1399,8 @@ X<Nullav>
Null AV pointer.
+(deprecated - use C<(AV *)NULL> instead)
+
=for hackers
Found in file av.h
@@ -1415,6 +1417,8 @@ X<Nullcv>
Null CV pointer.
+(deprecated - use C<(CV *)NULL> instead)
+
=for hackers
Found in file cv.h
@@ -1423,6 +1427,8 @@ X<Nullhv>
Null HV pointer.
+(deprecated - use C<(HV *)NULL> instead)
+
=for hackers
Found in file hv.h