summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-12-22 17:00:24 +0000
committerNicholas Clark <nick@ccl4.org>2007-12-22 17:00:24 +0000
commitbfd025d94e67a140ec0eeee79dfcef213d537327 (patch)
tree30474f4613349a3cd9ae40f5ed51ab0628239375
parentd3f5e39945c1adca90422be3853d860ba9478c11 (diff)
downloadperl-bfd025d94e67a140ec0eeee79dfcef213d537327.tar.gz
Exterminate PL_na! Exterminate! Exterminate! Exterminate!
p4raw-id: //depot/perl@32704
-rw-r--r--ext/DB_File/typemap10
-rw-r--r--ext/GDBM_File/typemap17
-rw-r--r--ext/NDBM_File/typemap14
-rw-r--r--ext/ODBM_File/typemap19
-rw-r--r--ext/SDBM_File/typemap14
-rw-r--r--ext/Win32API/File/buffers.h6
-rw-r--r--ext/Win32API/File/typemap2
-rw-r--r--os2/OS2/typemap4
-rw-r--r--os2/os2.c4
-rw-r--r--pod/perltodo.pod5
-rw-r--r--pod/perlxs.pod4
-rw-r--r--vms/vms.c3
12 files changed, 58 insertions, 44 deletions
diff --git a/ext/DB_File/typemap b/ext/DB_File/typemap
index 077a95cb6f..c46b6851d7 100644
--- a/ext/DB_File/typemap
+++ b/ext/DB_File/typemap
@@ -29,8 +29,9 @@ T_dbtkeydatum
$var.size = (int)sizeof(recno_t);
}
else if (SvOK(my_sv)) {
- $var.data = SvPVbyte(my_sv, PL_na);
- $var.size = (int)PL_na;
+ STRLEN len;
+ $var.data = SvPVbyte(my_sv, len);
+ $var.size = (int)len;
}
}
T_dbtdatum
@@ -40,8 +41,9 @@ T_dbtdatum
DBT_clear($var) ;
SvGETMAGIC(my_sv) ;
if (SvOK(my_sv)) {
- $var.data = SvPVbyte(my_sv, PL_na);
- $var.size = (int)PL_na;
+ STRLEN len;
+ $var.data = SvPVbyte(my_sv, len);
+ $var.size = (int)len;
}
}
diff --git a/ext/GDBM_File/typemap b/ext/GDBM_File/typemap
index 3e69721569..71fc285787 100644
--- a/ext/GDBM_File/typemap
+++ b/ext/GDBM_File/typemap
@@ -16,25 +16,30 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM_K
DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ {
+ STRLEN len;
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
+ }
T_DATUM_K_C
{
SV * tmpSV;
+ STRLEN len;
if (db->filter_store_key) {
tmpSV = sv_2mortal(newSVsv($arg));
DBM_ckFilter(tmpSV, filter_store_key, \"filter_store_key\");
}
else
tmpSV = $arg;
- $var.dptr = SvPVbyte(tmpSV, PL_na);
- $var.dsize = (int)PL_na;
+ $var.dptr = SvPVbyte(tmpSV, len);
+ $var.dsize = (int)len;
}
T_DATUM_V
DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
if (SvOK($arg)) {
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ STRLEN len;
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
}
else {
$var.dptr = (char *)\"\";
diff --git a/ext/NDBM_File/typemap b/ext/NDBM_File/typemap
index b07695d66d..ad62e0aaf2 100644
--- a/ext/NDBM_File/typemap
+++ b/ext/NDBM_File/typemap
@@ -15,14 +15,18 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM_K
- DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ {
+ STRLEN len;
+ DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
+ }
T_DATUM_V
DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
if (SvOK($arg)) {
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ STRLEN len;
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
}
else {
$var.dptr = (char *)\"\";
diff --git a/ext/ODBM_File/typemap b/ext/ODBM_File/typemap
index cbc89b04b7..e4d8596a10 100644
--- a/ext/ODBM_File/typemap
+++ b/ext/ODBM_File/typemap
@@ -16,26 +16,31 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM_K
- DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ {
+ STRLEN len;
+3B DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
+ }
T_DATUM_K_C
{
SV * tmpSV ;
+ STRLEN len;
if (db->filter_store_key){
tmpSV = sv_2mortal(newSVsv($arg));
DBM_ckFilter(tmpSV, filter_store_key, \"filter_store_key\");
}
else
tmpSV = $arg;
- $var.dptr = SvPVbyte(tmpSV, PL_na);
- $var.dsize = (int)PL_na;
+ $var.dptr = SvPVbyte(tmpSV, len);
+ $var.dsize = (int)len;
}
T_DATUM_V
DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
if (SvOK($arg)) {
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ STRLEN len;
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
}
else {
$var.dptr = \"\";
diff --git a/ext/SDBM_File/typemap b/ext/SDBM_File/typemap
index c88725bf75..a06ce81aad 100644
--- a/ext/SDBM_File/typemap
+++ b/ext/SDBM_File/typemap
@@ -15,14 +15,18 @@ FATALFUNC T_OPAQUEPTR
INPUT
T_DATUM_K
- DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ {
+ STRLEN len;
+ DBM_ckFilter($arg, filter_store_key, \"filter_store_key\");
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
+ }
T_DATUM_V
DBM_ckFilter($arg, filter_store_value, \"filter_store_value\");
if (SvOK($arg)) {
- $var.dptr = SvPVbyte($arg, PL_na);
- $var.dsize = (int)PL_na;
+ STRLEN len;
+ $var.dptr = SvPVbyte($arg, len);
+ $var.dsize = (int)len;
}
else {
$var.dptr = \"\";
diff --git a/ext/Win32API/File/buffers.h b/ext/Win32API/File/buffers.h
index 2ae74e690b..934e57b9ac 100644
--- a/ext/Win32API/File/buffers.h
+++ b/ext/Win32API/File/buffers.h
@@ -214,7 +214,7 @@
#define null_arg(sv) ( SvROK(sv) && SVt_PVAV == SvTYPE(SvRV(sv)) \
&& -1 == av_len((AV*)SvRV(sv)) )
-#define PV_or_null(sv) ( null_arg(sv) ? NULL : SvPV(sv,PL_na) )
+#define PV_or_null(sv) ( null_arg(sv) ? NULL : SvPV_nolen(sv) )
/* Minimum buffer size to use when no buffer existed: */
#define MIN_GROW_SIZE 128
@@ -233,7 +233,7 @@
/* Whether the buffer size we got lets us change what buffer size we use: */
#define autosize(sv) (!( SvOK(sv) && ! SvROK(sv) \
- && SvPV(sv,PL_na) && '=' == *SvPV(sv,PL_na) ))
+ && SvPV_nolen(sv) && '=' == *SvPV_nolen(sv) ))
/* Get the IV/UV for a parameter that might be C<[]> or C<undef>: */
#define optIV(sv) ( null_arg(sv) ? 0 : !SvOK(sv) ? 0 : SvIV(sv) )
@@ -259,7 +259,7 @@
/* Initialize a buffer size argument of type DWORD: */
#define init_buf_l( svSize ) \
( null_arg(svSize) ? 0 : autosize(svSize) ? optUV(svSize) \
- : strtoul( 1+SvPV(svSize,PL_na), NULL, 10 ) )
+ : strtoul( 1+SvPV_nolen(svSize), NULL, 10 ) )
/* In INPUT section put "= init_buf_l($arg);" after variable name. */
/* Lengths in WCHARs are initialized the same as lengths in bytes: */
diff --git a/ext/Win32API/File/typemap b/ext/Win32API/File/typemap
index d5957652f9..2134712109 100644
--- a/ext/Win32API/File/typemap
+++ b/ext/Win32API/File/typemap
@@ -32,7 +32,7 @@ T_BUF
if( null_arg($arg) )
$var= NULL;
else
- $var= ($type) SvPV( $arg, PL_na )
+ $var= ($type) SvPV_nolen( $arg )
T_SBUF
grow_buf( $var,$arg, $type )
T_IV
diff --git a/os2/OS2/typemap b/os2/OS2/typemap
index b6f0e079d1..12bd58d347 100644
--- a/os2/OS2/typemap
+++ b/os2/OS2/typemap
@@ -17,9 +17,9 @@ PCSZ T_PVNULLC
#############################################################################
INPUT
T_PVNULL
- $var = ( SvOK($arg) ? ($type)SvPV($arg,PL_na) : NULL )
+ $var = ( SvOK($arg) ? ($type)SvPV_nolen($arg) : NULL )
T_PVNULLC
- $var = ( SvOK($arg) ? ($type)SvPV($arg,PL_na) : NULL )
+ $var = ( SvOK($arg) ? ($type)SvPV_nolen($arg) : NULL )
#############################################################################
OUTPUT
T_PVNULL
diff --git a/os2/os2.c b/os2/os2.c
index ff1c7bb351..53480e37a1 100644
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -4092,7 +4092,7 @@ XS(XS_OS2_pipe)
Perl_croak(aTHX_ "Usage: OS2::pipe(pszName, ulOpenMode, connect= 1, count= 1, ulInbufLength= 8192, ulOutbufLength= ulInbufLength, ulPipeMode= count | NP_NOWAIT | NP_TYPE_BYTE | NP_READMODE_BYTE, ulTimeout= 0)");
{
ULONG RETVAL;
- PCSZ pszName = ( SvOK(ST(0)) ? (PCSZ)SvPV(ST(0),PL_na) : NULL );
+ PCSZ pszName = ( SvOK(ST(0)) ? (PCSZ)SvPV_nolen(ST(0)) : NULL );
HPIPE hpipe;
SV *OpenMode = ST(1);
ULONG ulOpenMode;
@@ -4450,7 +4450,7 @@ XS(XS_OS2_open)
ULONG rc;
#line 113 "pipe.c"
ULONG RETVAL;
- PCSZ pszFileName = ( SvOK(ST(0)) ? (PCSZ)SvPV(ST(0),PL_na) : NULL );
+ PCSZ pszFileName = ( SvOK(ST(0)) ? (PCSZ)SvPV_nolen(ST(0)) : NULL );
HFILE hFile;
ULONG ulAction;
ULONG ulOpenMode = (ULONG)SvUV(ST(1));
diff --git a/pod/perltodo.pod b/pod/perltodo.pod
index d869b67c87..f270d6b979 100644
--- a/pod/perltodo.pod
+++ b/pod/perltodo.pod
@@ -365,11 +365,6 @@ Make F<pod/roffitall> be updated by F<pod/buildtoc>.
These tasks would need a little C knowledge, but don't need any specific
background or experience with XS, or how the Perl interpreter works
-=head2 Exterminate PL_na!
-
-C<PL_na> festers still in the darkest corners of various typemap files.
-It needs to be exterminated, replaced by a local variable of type C<STRLEN>.
-
=head2 Modernize the order of directories in @INC
The way @INC is laid out by default, one cannot upgrade core (dual-life)
diff --git a/pod/perlxs.pod b/pod/perlxs.pod
index facfcf91ab..c045564a6d 100644
--- a/pod/perlxs.pod
+++ b/pod/perlxs.pod
@@ -562,7 +562,7 @@ and $type can be used as in typemaps.
bool_t
rpcb_gettime(host,timep)
- char *host = (char *)SvPV($arg,PL_na);
+ char *host = (char *)SvPV_nolen($arg);
time_t &timep = 0;
OUTPUT:
timep
@@ -589,7 +589,7 @@ Here's a truly obscure example:
bool_t
rpcb_gettime(host,timep)
time_t &timep; /* \$v{timep}=@{[$v{timep}=$arg]} */
- char *host + SvOK($v{timep}) ? SvPV($arg,PL_na) : NULL;
+ char *host + SvOK($v{timep}) ? SvPV_nolen($arg) : NULL;
OUTPUT:
timep
diff --git a/vms/vms.c b/vms/vms.c
index a579d37ff4..81404bc446 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -12673,8 +12673,7 @@ mod2fname(pTHX_ CV *cv)
if (counter) {
strcat(work_name, "__");
}
- strcat(work_name, SvPV(*av_fetch(in_array, counter, FALSE),
- PL_na));
+ strcat(work_name, SvPV_nolen(*av_fetch(in_array, counter, FALSE)));
}
/* Check to see if we actually have to bother...*/