summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-08-10 21:54:00 +0000
committerNicholas Clark <nick@ccl4.org>2008-08-10 21:54:00 +0000
commit1c5b513e3fd8bc7a5a38ca94832b9e848ef0301d (patch)
tree205494c8824cf25aa4a0f5e4f5fd2fc5734daee0
parentffe4764e6903def60304ff584612fb863707cd05 (diff)
downloadperl-1c5b513e3fd8bc7a5a38ca94832b9e848ef0301d.tar.gz
Purge C<n_a> thoughtcrime from the pods.
p4raw-id: //depot/perl@34197
-rw-r--r--pod/perlcall.pod6
-rw-r--r--pod/perlembed.pod27
-rw-r--r--pod/perlxs.pod6
3 files changed, 14 insertions, 25 deletions
diff --git a/pod/perlcall.pod b/pod/perlcall.pod
index 1a9ac8ddad..08173d2e69 100644
--- a/pod/perlcall.pod
+++ b/pod/perlcall.pod
@@ -904,8 +904,7 @@ and some C to call it
/* Check the eval first */
if (SvTRUE(ERRSV))
{
- STRLEN n_a;
- printf ("Uh oh - %s\n", SvPV(ERRSV, n_a));
+ printf ("Uh oh - %s\n", SvPV_nolen(ERRSV));
POPs;
}
else
@@ -947,8 +946,7 @@ The code
if (SvTRUE(ERRSV))
{
- STRLEN n_a;
- printf ("Uh oh - %s\n", SvPV(ERRSV, n_a));
+ printf ("Uh oh - %s\n", SvPV_nolen(ERRSV));
POPs;
}
diff --git a/pod/perlembed.pod b/pod/perlembed.pod
index f4b13a3af3..2466531255 100644
--- a/pod/perlembed.pod
+++ b/pod/perlembed.pod
@@ -313,7 +313,6 @@ the first, a C<float> from the second, and a C<char *> from the third.
main (int argc, char **argv, char **env)
{
- STRLEN n_a;
char *embedding[] = { "", "-e", "0" };
PERL_SYS_INIT3(&argc,&argv,&env);
@@ -334,7 +333,7 @@ the first, a C<float> from the second, and a C<char *> from the third.
/** Treat $a as a string **/
eval_pv("$a = 'rekcaH lreP rehtonA tsuJ'; $a = reverse($a);", TRUE);
- printf("a = %s\n", SvPV(get_sv("a", FALSE), n_a));
+ printf("a = %s\n", SvPV_nolen(get_sv("a", FALSE)));
perl_destruct(my_perl);
perl_free(my_perl);
@@ -357,9 +356,8 @@ possible and in most cases a better strategy to fetch the return value
from I<eval_pv()> instead. Example:
...
- STRLEN n_a;
SV *val = eval_pv("reverse 'rekcaH lreP rehtonA tsuJ'", TRUE);
- printf("%s\n", SvPV(val,n_a));
+ printf("%s\n", SvPV_nolen(val));
...
This way, we avoid namespace pollution by not creating global
@@ -406,7 +404,7 @@ been wrapped here):
{
dSP;
SV* retval;
- STRLEN n_a;
+
PUSHMARK(SP);
eval_sv(sv, G_SCALAR);
@@ -416,7 +414,7 @@ been wrapped here):
PUTBACK;
if (croak_on_error && SvTRUE(ERRSV))
- croak(SvPVx(ERRSV, n_a));
+ croak(SvPVx_nolen(ERRSV));
return retval;
}
@@ -431,10 +429,9 @@ been wrapped here):
I32 match(SV *string, char *pattern)
{
SV *command = newSV(0), *retval;
- STRLEN n_a;
sv_setpvf(command, "my $string = '%s'; $string =~ %s",
- SvPV(string,n_a), pattern);
+ SvPV_nolen(string), pattern);
retval = my_eval_sv(command, TRUE);
SvREFCNT_dec(command);
@@ -453,10 +450,9 @@ been wrapped here):
I32 substitute(SV **string, char *pattern)
{
SV *command = newSV(0), *retval;
- STRLEN n_a;
sv_setpvf(command, "$string = '%s'; ($string =~ %s)",
- SvPV(*string,n_a), pattern);
+ SvPV_nolen(*string), pattern);
retval = my_eval_sv(command, TRUE);
SvREFCNT_dec(command);
@@ -477,10 +473,9 @@ been wrapped here):
{
SV *command = newSV(0);
I32 num_matches;
- STRLEN n_a;
sv_setpvf(command, "my $string = '%s'; @array = ($string =~ %s)",
- SvPV(string,n_a), pattern);
+ SvPV_nolen(string), pattern);
my_eval_sv(command, TRUE);
SvREFCNT_dec(command);
@@ -497,7 +492,6 @@ been wrapped here):
AV *match_list;
I32 num_matches, i;
SV *text;
- STRLEN n_a;
PERL_SYS_INIT3(&argc,&argv,&env);
my_perl = perl_alloc();
@@ -532,7 +526,7 @@ been wrapped here):
printf("matches: m/(wi..)/g found %d matches...\n", num_matches);
for (i = 0; i < num_matches; i++)
- printf("match: %s\n", SvPV(*av_fetch(match_list, i, FALSE),n_a));
+ printf("match: %s\n", SvPV_nolen(*av_fetch(match_list, i, FALSE)));
printf("\n");
/** Remove all vowels from text **/
@@ -540,7 +534,7 @@ been wrapped here):
if (num_matches) {
printf("substitute: s/[aeiou]//gi...%d substitutions made.\n",
num_matches);
- printf("Now text is: %s\n\n", SvPV(text,n_a));
+ printf("Now text is: %s\n\n", SvPV_nolen(text));
}
/** Attempt a substitution **/
@@ -784,7 +778,6 @@ with L<perlfunc/my> whenever possible.
char *args[] = { "", DO_CLEAN, NULL };
char filename[BUFFER_SIZE];
int exitstatus = 0;
- STRLEN n_a;
PERL_SYS_INIT3(&argc,&argv,&env);
if((my_perl = perl_alloc()) == NULL) {
@@ -810,7 +803,7 @@ with L<perlfunc/my> whenever possible.
/* check $@ */
if(SvTRUE(ERRSV))
- fprintf(stderr, "eval error: %s\n", SvPV(ERRSV,n_a));
+ fprintf(stderr, "eval error: %s\n", SvPV_nolen(ERRSV));
}
}
diff --git a/pod/perlxs.pod b/pod/perlxs.pod
index 9e70c69126..c2cae2269a 100644
--- a/pod/perlxs.pod
+++ b/pod/perlxs.pod
@@ -950,10 +950,9 @@ The XS code, with ellipsis, follows.
time_t timep = NO_INIT
PREINIT:
char *host = "localhost";
- STRLEN n_a;
CODE:
if( items > 1 )
- host = (char *)SvPV(ST(1), n_a);
+ host = (char *)SvPV_nolen(ST(1));
RETVAL = rpcb_gettime( host, &timep );
OUTPUT:
timep
@@ -1242,10 +1241,9 @@ prototypes.
PROTOTYPE: $;$
PREINIT:
char *host = "localhost";
- STRLEN n_a;
CODE:
if( items > 1 )
- host = (char *)SvPV(ST(1), n_a);
+ host = (char *)SvPV_nolen(ST(1));
RETVAL = rpcb_gettime( host, &timep );
OUTPUT:
timep