From: Nicholas Clark Date: Wed, 23 Jan 2008 09:22:01 +0000 (+0000) Subject: Deprecate (and remove core use of ) Nullav, Nullcv, Nullgv, Nullhe, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ae1b22641a16d4d08aba688616c0f7cefb7d1f5;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/av.h b/av.h index 3c40dc8..8874045 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. Deprecated, use C 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 806fa82..aca3748 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 30635f7..c9a4c99 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 f7ddc09..1461142 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 fbd7e34..16aa058 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 f21307d..5be1959 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. /* 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. #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. &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 15875dc..ce39d2a 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -1399,6 +1399,8 @@ X Null AV pointer. +(deprecated - use C<(AV *)NULL> instead) + =for hackers Found in file av.h @@ -1415,6 +1417,8 @@ X Null CV pointer. +(deprecated - use C<(CV *)NULL> instead) + =for hackers Found in file cv.h @@ -1423,6 +1427,8 @@ X Null HV pointer. +(deprecated - use C<(HV *)NULL> instead) + =for hackers Found in file hv.h