summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xConfigure66
-rw-r--r--MANIFEST4
-rw-r--r--Porting/Glossary36
-rw-r--r--Porting/config.sh16
-rw-r--r--Porting/config_H47
-rw-r--r--av.c5
-rw-r--r--config_h.SH41
-rw-r--r--doio.c11
-rw-r--r--dump.c306
-rw-r--r--eg/cgi/dna_small_gif.uu (renamed from eg/cgi/dna.small.gif.uu)2
-rw-r--r--eg/cgi/wilogo_gif.uu (renamed from eg/cgi/wilogo.gif.uu)0
-rw-r--r--ext/B/defsubs_h.PL1
-rw-r--r--lib/Benchmark.pm77
-rw-r--r--op.c20
-rw-r--r--patchlevel.h13
-rw-r--r--perl.h16
-rw-r--r--pod/perldiag.pod4
-rw-r--r--pod/perlfunc.pod3
-rw-r--r--pod/perlref.pod19
-rw-r--r--pp_hot.c10
-rw-r--r--pp_sys.c9
-rw-r--r--regcomp.c24
-rw-r--r--regexec.c22
-rw-r--r--sv.c51
-rwxr-xr-xt/lib/fields.t2
-rw-r--r--t/lib/syslfs.t6
-rw-r--r--t/op/lfs.t6
-rwxr-xr-xt/op/pat.t8
-rw-r--r--t/op/re_tests1
-rwxr-xr-xt/pragma/constant.t2
-rw-r--r--taint.c6
-rw-r--r--toke.c23
-rw-r--r--util.c17
33 files changed, 423 insertions, 451 deletions
diff --git a/Configure b/Configure
index 8fd2a8d598..54636fedc2 100755
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu Sep 30 19:41:54 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Sun Oct 3 02:41:02 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
@@ -814,6 +814,7 @@ stdio_stream_array=''
d_strtoull=''
sysman=''
trnl=''
+uidsign=''
uidtype=''
archname64=''
use64bits=''
@@ -842,6 +843,8 @@ vendorprefix=''
vendorprefixexp=''
defvoidused=''
voidflags=''
+pm_apiversion=''
+xs_apiversion=''
CONFIG=''
define='define'
@@ -6719,7 +6722,7 @@ eval $setvar
case "$use64bits" in
"$define" )
echo " "
- echo $n "Checking to see if your system supports int64_t...$c" >&4
+ $echo $n "Checking to see if your system supports int64_t...$c" >&4
$cat >try.c <<EOCP
#include <sys/types.h>
#$i_inttypes I_INTTYPES
@@ -6792,7 +6795,7 @@ $rm -f intsize intsize.*
: check for long long
echo " "
-echo $n "Checking to see if your system supports long long...$c" >&4
+$echo $n "Checking to see if your system supports long long...$c" >&4
echo 'long long foo() { long long x; x = 7; return x; }' > try.c
if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
val="$define"
@@ -7025,7 +7028,7 @@ $rm -f try.c try
: check for long doubles
echo " "
-echo $n "Checking to see if your system supports long double...$c" >&4
+$echo $n "Checking to see if your system supports long double...$c" >&4
echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
val="$define"
@@ -8579,7 +8582,7 @@ eval $inlibc
: check for off64_t
echo " "
-echo $n "Checking to see if your system supports off64_t...$c" >&4
+$echo $n "Checking to see if your system supports off64_t...$c" >&4
$cat >try.c <<EOCP
#include <sys/types.h>
#include <unistd.h>
@@ -8598,7 +8601,7 @@ eval $setvar
: check for fpos64_t
echo " "
-echo $n "Checking to see if your system supports fpos64_t...$c" >&4
+$echo $n "Checking to see if your system supports fpos64_t...$c" >&4
$cat >try.c <<EOCP
#include <sys/stdio.h>
fpos64_t foo() { fpos64_t x; x = 7; return x; }'
@@ -11410,7 +11413,7 @@ if eval $compile_ok; then
echo "You have EBCDIC." >&4
val="$define"
else
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin, or UTF." >&4
+ echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
fi
else
echo "I'm unable to compile the test program." >&4
@@ -11938,6 +11941,15 @@ rp="What is the type of process ids on this system?"
set pid_t pidtype int stdio.h sys/types.h
eval $typedef_ask
+: Find earliest binary compatible site_perl subdirectory perl can use.
+case "$bincompat5005" in
+"$define") xs_apiversion='5.005' ;;
+*) xs_apiversion=$apiversion ;; # The current site_perl version.
+esac
+: Find earliest pure perl site_perl subdirectory perl can use.
+: The versioned directories started at 5.005.
+pm_apiversion='5.005'
+
: check for length of pointer
echo " "
case "$ptrsize" in
@@ -12507,6 +12519,43 @@ uid_t) echo "uid_t found." ;;
;;
esac
+echo " "
+case "$uidtype" in
+*_t) zzz="$uidtype" ;;
+*) zzz="uid" ;;
+esac
+echo "Checking the sign of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $uidtype foo = -1;
+ if (foo < 0)
+ printf("-1\n");
+ else
+ printf("1\n");
+}
+EOCP
+set try
+if eval $compile; then
+ yyy=`./try`
+ case "$yyy" in
+ '') uidsign=1
+ echo "(I can't execute the test program--guessing unsigned.)" >&4
+ ;;
+ *) uidsign=$yyy
+ case "$uidsign" in
+ 1) echo "Your $zzz is unsigned." ;;
+ -1) echo "Your $zzz is signed." ;;
+ esac
+ ;;
+ esac
+else
+ uidsign=1
+ echo "(I can't compile the test program--guessing unsigned.)" >&4
+fi
+
+
: see if dbm.h is available
: see if dbmclose exists
set dbmclose d_dbmclose
@@ -13901,6 +13950,7 @@ pg='$pg'
phostname='$phostname'
pidtype='$pidtype'
plibpth='$plibpth'
+pm_apiversion='$pm_apiversion'
pmake='$pmake'
pr='$pr'
prefix='$prefix'
@@ -13994,6 +14044,7 @@ touch='$touch'
tr='$tr'
trnl='$trnl'
troff='$troff'
+uidsign='$uidsign'
uidtype='$uidtype'
uname='$uname'
uniq='$uniq'
@@ -14024,6 +14075,7 @@ version='$version'
vi='$vi'
voidflags='$voidflags'
xlibpth='$xlibpth'
+xs_apiversion='$xs_apiversion'
zcat='$zcat'
zip='$zip'
EOT
diff --git a/MANIFEST b/MANIFEST
index 4ac1ba4def..94ab980612 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -91,7 +91,7 @@ eg/cgi/cookie.cgi CGI example
eg/cgi/crash.cgi CGI example
eg/cgi/customize.cgi CGI example
eg/cgi/diff_upload.cgi CGI example
-eg/cgi/dna.small.gif.uu Small image for CGI examples
+eg/cgi/dna_small_gif.uu Small image for CGI examples
eg/cgi/file_upload.cgi CGI example
eg/cgi/frameset.cgi CGI example
eg/cgi/index.html Index page for CGI examples
@@ -104,7 +104,7 @@ eg/cgi/nph-multipart.cgi CGI example
eg/cgi/popup.cgi CGI example
eg/cgi/save_state.cgi CGI example
eg/cgi/tryit.cgi CGI example
-eg/cgi/wilogo.gif.uu Small image for CGI examples
+eg/cgi/wilogo_gif.uu Small image for CGI examples
eg/changes A program to list recently changed files
eg/client A sample client
eg/down A program to do things to subdirectories
diff --git a/Porting/Glossary b/Porting/Glossary
index 46fb810f0a..4f97fab701 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -2560,6 +2560,21 @@ plibpth (libpth.U):
Its value is prepend to libpth. This variable takes care of special
machines, like the mips. Usually, it should be empty.
+pm_apiversion (xs_apiversion.U):
+ This variable contains the version of the oldest perl
+ compatible with the present perl. (That is, pure perl modules
+ written for $pm_apiversion will still work for the current
+ version). perl.c:incpush() and lib/lib.pm will automatically
+ search in $sitelib for older directories across major versions
+ back to pm_apiversion. This is only useful if you have a perl
+ library directory tree structured like the default one. The
+ versioned site_perl library was introduced in 5.005, so that's
+ the default setting for this variable. It's hard to imagine
+ it changing before Perl6. It is included here for symmetry
+ with xs_apiveprsion -- the searching algorithms will
+ (presumably) be similar.
+ See the INSTALL file for how this works.
+
pmake (Loc.U):
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
@@ -3010,6 +3025,10 @@ troff (Loc.U):
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
+uidsign (uidsign.U):
+ This variable contains the signedness of a uidtype.
+ 1 for unsigned, -1 for signed.
+
uidtype (uidtype.U):
This variable defines Uid_t to be something like uid_t, int,
ushort, or whatever type is used to declare user ids in the kernel.
@@ -3158,6 +3177,23 @@ xlibpth (libpth.U):
libraries on this platform, for example CPU-specific libraries
(on multi-CPU platforms) may be listed here.
+xs_apiversion (xs_apiversion.U):
+ This variable contains the version of the oldest perl binary
+ compatible with the present perl. perl.c:incpush() and
+ lib/lib.pm will automatically search in $sitearch for older
+ directories across major versions back to xs_apiversion.
+ This is only useful if you have a perl library directory tree
+ structured like the default one.
+ See INSTALL for how this works.
+ The versioned site_perl directory was introduced in 5.005,
+ so that is the lowest possible value.
+ Since this can depend on compile time options (such as
+ bincompat) it is set by Configure. Other non-default sources
+ of potential incompatibility, such as multiplicity, threads,
+ debugging, 64bits, sfio, etc., are not checked for currently,
+ though in principle we could go snooping around in old
+ Config.pm files.
+
zcat (Loc.U):
This variable is defined but not used by Configure.
The value is a plain '' and is not useful.
diff --git a/Porting/config.sh b/Porting/config.sh
index af71eadd3c..b156c87348 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -8,7 +8,7 @@
# Package name : perl5
# Source directory : .
-# Configuration time: Thu Sep 30 19:44:33 EET DST 1999
+# Configuration time: Sun Oct 3 02:17:38 EET DST 1999
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
@@ -30,7 +30,7 @@ afs='false'
alignbytes='8'
ansi2knr=''
aphostname=''
-apiversion=''
+apiversion='5.00561'
ar='ar'
archlib='/opt/perl/lib/5.00561/alpha-dec_osf-thread'
archlibexp='/opt/perl/lib/5.00561/alpha-dec_osf-thread'
@@ -56,7 +56,7 @@ ccflags='-pthread -std -DLANGUAGE_C'
ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Thu Sep 30 19:44:33 EET DST 1999'
+cf_time='Sun Oct 3 02:17:38 EET DST 1999'
chgrp=''
chmod=''
chown=''
@@ -478,7 +478,7 @@ installprefix='/opt/perl'
installprefixexp='/opt/perl'
installprivlib='/opt/perl/lib/5.00561'
installscript='/opt/perl/bin'
-installsitearch='/opt/perl/lib/site_perl//alpha-dec_osf-thread'
+installsitearch='/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread'
installsitelib='/opt/perl/lib/site_perl'
installstyle='lib'
installusrbinperl='define'
@@ -569,6 +569,7 @@ pg='pg'
phostname=''
pidtype='pid_t'
plibpth=''
+pm_apiversion='5.005'
pmake=''
pr=''
prefix='/opt/perl'
@@ -618,8 +619,8 @@ sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE"
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 6 6 16 20 23 23 23 29 48 '
sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 6, 6, 16, 20, 23, 23, 23, 29, 48, 0'
signal_t='void'
-sitearch='/opt/perl/lib/site_perl//alpha-dec_osf-thread'
-sitearchexp='/opt/perl/lib/site_perl//alpha-dec_osf-thread'
+sitearch='/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread'
+sitearchexp='/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread'
sitelib='/opt/perl/lib/site_perl'
sitelibexp='/opt/perl/lib/site_perl'
siteprefix='/opt/perl'
@@ -662,6 +663,7 @@ touch='touch'
tr='tr'
trnl='\n'
troff=''
+uidsign='1'
uidtype='uid_t'
uname='uname'
uniq='uniq'
@@ -692,6 +694,7 @@ version='5.00561'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
+xs_apiversion='5.00561'
zcat=''
zip='zip'
# Configure command line arguments.
@@ -712,6 +715,7 @@ config_arg11='-dE'
PERL_REVISION=5
PERL_VERSION=5
PERL_SUBVERSION=61
+PERL_APIVERSION=5.00561
CONFIGDOTSH=true
# Variables propagated from previous config.sh file.
pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
diff --git a/Porting/config_H b/Porting/config_H
index d099550d2b..3321c5a029 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Thu Sep 30 19:44:33 EET DST 1999
+ * Configuration time: Sun Oct 3 02:17:38 EET DST 1999
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
@@ -1469,8 +1469,8 @@
* This symbol contains the ~name expanded version of SITEARCH, to be used
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define SITEARCH "/opt/perl/lib/site_perl//alpha-dec_osf-thread" /**/
-#define SITEARCH_EXP "/opt/perl/lib/site_perl//alpha-dec_osf-thread" /**/
+#define SITEARCH "/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread" /**/
+#define SITEARCH_EXP "/opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread" /**/
/* SITELIB:
* This symbol contains the name of the private library for this package.
@@ -2493,6 +2493,41 @@
*/
/*#define USE_SOCKS / **/
+/* PERL_XS_APIVERSION:
+ * This variable contains the version of the oldest perl binary
+ * compatible with the present perl. perl.c:incpush() and
+ * lib/lib.pm will automatically search in /opt/perl/lib/site_perl/5.00561/alpha-dec_osf-thread for older
+ * directories across major versions back to xs_apiversion.
+ * This is only useful if you have a perl library directory tree
+ * structured like the default one.
+ * See INSTALL for how this works.
+ * The versioned site_perl directory was introduced in 5.005,
+ * so that is the lowest possible value.
+ * Since this can depend on compile time options (such as
+ * bincompat) it is set by Configure. Other non-default sources
+ * of potential incompatibility, such as multiplicity, threads,
+ * debugging, 64bits, sfio, etc., are not checked for currently,
+ * though in principle we could go snooping around in old
+ * Config.pm files.
+ */
+/* PERL_PM_APIVERSION:
+ * This variable contains the version of the oldest perl
+ * compatible with the present perl. (That is, pure perl modules
+ * written for pm_apiversion will still work for the current
+ * version). perl.c:incpush() and lib/lib.pm will automatically
+ * search in /opt/perl/lib/site_perl for older directories across major versions
+ * back to pm_apiversion. This is only useful if you have a perl
+ * library directory tree structured like the default one. The
+ * versioned site_perl library was introduced in 5.005, so that's
+ * the default setting for this variable. It's hard to imagine
+ * it changing before Perl6. It is included here for symmetry
+ * with xs_apiveprsion -- the searching algorithms will
+ * (presumably) be similar.
+ * See the INSTALL file for how this works.
+ */
+#define PERL_XS_APIVERSION 5.00561 /* Change to string for tuples?*/
+#define PERL_PM_APIVERSION 5.005 /* Change to string for tuples?*/
+
/* HAS_DRAND48_PROTO:
* This symbol, if defined, indicates that the system provides
* a prototype for the drand48() function. Otherwise, it is up
@@ -2686,6 +2721,12 @@
*/
#define Size_t size_t /* length paramater for string functions */
+/* Uid_t_SIGN:
+ * This symbol holds the signedess of a Uid_t.
+ * 1 for unsigned, -1 for signed.
+ */
+#define Uid_t_SIGN 1 /* UID sign */
+
/* Uid_t:
* This symbol holds the type used to declare user ids in the kernel.
* It can be int, ushort, uid_t, etc... It may be necessary to include
diff --git a/av.c b/av.c
index 7201b49d8f..8f3b4f8bda 100644
--- a/av.c
+++ b/av.c
@@ -630,10 +630,11 @@ Perl_avhv_fetch_ent(pTHX_ AV *av, SV *keysv, I32 lval, U32 hash)
SV **indsvp;
HV *keys = avhv_keys(av);
HE *he;
-
+ STRLEN n_a;
+
he = hv_fetch_ent(keys, keysv, FALSE, hash);
if (!he)
- Perl_croak(aTHX_ "No such array field");
+ Perl_croak(aTHX_ "No such pseudo-hash field \"%s\"", SvPV(keysv,n_a));
return av_fetch(av, avhv_index_sv(HeVAL(he)), lval);
}
diff --git a/config_h.SH b/config_h.SH
index 5aa68c27be..3aa55fda2a 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -2507,6 +2507,41 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$usesocks USE_SOCKS /**/
+/* PERL_XS_APIVERSION:
+ * This variable contains the version of the oldest perl binary
+ * compatible with the present perl. perl.c:incpush() and
+ * lib/lib.pm will automatically search in $sitearch for older
+ * directories across major versions back to xs_apiversion.
+ * This is only useful if you have a perl library directory tree
+ * structured like the default one.
+ * See INSTALL for how this works.
+ * The versioned site_perl directory was introduced in 5.005,
+ * so that is the lowest possible value.
+ * Since this can depend on compile time options (such as
+ * bincompat) it is set by Configure. Other non-default sources
+ * of potential incompatibility, such as multiplicity, threads,
+ * debugging, 64bits, sfio, etc., are not checked for currently,
+ * though in principle we could go snooping around in old
+ * Config.pm files.
+ */
+/* PERL_PM_APIVERSION:
+ * This variable contains the version of the oldest perl
+ * compatible with the present perl. (That is, pure perl modules
+ * written for pm_apiversion will still work for the current
+ * version). perl.c:incpush() and lib/lib.pm will automatically
+ * search in $sitelib for older directories across major versions
+ * back to pm_apiversion. This is only useful if you have a perl
+ * library directory tree structured like the default one. The
+ * versioned site_perl library was introduced in 5.005, so that's
+ * the default setting for this variable. It's hard to imagine
+ * it changing before Perl6. It is included here for symmetry
+ * with xs_apiveprsion -- the searching algorithms will
+ * (presumably) be similar.
+ * See the INSTALL file for how this works.
+ */
+#define PERL_XS_APIVERSION $xs_apiversion /* Change to string for tuples?*/
+#define PERL_PM_APIVERSION $pm_apiversion /* Change to string for tuples?*/
+
/* HAS_DRAND48_PROTO:
* This symbol, if defined, indicates that the system provides
* a prototype for the drand48() function. Otherwise, it is up
@@ -2700,6 +2735,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#define Size_t $sizetype /* length paramater for string functions */
+/* Uid_t_SIGN:
+ * This symbol holds the signedess of a Uid_t.
+ * 1 for unsigned, -1 for signed.
+ */
+#define Uid_t_SIGN $uidsign /* UID sign */
+
/* Uid_t:
* This symbol holds the type used to declare user ids in the kernel.
* It can be int, ushort, uid_t, etc... It may be necessary to include
diff --git a/doio.c b/doio.c
index 1b59c37a45..bf961f0c07 100644
--- a/doio.c
+++ b/doio.c
@@ -1013,17 +1013,10 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
if (SvIOK(sv)) {
if (SvGMAGICAL(sv))
mg_get(sv);
-#ifdef IV_IS_QUAD
if (SvIsUV(sv))
- PerlIO_printf(fp, "%" PERL_PRIu64, (UV)SvUVX(sv));
+ PerlIO_printf(fp, "%"UVuf, (UV)SvUVX(sv));
else
- PerlIO_printf(fp, "%" PERL_PRId64, (IV)SvIVX(sv));
-#else
- if (SvIsUV(sv))
- PerlIO_printf(fp, "%lu", (unsigned long)SvUVX(sv));
- else
- PerlIO_printf(fp, "%ld", (long)SvIVX(sv));
-#endif
+ PerlIO_printf(fp, "%"IVdf, (IV)SvIVX(sv));
return !PerlIO_error(fp);
}
/* FALL THROUGH */
diff --git a/dump.c b/dump.c
index 7f1dba499c..b64248acf9 100644
--- a/dump.c
+++ b/dump.c
@@ -283,18 +283,11 @@ Perl_sv_peek(pTHX_ SV *sv)
Perl_sv_catpvf(aTHX_ t, "(%g)",SvNVX(sv));
RESTORE_NUMERIC_LOCAL();
}
- else if (SvIOKp(sv)) { /* XXXX: IV, UV? */
-#ifdef IV_IS_QUAD
+ else if (SvIOKp(sv)) {
if (SvIsUV(sv))
- Perl_sv_catpvf(aTHX_ t, "(%" PERL_PRIu64 ")",(UV)SvUVX(sv));
+ Perl_sv_catpvf(aTHX_ t, "(%"UVuf")", (UV)SvUVX(sv));
else
- Perl_sv_catpvf(aTHX_ t, "(%" PERL_PRId64 ")",(IV)SvIVX(sv));
-#else
- if (SvIsUV(sv))
- Perl_sv_catpvf(aTHX_ t, "(%lu)",(unsigned long)SvUVX(sv));
- else
- Perl_sv_catpvf(aTHX_ t, "(%ld)",(long)SvIVX(sv));
-#endif
+ Perl_sv_catpvf(aTHX_ t, "(%"IVdf")", (IV)SvIVX(sv));
}
else
sv_catpv(t, "()");
@@ -400,11 +393,7 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
Perl_dump_indent(aTHX_ level, file, "TARG = %d\n", o->op_targ);
}
#ifdef DUMPADDR
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%" PERL_PRIx64 " => 0x%" PERL_PRIx64 "\n", (IV)o, (IV)o->op_next);
-#else
- Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%lx => 0x%lx\n", (long)o, (long)o->op_next);
-#endif
+ Perl_dump_indent(aTHX_ level, file, "ADDR = 0x%"UVxf" => 0x%"UVxf"\n", (UV)o, (UV)o->op_next);
#endif
if (o->op_flags) {
SV *tmpsv = newSVpvn("", 0);
@@ -765,19 +754,11 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
flags = SvFLAGS(sv);
type = SvTYPE(sv);
-#ifdef IV_IS_QUAD
Perl_sv_setpvf(aTHX_ d,
- "(0x%" PERL_PRIx64") at 0x%" PERL_PRIx64 "\n%*s REFCNT = %" PERL_PRId64 "\n%*s FLAGS = (",
+ "(0x%"UVxf") at 0x%"UVxf"\n%*s REFCNT = %"IVdf"\n%*s FLAGS = (",
PTR2UV(SvANY(sv)), PTR2UV(sv),
PL_dumpindent*level, "", (IV)SvREFCNT(sv),
PL_dumpindent*level, "");
-#else
- Perl_sv_setpvf(aTHX_ d,
- "(0x%lx) at 0x%lx\n%*s REFCNT = %ld\n%*s FLAGS = (",
- (unsigned long)SvANY(sv), (unsigned long)sv,
- PL_dumpindent*level, "", (long)SvREFCNT(sv),
- PL_dumpindent*level, "");
-#endif
if (flags & SVs_PADBUSY) sv_catpv(d, "PADBUSY,");
if (flags & SVs_PADTMP) sv_catpv(d, "PADTMP,");
@@ -907,23 +888,17 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
return;
}
if (type >= SVt_PVIV || type == SVt_IV) {
-#ifdef IV_IS_QUAD
if (SvIsUV(sv))
- Perl_dump_indent(aTHX_ level, file, " UV = %" PERL_PRIu64, (UV)SvUVX(sv));
+ Perl_dump_indent(aTHX_ level, file, " UV = %"UVuf, (UV)SvUVX(sv));
else
- Perl_dump_indent(aTHX_ level, file, " IV = %" PERL_PRId64, (IV)SvIVX(sv));
-#else
- if (SvIsUV(sv))
- Perl_dump_indent(aTHX_ level, file, " UV = %lu", (unsigned long)SvUVX(sv));
- else
- Perl_dump_indent(aTHX_ level, file, " IV = %ld", (long)SvIVX(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " IV = %"IVdf, (IV)SvIVX(sv));
if (SvOOK(sv))
PerlIO_printf(file, " (OFFSET)");
PerlIO_putc(file, '\n');
}
if (type >= SVt_PVNV || type == SVt_NV) {
RESTORE_NUMERIC_STANDARD();
+ /* %Vg doesn't work? --jhi */
#ifdef USE_LONG_DOUBLE
Perl_dump_indent(aTHX_ level, file, " NV = %.*" PERL_PRIgldbl "\n", LDBL_DIG, SvNVX(sv));
#else
@@ -932,11 +907,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
RESTORE_NUMERIC_LOCAL();
}
if (SvROK(sv)) {
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " RV = 0x%" PERL_PRIx64 "\n", PTR2IV(SvRV(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " RV = 0x%lx\n", (long)SvRV(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " RV = 0x%"UVxf"\n", PTR2UV(SvRV(sv)));
if (nest < maxnest)
do_sv_dump(level+1, file, SvRV(sv), nest+1, maxnest, dumpops, pvlim);
return;
@@ -945,21 +916,12 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
return;
if (type <= SVt_PVLV) {
if (SvPVX(sv)) {
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file," PV = 0x%" PERL_PRIx64 " ", PTR2IV(SvPVX(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file," PV = 0x%lx ", (long)SvPVX(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file," PV = 0x%"UVxf" ", PTR2UV(SvPVX(sv)));
if (SvOOK(sv))
PerlIO_printf(file, "( %s . ) ", pv_display(d, SvPVX(sv)-SvIVX(sv), SvIVX(sv), 0, pvlim));
PerlIO_printf(file, "%s\n", pv_display(d, SvPVX(sv), SvCUR(sv), SvLEN(sv), pvlim));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " CUR = %" PERL_PRId64 "\n", (IV)SvCUR(sv));
- Perl_dump_indent(aTHX_ level, file, " LEN = %" PERL_PRId64 "\n", (IV)SvLEN(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " CUR = %ld\n", (long)SvCUR(sv));
- Perl_dump_indent(aTHX_ level, file, " LEN = %ld\n", (long)SvLEN(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " CUR = %"IVdf"\n", (IV)SvCUR(sv));
+ Perl_dump_indent(aTHX_ level, file, " LEN = %"IVdf"\n", (IV)SvLEN(sv));
}
else
Perl_dump_indent(aTHX_ level, file, " PV = 0\n");
@@ -973,43 +935,23 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
switch (type) {
case SVt_PVLV:
Perl_dump_indent(aTHX_ level, file, " TYPE = %c\n", LvTYPE(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " TARGOFF = %" PERL_PRId64 "\n", (IV)LvTARGOFF(sv));
- Perl_dump_indent(aTHX_ level, file, " TARGLEN = %" PERL_PRId64 "\n", (IV)LvTARGLEN(sv));
- Perl_dump_indent(aTHX_ level, file, " TARG = 0x%" PERL_PRIx64 "\n", PTR2IV(LvTARG(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " TARGOFF = %ld\n", (long)LvTARGOFF(sv));
- Perl_dump_indent(aTHX_ level, file, " TARGLEN = %ld\n", (long)LvTARGLEN(sv));
- Perl_dump_indent(aTHX_ level, file, " TARG = 0x%lx\n", (long)LvTARG(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " TARGOFF = %"IVdf"\n", (IV)LvTARGOFF(sv));
+ Perl_dump_indent(aTHX_ level, file, " TARGLEN = %"IVdf"\n", (IV)LvTARGLEN(sv));
+ Perl_dump_indent(aTHX_ level, file, " TARG = 0x%"UVxf"\n", PTR2UV(LvTARG(sv)));
/* XXX level+1 ??? */
do_sv_dump(level, file, LvTARG(sv), nest+1, maxnest, dumpops, pvlim);
break;
case SVt_PVAV:
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%" PERL_PRIx64 , PTR2IV(AvARRAY(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%lx", (long)AvARRAY(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(AvARRAY(sv)));
if (AvARRAY(sv) != AvALLOC(sv)) {
- PerlIO_printf(file, " (offset=%d)\n", (AvARRAY(sv) - AvALLOC(sv)));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%" PERL_PRIx64 "\n", PTR2IV(AvALLOC(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%lx\n", (long)AvALLOC(sv));
-#endif
+ PerlIO_printf(file, " (offset=%"IVdf")\n", (IV)(AvARRAY(sv) - AvALLOC(sv)));
+ Perl_dump_indent(aTHX_ level, file, " ALLOC = 0x%"UVxf"\n", PTR2UV(AvALLOC(sv)));
}
else
PerlIO_putc(file, '\n');
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " FILL = %" PERL_PRId64 "\n", (IV)AvFILLp(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %" PERL_PRId64 "\n", (IV)AvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%" PERL_PRIx64 "\n", PTR2IV(AvARYLEN(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " FILL = %ld\n", (long)AvFILLp(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %ld\n", (long)AvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%lx\n", (long)AvARYLEN(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)AvFILLp(sv));
+ Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)AvMAX(sv));
+ Perl_dump_indent(aTHX_ level, file, " ARYLEN = 0x%"UVxf"\n", PTR2UV(AvARYLEN(sv)));
flags = AvFLAGS(sv);
sv_setpv(d, "");
if (flags & AVf_REAL) sv_catpv(d, ",REAL");
@@ -1021,22 +963,14 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
for (count = 0; count <= av_len((AV*)sv) && count < maxnest; count++) {
SV** elt = av_fetch((AV*)sv,count,0);
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %" PERL_PRId64 "\n", (IV)count);
-#else
- Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %ld\n", (long)count);
-#endif
+ Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %"IVdf"\n", (IV)count);
if (elt)
do_sv_dump(level+1, file, *elt, nest+1, maxnest, dumpops, pvlim);
}
}
break;
case SVt_PVHV:
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%" PERL_PRIx64,PTR2IV(HvARRAY(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%lx",(long)HvARRAY(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " ARRAY = 0x%"UVxf, PTR2UV(HvARRAY(sv)));
if (HvARRAY(sv) && HvKEYS(sv)) {
/* Show distribution of HEs in the ARRAY */
int freq[200];
@@ -1081,25 +1015,13 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
Perl_dump_indent(aTHX_ level, file, " hash quality = %.1f%%", theoret/sum*100);
}
PerlIO_putc(file, '\n');
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " KEYS = %" PERL_PRId64 "\n", (IV)HvKEYS(sv));
- Perl_dump_indent(aTHX_ level, file, " FILL = %" PERL_PRId64 "\n", (IV)HvFILL(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %" PERL_PRId64 "\n", (IV)HvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " RITER = %" PERL_PRId64 "\n", (IV)HvRITER(sv));
- Perl_dump_indent(aTHX_ level, file, " EITER = 0x%" PERL_PRIx64 "\n",PTR2IV(HvEITER(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " KEYS = %ld\n", (long)HvKEYS(sv));
- Perl_dump_indent(aTHX_ level, file, " FILL = %ld\n", (long)HvFILL(sv));
- Perl_dump_indent(aTHX_ level, file, " MAX = %ld\n", (long)HvMAX(sv));
- Perl_dump_indent(aTHX_ level, file, " RITER = %ld\n", (long)HvRITER(sv));
- Perl_dump_indent(aTHX_ level, file, " EITER = 0x%lx\n",(long) HvEITER(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " KEYS = %"IVdf"\n", (IV)HvKEYS(sv));
+ Perl_dump_indent(aTHX_ level, file, " FILL = %"IVdf"\n", (IV)HvFILL(sv));
+ Perl_dump_indent(aTHX_ level, file, " MAX = %"IVdf"\n", (IV)HvMAX(sv));
+ Perl_dump_indent(aTHX_ level, file, " RITER = %"IVdf"\n", (IV)HvRITER(sv));
+ Perl_dump_indent(aTHX_ level, file, " EITER = 0x%"UVxf"\n", PTR2UV(HvEITER(sv)));
if (HvPMROOT(sv))
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%" PERL_PRIx64 "\n",PTR2IV(HvPMROOT(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%lx\n",(long)HvPMROOT(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " PMROOT = 0x%"UVxf"\n", PTR2UV(HvPMROOT(sv)));
if (HvNAME(sv))
Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", HvNAME(sv));
if (nest < maxnest && !HvEITER(sv)) { /* Try to preserve iterator */
@@ -1116,11 +1038,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
key = hv_iterkey(he, &len);
elt = hv_iterval(hv, he);
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%" PERL_PRIx64 "\n", pv_display(d, key, len, 0, pvlim), hash);
-#else
- Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%lx\n", pv_display(d, key, len, 0, pvlim), hash);
-#endif
+ Perl_dump_indent(aTHX_ level+1, file, "Elt %s HASH = 0x%"UVxf"\n", pv_display(d, key, len, 0, pvlim), (UV)hash);
do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
}
hv_iterinit(hv); /* Return to status quo */
@@ -1133,54 +1051,23 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
case SVt_PVFM:
do_hv_dump(level, file, " COMP_STASH", CvSTASH(sv));
if (CvSTART(sv))
-#ifdef IV_IS_QAUD
- Perl_dump_indent(aTHX_ level, file, " START = 0x%" PERL_PRIx64 " ===> %d\n", (IV)CvSTART(sv), CvSTART(sv)->op_seq);
- Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%" PERL_PRIx64 "\n", (IV)CvROOT(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " START = 0x%lx ===> %d\n", (long)CvSTART(sv), CvSTART(sv)->op_seq);
- Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%lx\n", (long)CvROOT(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " START = 0x%"UVxf" ===> %"IVdf"\n", PTR2UV(CvSTART(sv)), (IV)CvSTART(sv)->op_seq);
+ Perl_dump_indent(aTHX_ level, file, " ROOT = 0x%"UVxf"\n", PTR2UV(CvROOT(sv)));
if (CvROOT(sv) && dumpops)
do_op_dump(level+1, file, CvROOT(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%" PERL_PRIx64 "\n", PTR2IV(CvXSUB(sv)));
- Perl_dump_indent(aTHX_ level, file, " XSUBANY = %" PERL_PRId64 "\n", (IV)CvXSUBANY(sv).any_i32);
-#else
- Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%lx\n", (long)CvXSUB(sv));
- Perl_dump_indent(aTHX_ level, file, " XSUBANY = %ld\n", (long)CvXSUBANY(sv).any_i32);
-#endif
+ Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
+ Perl_dump_indent(aTHX_ level, file, " XSUBANY = %"IVdf"\n", (IV)CvXSUBANY(sv).any_i32);
do_gvgv_dump(level, file, " GVGV::GV", CvGV(sv));
do_gv_dump(level, file, " FILEGV", CvFILEGV(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " DEPTH = %" PERL_PRId64 "\n", (IV)CvDEPTH(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " DEPTH = %ld\n", (long)CvDEPTH(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv));
#ifdef USE_THREADS
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%" PERL_PRIx64 "\n", (IV)CvMUTEXP(sv));
- Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%" PERL_PRIx64 "\n", (IV)CvOWNER(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%lx\n", (long)CvMUTEXP(sv));
- Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%lx\n", (long)CvOWNER(sv));
-#endif /* IV_IS_QUAD */
+ Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%"UVxf"\n", PTR2UV(CvMUTEXP(sv));
+ Perl_dump_indent(aTHX_ level, file, " OWNER = 0x%"UVxf"\n", PTR2UV(CvOWNER(sv));
#endif /* USE_THREADS */
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%" PERL_PRIx64 "\n", (UV)CvFLAGS(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%lx\n", (unsigned long)CvFLAGS(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", CvFLAGS(sv));
if (type == SVt_PVFM)
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " LINES = %" PERL_PRId64 "\n", (IV)FmLINES(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " LINES = %ld\n", (long)FmLINES(sv));
-#endif
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%" PERL_PRIx64 "\n", PTR2IV(CvPADLIST(sv)));
-#else
- Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%lx\n", (long)CvPADLIST(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)FmLINES(sv));
+ Perl_dump_indent(aTHX_ level, file, " PADLIST = 0x%"UVxf"\n", PTR2UV(CvPADLIST(sv)));
if (nest < maxnest && CvPADLIST(sv)) {
AV* padlist = CvPADLIST(sv);
AV* pad_name = (AV*)*av_fetch(padlist, 0, FALSE);
@@ -1190,107 +1077,58 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
I32 ix;
for (ix = 1; ix <= AvFILL(pad_name); ix++) {
-#ifdef IV_IS_QUAD
if (SvPOK(pname[ix]))
- Perl_dump_indent(aTHX_ level, /* %5d below is enough whitespace. */
+ Perl_dump_indent(aTHX_ level,
+ /* %5d below is enough whitespace. */
file,
- "%5d. 0x%" PERL_PRIx64 " (%s\"%s\" %" PERL_PRId64 "-%" PERL_PRId64 ")\n",
- ix, ppad[ix],
+ "%5d. 0x%"UVxf" (%s\"%s\" %"IVdf"-%"IVdf")\n",
+ ix, PTR2UV(ppad[ix]),
SvFAKE(pname[ix]) ? "FAKE " : "",
SvPVX(pname[ix]),
(IV)SvNVX(pname[ix]),
(IV)SvIVX(pname[ix]));
-#else
- if (SvPOK(pname[ix]))
- Perl_dump_indent(aTHX_ level, /* %5d below is enough whitespace. */
- file,
- "%5d. 0x%lx (%s\"%s\" %ld-%ld)\n",
- ix, ppad[ix],
- SvFAKE(pname[ix]) ? "FAKE " : "",
- SvPVX(pname[ix]),
- (long)I_32(SvNVX(pname[ix])),
- (long)SvIVX(pname[ix]));
-#endif
}
}
{
CV *outside = CvOUTSIDE(sv);
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%" PERL_PRIx64 " (%s)\n",
- PTR2IV(outside),
+ Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%"UVxf" (%s)\n",
+ PTR2UV(outside),
(!outside ? "null"
: CvANON(outside) ? "ANON"
: (outside == PL_main_cv) ? "MAIN"
: CvUNIQUE(outside) ? "UNIQUE"
: CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
-#else
- Perl_dump_indent(aTHX_ level, file, " OUTSIDE = 0x%lx (%s)\n",
- (long)outside,
- (!outside ? "null"
- : CvANON(outside) ? "ANON"
- : (outside == PL_main_cv) ? "MAIN"
- : CvUNIQUE(outside) ? "UNIQUE"
- : CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
-#endif
}
if (nest < maxnest && (CvCLONE(sv) || CvCLONED(sv)))
do_sv_dump(level+1, file, (SV*)CvOUTSIDE(sv), nest+1, maxnest, dumpops, pvlim);
break;
case SVt_PVGV:
Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", GvNAME(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " NAMELEN = %" PERL_PRId64 "\n", (IV)GvNAMELEN(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " NAMELEN = %ld\n", (long)GvNAMELEN(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " NAMELEN = %"IVdf"\n", (IV)GvNAMELEN(sv));
do_hv_dump (level, file, " GvSTASH", GvSTASH(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " GP = 0x%" PERL_PRIx64 "\n", PTR2IV(GvGP(sv)));
- Perl_dump_indent(aTHX_ level, file, " SV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvSV(sv)));
- Perl_dump_indent(aTHX_ level, file, " REFCNT = %" PERL_PRId64 "\n", (IV)GvREFCNT(sv));
- Perl_dump_indent(aTHX_ level, file, " IO = 0x%" PERL_PRIx64 "\n", PTR2IV(GvIOp(sv)));
- Perl_dump_indent(aTHX_ level, file, " FORM = 0x%" PERL_PRIx64 " \n", PTR2IV(GvFORM(sv)));
- Perl_dump_indent(aTHX_ level, file, " AV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvAV(sv)));
- Perl_dump_indent(aTHX_ level, file, " HV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvHV(sv)));
- Perl_dump_indent(aTHX_ level, file, " CV = 0x%" PERL_PRIx64 "\n", PTR2IV(GvCV(sv)));
- Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%" PERL_PRIx64 "\n", (IV)GvCVGEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LASTEXPR = %" PERL_PRId64 "\n", (IV)GvLASTEXPR(sv));
- Perl_dump_indent(aTHX_ level, file, " LINE = %" PERL_PRId64 "\n", (IV)GvLINE(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " GP = 0x%lx\n", (long)GvGP(sv));
- Perl_dump_indent(aTHX_ level, file, " SV = 0x%lx\n", (long)GvSV(sv));
- Perl_dump_indent(aTHX_ level, file, " REFCNT = %ld\n", (long)GvREFCNT(sv));
- Perl_dump_indent(aTHX_ level, file, " IO = 0x%lx\n", (long)GvIOp(sv));
- Perl_dump_indent(aTHX_ level, file, " FORM = 0x%lx\n", (long)GvFORM(sv));
- Perl_dump_indent(aTHX_ level, file, " AV = 0x%lx\n", (long)GvAV(sv));
- Perl_dump_indent(aTHX_ level, file, " HV = 0x%lx\n", (long)GvHV(sv));
- Perl_dump_indent(aTHX_ level, file, " CV = 0x%lx\n", (long)GvCV(sv));
- Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%lx\n", (long)GvCVGEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LASTEXPR = %ld\n", (long)GvLASTEXPR(sv));
- Perl_dump_indent(aTHX_ level, file, " LINE = %ld\n", (long)GvLINE(sv));
-#endif
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%x\n", (int)GvFLAGS(sv));
+ Perl_dump_indent(aTHX_ level, file, " GP = 0x%"UVxf"\n", PTR2UV(GvGP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " SV = 0x%"UVxf"\n", PTR2UV(GvSV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " REFCNT = %"IVdf"\n", (IV)GvREFCNT(sv));
+ Perl_dump_indent(aTHX_ level, file, " IO = 0x%"UVxf"\n", PTR2UV(GvIOp(sv)));
+ Perl_dump_indent(aTHX_ level, file, " FORM = 0x%"UVxf" \n", PTR2UV(GvFORM(sv)));
+ Perl_dump_indent(aTHX_ level, file, " AV = 0x%"UVxf"\n", PTR2UV(GvAV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " HV = 0x%"UVxf"\n", PTR2UV(GvHV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " CV = 0x%"UVxf"\n", PTR2UV(GvCV(sv)));
+ Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%"UVxf"\n", (UV)GvCVGEN(sv));
+ Perl_dump_indent(aTHX_ level, file, " LASTEXPR = %"IVdf"\n", (IV)GvLASTEXPR(sv));
+ Perl_dump_indent(aTHX_ level, file, " LINE = %"IVdf"\n", (IV)GvLINE(sv));
+ Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)GvFLAGS(sv));
do_gv_dump (level, file, " FILEGV", GvFILEGV(sv));
do_gv_dump (level, file, " EGV", GvEGV(sv));
break;
case SVt_PVIO:
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " IFP = 0x%" PERL_PRIx64 "\n", PTR2IV(IoIFP(sv)));
- Perl_dump_indent(aTHX_ level, file, " OFP = 0x%" PERL_PRIx64 "\n", PTR2IV(IoOFP(sv)));
- Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%" PERL_PRIx64 "\n", PTR2IV(IoDIRP(sv)));
- Perl_dump_indent(aTHX_ level, file, " LINES = %" PERL_PRId64 "\n", (IV)IoLINES(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE = %" PERL_PRId64 "\n", (IV)IoPAGE(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %" PERL_PRId64 "\n", (IV)IoPAGE_LEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %" PERL_PRId64 "\n", (IV)IoLINES_LEFT(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " IFP = 0x%lx\n", (long)IoIFP(sv));
- Perl_dump_indent(aTHX_ level, file, " OFP = 0x%lx\n", (long)IoOFP(sv));
- Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%lx\n", (long)IoDIRP(sv));
- Perl_dump_indent(aTHX_ level, file, " LINES = %ld\n", (long)IoLINES(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE = %ld\n", (long)IoPAGE(sv));
- Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %ld\n", (long)IoPAGE_LEN(sv));
- Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %ld\n", (long)IoLINES_LEFT(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " IFP = 0x%"UVxf"\n", PTR2UV(IoIFP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " OFP = 0x%"UVxf"\n", PTR2UV(IoOFP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " DIRP = 0x%"UVxf"\n", PTR2UV(IoDIRP(sv)));
+ Perl_dump_indent(aTHX_ level, file, " LINES = %"IVdf"\n", (IV)IoLINES(sv));
+ Perl_dump_indent(aTHX_ level, file, " PAGE = %"IVdf"\n", (IV)IoPAGE(sv));
+ Perl_dump_indent(aTHX_ level, file, " PAGE_LEN = %"IVdf"\n", (IV)IoPAGE_LEN(sv));
+ Perl_dump_indent(aTHX_ level, file, " LINES_LEFT = %"IVdf"\n", (IV)IoLINES_LEFT(sv));
if (IoTOP_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " TOP_NAME = \"%s\"\n", IoTOP_NAME(sv));
do_gv_dump (level, file, " TOP_GV", IoTOP_GV(sv));
@@ -1300,20 +1138,12 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
if (IoBOTTOM_NAME(sv))
Perl_dump_indent(aTHX_ level, file, " BOTTOM_NAME = \"%s\"\n", IoBOTTOM_NAME(sv));
do_gv_dump (level, file, " BOTTOM_GV", IoBOTTOM_GV(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %" PERL_PRId64 "\n", (IV)IoSUBPROCESS(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %ld\n", (long)IoSUBPROCESS(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " SUBPROCESS = %"IVdf"\n", (IV)IoSUBPROCESS(sv));
if (isPRINT(IoTYPE(sv)))
Perl_dump_indent(aTHX_ level, file, " TYPE = '%c'\n", IoTYPE(sv));
else
Perl_dump_indent(aTHX_ level, file, " TYPE = '\\%o'\n", IoTYPE(sv));
-#ifdef IV_IS_QUAD
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%" PERL_PRIx64 "\n", (IV)IoFLAGS(sv));
-#else
- Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%lx\n", (long)IoFLAGS(sv));
-#endif
+ Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)IoFLAGS(sv));
break;
}
}
diff --git a/eg/cgi/dna.small.gif.uu b/eg/cgi/dna_small_gif.uu
index d3ce24c18d..1745c73761 100644
--- a/eg/cgi/dna.small.gif.uu
+++ b/eg/cgi/dna_small_gif.uu
@@ -1,4 +1,4 @@
-begin 444 dna.small.gif
+begin 444 dna_small.gif
M1TE&.#=A)0`J`.<``+9%&Y<R0M<F'ID\,!<07%<G1:P<0Q`A2Q`P;"L9/L$:
M,"480N5"&RL7:4LD0T,G144[7BHL2B4?3\0I+"</)BQ.9KD0/S878\96$Z\@
M(:\1*RL:3L0W&QL?2#4?9>@_&A$_5<I"&C`A3*,3-A`//9X<)\@Q(L`@.#\E
diff --git a/eg/cgi/wilogo.gif.uu b/eg/cgi/wilogo_gif.uu
index c5d10423b4..c5d10423b4 100644
--- a/eg/cgi/wilogo.gif.uu
+++ b/eg/cgi/wilogo_gif.uu
diff --git a/ext/B/defsubs_h.PL b/ext/B/defsubs_h.PL
index 78c82f20bd..dc4275beae 100644
--- a/ext/B/defsubs_h.PL
+++ b/ext/B/defsubs_h.PL
@@ -3,7 +3,6 @@
# Extracting defsubs.h (with variable substitutions)
#!perl
my ($out) = __FILE__ =~ /(^.*)\.PL/;
-if ($^O eq 'VMS') { ($out) = __FILE__ =~ /^(.+)_PL$/i; }
$out =~ s/_h$/.h/;
open(OUT,">$out") || die "Cannot open $file:$!";
print "Extracting $out...\n";
diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm
index a7debd73ee..91966735df 100644
--- a/lib/Benchmark.pm
+++ b/lib/Benchmark.pm
@@ -99,34 +99,6 @@ if you use the Benchmark module:
=over 10
-=item cmpthese ( COUT, CODEHASHREF, [ STYLE ] )
-
-=item cmpthese ( RESULTSHASHREF )
-
-Optionally calls timethese(), then outputs comparison chart. This
-chart is sorted from slowest to highest, and shows the percent
-speed difference between each pair of tests. Can also be passed
-the data structure that timethese() returns:
-
- $results = timethese( .... );
- cmpthese( $results );
-
-Returns the data structure returned by timethese().
-
-=item countit(TIME, CODE)
-
-Arguments: TIME is the minimum length of time to run CODE for, and CODE is
-the code to run. CODE may be either a code reference or a string to
-be eval'd; either way it will be run in the caller's package.
-
-TIME is I<not> negative. countit() will run the loop many times to
-calculate the speed of CODE before running it for TIME. The actual
-time run for will usually be greater than TIME due to system clock
-resolution, so it's best to look at the number of iterations divided
-by the times that you are concerned with, not just the iterations.
-
-Returns: a Benchmark object.
-
=item timeit(COUNT, CODE)
Arguments: COUNT is the number of times to run the loop, and CODE is
@@ -187,11 +159,6 @@ Returns a hash of Benchmark objects, keyed by name.
Returns the difference between two Benchmark times as a Benchmark
object suitable for passing to timestr().
-=item timesum ( T1, T2 )
-
-Returns the sum of two Benchmark times as a Benchmark object suitable
-for passing to timestr().
-
=item timestr ( TIMEDIFF, [ STYLE, [ FORMAT ] ] )
Returns a string that formats the times in the TIMEDIFF object in
@@ -226,6 +193,34 @@ Clear the cached time for COUNT rounds of the null loop.
Clear all cached times.
+=item cmpthese ( COUT, CODEHASHREF, [ STYLE ] )
+
+=item cmpthese ( RESULTSHASHREF )
+
+Optionally calls timethese(), then outputs comparison chart. This
+chart is sorted from slowest to fastest, and shows the percent
+speed difference between each pair of tests. Can also be passed
+the data structure that timethese() returns:
+
+ $results = timethese( .... );
+ cmpthese( $results );
+
+Returns the data structure returned by timethese() (or passed in).
+
+=item countit(TIME, CODE)
+
+Arguments: TIME is the minimum length of time to run CODE for, and CODE is
+the code to run. CODE may be either a code reference or a string to
+be eval'd; either way it will be run in the caller's package.
+
+TIME is I<not> negative. countit() will run the loop many times to
+calculate the speed of CODE before running it for TIME. The actual
+time run for will usually be greater than TIME due to system clock
+resolution, so it's best to look at the number of iterations divided
+by the times that you are concerned with, not just the iterations.
+
+Returns: a Benchmark object.
+
=item disablecache ( )
Disable caching of timings for the null loop. This will force Benchmark
@@ -237,6 +232,11 @@ Enable caching of timings for the null loop. The time taken for COUNT
rounds of the null loop will be calculated only once for each
different COUNT used.
+=item timesum ( T1, T2 )
+
+Returns the sum of two Benchmark times as a Benchmark object suitable
+for passing to timestr().
+
=back
=head1 NOTES
@@ -324,8 +324,9 @@ sub _doeval { eval shift }
use Carp;
use Exporter;
@ISA=(Exporter);
-@EXPORT=qw(cmpthese countit timeit timethis timethese timediff timestr);
-@EXPORT_OK=qw(clearcache clearallcache disablecache enablecache);
+@EXPORT=qw(timeit timethis timethese timediff timestr);
+@EXPORT_OK=qw(timesum cmpthese countit
+ clearcache clearallcache disablecache enablecache);
&init;
@@ -443,9 +444,7 @@ sub runloop {
# in &countit. This, in turn, can reduce the number of calls to
# &runloop a lot, and thus reduce additive errors.
my $tbase = Benchmark->new(0)->[1];
- do {
- $t0 = Benchmark->new(0);
- } while ( $t0->[1] == $tbase );
+ while ( ( $t0 = Benchmark->new(0) )->[1] == $tbase ) {} ;
&$subref;
$t1 = Benchmark->new($n);
$td = &timediff($t1, $t0);
@@ -728,7 +727,7 @@ sub cmpthese{
sort { $$a <=> $$b } map { \$_ } @col_widths[2..$#col_widths];
my $max_width = ${$sorted_width_refs[-1]};
- my $total = 0;
+ my $total = @col_widths - 1 ;
for ( @col_widths ) { $total += $_ }
STRETCHER:
diff --git a/op.c b/op.c
index bc47f6da57..a51ecb0722 100644
--- a/op.c
+++ b/op.c
@@ -5048,17 +5048,10 @@ Perl_ck_fun(pTHX_ OP *o)
char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
OP *newop = newAVREF(newGVOP(OP_GV, 0,
gv_fetchpv(name, TRUE, SVt_PVAV) ));
-#ifdef IV_IS_QUAD
if (ckWARN(WARN_SYNTAX))
Perl_warner(aTHX_ WARN_SYNTAX,
- "Array @%s missing the @ in argument %" PERL_PRId64 " of %s()",
+ "Array @%s missing the @ in argument %"IVdf" of %s()",
name, (IV)numargs, PL_op_desc[type]);
-#else
- if (ckWARN(WARN_SYNTAX))
- Perl_warner(aTHX_ WARN_SYNTAX,
- "Array @%s missing the @ in argument %ld of %s()",
- name, (long)numargs, PL_op_desc[type]);
-#endif
op_free(kid);
kid = newop;
kid->op_sibling = sibl;
@@ -5075,17 +5068,10 @@ Perl_ck_fun(pTHX_ OP *o)
char *name = SvPVx(((SVOP*)kid)->op_sv, n_a);
OP *newop = newHVREF(newGVOP(OP_GV, 0,
gv_fetchpv(name, TRUE, SVt_PVHV) ));
-#ifdef IV_IS_QUAD
if (ckWARN(WARN_SYNTAX))
Perl_warner(aTHX_ WARN_SYNTAX,
- "Hash %%%s missing the %% in argument %" PERL_PRId64 " of %s()",
+ "Hash %%%s missing the %% in argument %"IVdf" of %s()",
name, (IV)numargs, PL_op_desc[type]);
-#else
- if (ckWARN(WARN_SYNTAX))
- Perl_warner(aTHX_ WARN_SYNTAX,
- "Hash %%%s missing the %% in argument %ld of %s()",
- name, (long)numargs, PL_op_desc[type]);
-#endif
op_free(kid);
kid = newop;
kid->op_sibling = sibl;
@@ -6155,7 +6141,7 @@ Perl_peep(pTHX_ register OP *o)
key = SvPV(*svp, keylen);
indsvp = hv_fetch(GvHV(*fields), key, keylen, FALSE);
if (!indsvp) {
- Perl_croak(aTHX_ "No such field \"%s\" in variable %s of type %s",
+ Perl_croak(aTHX_ "No such pseudo-hash field \"%s\" in variable %s of type %s",
key, SvPV(lexname, n_a), HvNAME(SvSTASH(lexname)));
}
ind = SvIV(*indsvp);
diff --git a/patchlevel.h b/patchlevel.h
index 02a968910e..56e529c711 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -7,6 +7,19 @@
#define PERL_VERSION 5 /* epoch */
#define PERL_SUBVERSION 61 /* generation */
+/* Compatibility across versions: MakeMaker will install add-on
+ modules in a directory with the PERL_APIVERSION version number.
+ Normally this should not change across maintenance releases.
+ perl.c:incpush() and lib/lib.pm will automatically search older
+ directories across major versions back to to PERL_XS_APIVERSION
+ for XS modules and back to PERL_PM_APIVERSION for pure PERL modules.
+ (Since the versioned directory layout didn't start until 5.005,
+ that's the earliest these can go back.
+
+ See INSTALL for how this works.
+*/
+#define PERL_APIVERSION 5.00561 /* Adjust manually as needed. */
+
#define __PATCHLEVEL_H_INCLUDED__
#endif
diff --git a/perl.h b/perl.h
index 8aec1fd47f..574e7f7ae0 100644
--- a/perl.h
+++ b/perl.h
@@ -1932,6 +1932,22 @@ typedef I32 CHECKPOINT;
# endif
#endif
+#ifdef IV_IS_QUAD
+# define UVuf PERL_PRIu64
+# define IVdf PERL_PRId64
+# define UVof PERL_PRIo64
+# define UVxf PERL_PRIx64
+#else
+# if LONGSIZE == 4
+# define UVuf "lu"
+# define IVdf "ld"
+# define UVof "lo"
+# define UVxf "lx"
+# else
+ /* Any good ideas? */
+# endif
+#endif
+
/* Used with UV/IV arguments: */
/* XXXX: need to speed it up */
#define CLUMP_2UV(iv) ((iv) < 0 ? 0 : (UV)(iv))
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index d224a54bd7..b35d260eb2 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -1967,13 +1967,13 @@ your system.
(F) The argument to B<-I> must follow the B<-I> immediately with no
intervening space.
-=item No such array field
+=item No such pseudo-hash field "%s"
(F) You tried to access an array as a hash, but the field name used is
not defined. The hash at index 0 should map all valid field names to
array indices for that to work.
-=item No such field "%s" in variable %s of type %s
+=item No such pseudo-hash field "%s" in variable %s of type %s
(F) You tried to access a field of a typed variable where the type
does not know about the field name. The field names are looked up in
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index a09c6e5d46..d07ded3829 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1412,6 +1412,9 @@ This surprising autovivification in what does not at first--or even
second--glance appear to be an lvalue context may be fixed in a future
release.
+See L<perlref/"Pseudo-hashes"> for specifics on how exists() acts when
+used on a pseudo-hash.
+
=item exit EXPR
Evaluates EXPR and exits immediately with that value. Example:
diff --git a/pod/perlref.pod b/pod/perlref.pod
index 5958a7233c..753cd012ed 100644
--- a/pod/perlref.pod
+++ b/pod/perlref.pod
@@ -563,6 +563,25 @@ or try to access nonexistent fields. For better performance, Perl can also
do the translation from field names to array indices at compile time for
typed object references. See L<fields>.
+There are two ways to check for the existance of a key in a
+pseudo-hash. The first is to use exists(). This checks to see if the
+given field has been used yet. It acts this way to match the behavior
+of a regular hash. For instance:
+
+ $phash = [{foo =>1, bar => 2, pants => 3}, 'FOO'];
+ $phash->{pants} = undef;
+
+ exists $phash->{foo}; # true, 'foo' was set in the declaration
+ exists $phash->{bar}; # false, 'bar' has not been used.
+ exists $phash->{pants}; # true, your 'pants' have been touched
+
+The second is to use exists() on the hash reference sitting in the
+first array element. This checks to see if the given key is a valid
+field in the pseudo-hash.
+
+ exists $phash->[0]{pants}; # true, 'pants' is a valid field
+ exists $phash->[0]{shoes}; # false, 'shoes' can't be used
+
=head2 Function Templates
As explained above, a closure is an anonymous function with access to the
diff --git a/pp_hot.c b/pp_hot.c
index a25f000d3c..8e795cb637 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -601,15 +601,9 @@ PP(pp_rv2hv)
dTARGET;
if (SvTYPE(hv) == SVt_PVAV)
hv = avhv_keys((AV*)hv);
-#ifdef IV_IS_QUAD
if (HvFILL(hv))
- Perl_sv_setpvf(aTHX_ TARG, "%" PERL_PRId64 "/%" PERL_PRId64,
- (Quad_t)HvFILL(hv), (Quad_t)HvMAX(hv) + 1);
-#else
- if (HvFILL(hv))
- Perl_sv_setpvf(aTHX_ TARG, "%ld/%ld",
- (long)HvFILL(hv), (long)HvMAX(hv) + 1);
-#endif
+ Perl_sv_setpvf(aTHX_ TARG, "%"IVdf"/%"IVdf,
+ (IV)HvFILL(hv), (IV)HvMAX(hv) + 1);
else
sv_setiv(TARG, 0);
diff --git a/pp_sys.c b/pp_sys.c
index cf08f73fa9..2963d2f893 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -825,17 +825,10 @@ PP(pp_untie)
if (ckWARN(WARN_UNTIE)) {
MAGIC * mg ;
if (mg = SvTIED_mg(sv, how)) {
-#ifdef IV_IS_QUAD
if (mg && SvREFCNT(SvRV(mg->mg_obj)) > 1)
Perl_warner(aTHX_ WARN_UNTIE,
- "untie attempted while %" PERL_PRIu64 " inner references still exist",
+ "untie attempted while %"UVuf" inner references still exist",
(UV)SvREFCNT(SvRV(mg->mg_obj)) - 1 ) ;
-#else
- if (mg && SvREFCNT(SvRV(mg->mg_obj)) > 1)
- Perl_warner(aTHX_ WARN_UNTIE,
- "untie attempted while %lu inner references still exist",
- (unsigned long)SvREFCNT(SvRV(mg->mg_obj)) - 1 ) ;
-#endif
}
}
diff --git a/regcomp.c b/regcomp.c
index 64c06f0027..99423e199d 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -702,11 +702,7 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da
FAIL("variable length lookbehind not implemented");
}
else if (minnext > U8_MAX) {
-#ifdef UV_IS_QUAD
- FAIL2("lookbehind longer than %" PERL_PRIu64 " not implemented", (UV)U8_MAX);
-#else
- FAIL2("lookbehind longer than %d not implemented", U8_MAX);
-#endif
+ FAIL2("lookbehind longer than %"UVuf" not implemented", (UV)U8_MAX);
}
scan->flags = minnext;
}
@@ -1080,7 +1076,9 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
r->check_offset_min = data.offset_float_min;
r->check_offset_max = data.offset_float_max;
}
- if (r->check_substr) {
+ /* XXXX Currently intuiting is not compatible with ANCH_GPOS.
+ This should be changed ASAP! */
+ if (r->check_substr && !(r->reganch & ROPT_ANCH_GPOS)) {
r->reganch |= RE_USE_INTUIT;
if (SvTAIL(r->check_substr))
r->reganch |= RE_INTUIT_TAIL;
@@ -2840,13 +2838,8 @@ S_regclassutf8(pTHX)
if (range) {
if (lastvalue > value)
FAIL("invalid [] range in regexp"); /* [b-a] */
-#ifdef UV_IS_QUAD
- if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04" PERL_PRIx64 "\t%04" PERL_PRIx64 "\n", (UV)lastvalue, (UV)value);
-#else
if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04x\t%04x\n", lastvalue, value);
-#endif
+ Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\t%04"UVxf"\n", (UV)lastvalue, (UV)value);
range = 0;
}
else {
@@ -2861,13 +2854,8 @@ S_regclassutf8(pTHX)
}
}
/* now is the next time */
-#ifdef UV_IS_QUAD
- if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04" PERL_PRIx64 "\n", (UV)value);
-#else
if (!SIZE_ONLY)
- Perl_sv_catpvf(aTHX_ listsv, "%04x\n", value);
-#endif
+ Perl_sv_catpvf(aTHX_ listsv, "%04"UVxf"\n", (UV)value);
range = 0;
}
diff --git a/regexec.c b/regexec.c
index 0c4cc9546f..ed7436933b 100644
--- a/regexec.c
+++ b/regexec.c
@@ -739,19 +739,23 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
/* If there is a "must appear" string, look for it. */
s = startpos;
- if (prog->reganch & ROPT_GPOS_SEEN) {
+ if (prog->reganch & ROPT_GPOS_SEEN) { /* Need to have PL_reg_ganch */
MAGIC *mg;
- if (!(flags & REXEC_IGNOREPOS) && sv && SvTYPE(sv) >= SVt_PVMG
- && SvMAGIC(sv) && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0)
- PL_reg_ganch = strbeg + mg->mg_len;
- else
+ if (flags & REXEC_IGNOREPOS) /* Means: check only at start */
PL_reg_ganch = startpos;
- if (prog->reganch & ROPT_ANCH_GPOS) {
- if (s > PL_reg_ganch)
- goto phooey;
- s = PL_reg_ganch;
+ else if (sv && SvTYPE(sv) >= SVt_PVMG
+ && SvMAGIC(sv)
+ && (mg = mg_find(sv, 'g')) && mg->mg_len >= 0) {
+ PL_reg_ganch = strbeg + mg->mg_len; /* Defined pos() */
+ if (prog->reganch & ROPT_ANCH_GPOS) {
+ if (s > PL_reg_ganch)
+ goto phooey;
+ s = PL_reg_ganch;
+ }
}
+ else /* pos() not defined */
+ PL_reg_ganch = strbeg;
}
if (!(flags & REXEC_CHECKED) && prog->check_substr != Nullsv) {
diff --git a/sv.c b/sv.c
index 3d613d54ae..23feef960f 100644
--- a/sv.c
+++ b/sv.c
@@ -1468,17 +1468,11 @@ Perl_sv_2iv(pTHX_ register SV *sv)
SvUVX(sv) = U_V(SvNVX(sv));
SvIsUV_on(sv);
ret_iv_max:
-#ifdef IV_IS_QUAD
DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%" PERL_PRIx64 " 2iv(%" PERL_PRIu64 " => %" PERL_PRId64 ") (as unsigned)\n",
+ "0x%"UVxf" 2iv(%"UVuf" => %"IVdf") (as unsigned)\n",
PTR2UV(sv),
- (UV)SvUVX(sv), (IV)SvUVX(sv)));
-#else
- DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%lx 2iv(%lu => %ld) (as unsigned)\n",
- (unsigned long)sv,
- (unsigned long)SvUVX(sv), (long)(IV)SvUVX(sv)));
-#endif
+ SvUVX(sv),
+ SvUVX(sv)));
return (IV)SvUVX(sv);
}
}
@@ -1612,17 +1606,11 @@ Perl_sv_2uv(pTHX_ register SV *sv)
else {
SvIVX(sv) = I_V(SvNVX(sv));
ret_zero:
-#ifdef IV_IS_QUAD
DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%" PERL_PRIx64 " 2uv(%" PERL_PRId64 " => %" PERL_PRIu64 ") (as signed)\n",
- (unsigned long)sv,(long)SvIVX(sv),
- (long)(UV)SvIVX(sv)));
-#else
- DEBUG_c(PerlIO_printf(Perl_debug_log,
- "0x%lx 2uv(%ld => %lu) (as signed)\n",
- (unsigned long)sv,(long)SvIVX(sv),
- (long)(UV)SvIVX(sv)));
-#endif
+ "0x%"UVxf" 2uv(%"IVdf" => %"UVdf") (as signed)\n",
+ PTR2UV(sv),
+ SvIVX(sv),
+ (IV)(UV)SvIVX(sv)));
return (UV)SvIVX(sv);
}
}
@@ -2026,17 +2014,10 @@ Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp)
return SvPVX(sv);
}
if (SvIOKp(sv)) {
-#ifdef IV_IS_QUAD
if (SvIsUV(sv))
- (void)sprintf(tmpbuf,"%" PERL_PRIu64,(UV)SvUVX(sv));
+ (void)sprintf(tmpbuf,"%"UVuf, (UV)SvUVX(sv));
else
- (void)sprintf(tmpbuf,"%" PERL_PRId64,(IV)SvIVX(sv));
-#else
- if (SvIsUV(sv))
- (void)sprintf(tmpbuf,"%lu",(unsigned long)SvUVX(sv));
- else
- (void)sprintf(tmpbuf,"%ld",(long)SvIVX(sv));
-#endif
+ (void)sprintf(tmpbuf,"%"IVdf, (IV)SvIVX(sv));
tsv = Nullsv;
goto tokensave;
}
@@ -2134,11 +2115,7 @@ Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp)
Perl_sv_setpvf(aTHX_ tsv, "%s=%s", HvNAME(SvSTASH(sv)), s);
else
sv_setpv(tsv, s);
-#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ tsv, "(0x%" PERL_PRIx64")", PTR2UV(sv));
-#else
- Perl_sv_catpvf(aTHX_ tsv, "(0x%lx)", (unsigned long)sv);
-#endif
+ Perl_sv_catpvf(aTHX_ tsv, "(0x%"UVxf")", PTR2UV(sv));
goto tokensaveref;
}
*lp = strlen(s);
@@ -5561,19 +5538,13 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
Perl_sv_setpvf(aTHX_ msg, "Invalid conversion in %s: ",
(PL_op->op_type == OP_PRTF) ? "printf" : "sprintf");
if (c) {
-#ifdef UV_IS_QUAD
if (isPRINT(c))
Perl_sv_catpvf(aTHX_ msg,
"\"%%%c\"", c & 0xFF);
else
Perl_sv_catpvf(aTHX_ msg,
- "\"%%\\%03" PERL_PRIo64 "\"",
+ "\"%%\\%03"UVof"\"",
(UV)c & 0xFF);
-#else
- Perl_sv_catpvf(aTHX_ msg, isPRINT(c) ?
- "\"%%%c\"" : "\"%%\\%03o\"",
- c & 0xFF);
-#endif
} else
sv_catpv(msg, "end of string");
Perl_warner(aTHX_ WARN_PRINTF, "%_", msg); /* yes, this is reentrant */
diff --git a/t/lib/fields.t b/t/lib/fields.t
index 6f3ea5bb48..da874d674e 100755
--- a/t/lib/fields.t
+++ b/t/lib/fields.t
@@ -106,7 +106,7 @@ print "ok ", ++$testno, "\n";
# We should get compile time failures field name typos
eval q(my D3 $obj3 = $obj2; $obj3->{notthere} = "");
-print "not " unless $@ && $@ =~ /^No such field "notthere"/;
+print "not " unless $@ && $@ =~ /^No such pseudo-hash field "notthere"/;
print "ok ", ++$testno, "\n";
#fields::_dump();
diff --git a/t/lib/syslfs.t b/t/lib/syslfs.t
index a8a7a0cde2..43e66feb59 100644
--- a/t/lib/syslfs.t
+++ b/t/lib/syslfs.t
@@ -116,6 +116,12 @@ unless($syswrite && $close) {
print "# @s\n";
+unless ($s[7] == 5_000_000_003) {
+ print "1..0\n# not configured to use large files?\n";
+ explain();
+ bye();
+}
+
sub fail () {
print "not ";
$fail++;
diff --git a/t/op/lfs.t b/t/op/lfs.t
index 6f252312ab..87060e74c6 100644
--- a/t/op/lfs.t
+++ b/t/op/lfs.t
@@ -120,6 +120,12 @@ unless ($print && $close) {
print "# @s\n";
+unless ($s[7] == 5_000_000_003) {
+ print "1..0\n# not configured to use large files?\n";
+ explain();
+ bye();
+}
+
sub fail () {
print "not ";
$fail++;
diff --git a/t/op/pat.t b/t/op/pat.t
index 89cc2bb0a9..f36394edc2 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -4,7 +4,7 @@
# the format supported by op/regexp.t. If you want to add a test
# that does fit that format, add it to op/re_tests, not here.
-print "1..192\n";
+print "1..193\n";
BEGIN {
chdir 't' if -d 't';
@@ -887,3 +887,9 @@ pos=1;
m/^-.*bb/mg and print "not ";
print "ok $test\n";
$test++;
+
+$text = "aaXbXcc";
+pos($text)=0;
+$text =~ /\GXb*X/g and print 'not ';
+print "ok $test\n";
+$test++;
diff --git a/t/op/re_tests b/t/op/re_tests
index b35e964dc1..695672da71 100644
--- a/t/op/re_tests
+++ b/t/op/re_tests
@@ -739,3 +739,4 @@ tt+$ xxxtt y - -
[\w-z] - c - /[\w-z]/: invalid [] range in regexp
[0-[:digit:]] - c - /[0-[:digit:]]/: invalid [] range in regexp
[[:digit:]-9] - c - /[[:digit:]-9]/: invalid [] range in regexp
+\GX.*X aaaXbX n - -
diff --git a/t/pragma/constant.t b/t/pragma/constant.t
index 15ce319c02..a56e081083 100755
--- a/t/pragma/constant.t
+++ b/t/pragma/constant.t
@@ -151,7 +151,7 @@ print CHASH->{foo};
print CARRAY->[1];
print CPHASH->{foo};
eval q{ CPHASH->{bar} };
-test 44, scalar($@ =~ /^No such array/);
+test 44, scalar($@ =~ /^No such pseudo-hash field/);
print CCODE->(45);
eval q{ CCODE->{foo} };
test 46, scalar($@ =~ /^Constant is not a HASH/);
diff --git a/taint.c b/taint.c
index 2a5fedc7b1..c272066e8d 100644
--- a/taint.c
+++ b/taint.c
@@ -14,12 +14,12 @@ Perl_taint_proper(pTHX_ const char *f, char *s)
dTHR; /* just for taint */
char *ug;
-#ifdef IV_IS_QUAD
+#if Uid_t_SIGN == -1
DEBUG_u(PerlIO_printf(Perl_debug_log,
- "%s %d %" PERL_PRId64 " %" PERL_PRId64 "\n", s, PL_tainted, (IV)PL_uid, (IV)PL_euid));
+ "%s %d %"IVdf" %"IVdf"\n", s, PL_tainted, (IV)PL_uid, (IV)PL_euid));
#else
DEBUG_u(PerlIO_printf(Perl_debug_log,
- "%s %d %lu %lu\n", s, PL_tainted, (unsigned long)PL_uid, (unsigned long)PL_euid));
+ "%s %d %"UVuf" %"UVuf"\n", s, PL_tainted, (UV)PL_uid, (UV)PL_euid));
#endif
if (PL_tainted) {
diff --git a/toke.c b/toke.c
index ea95f3a63d..a6d364195d 100644
--- a/toke.c
+++ b/toke.c
@@ -3743,13 +3743,8 @@ Perl_yylex(pTHX)
TERM(THING);
case KEY___LINE__:
-#ifdef IV_IS_QUAD
yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- Perl_newSVpvf(aTHX_ "%" PERL_PRId64, (IV)PL_curcop->cop_line));
-#else
- yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- Perl_newSVpvf(aTHX_ "%ld", (long)PL_curcop->cop_line));
-#endif
+ Perl_newSVpvf(aTHX_ "%"IVdf, (IV)PL_curcop->cop_line));
TERM(THING);
case KEY___PACKAGE__:
@@ -6998,28 +6993,16 @@ Perl_yyerror(pTHX_ char *s)
where = SvPVX(where_sv);
}
msg = sv_2mortal(newSVpv(s, 0));
-#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ msg, " at %_ line %" PERL_PRId64 ", ",
+ Perl_sv_catpvf(aTHX_ msg, " at %_ line %"IVdf", ",
GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line);
-#else
- Perl_sv_catpvf(aTHX_ msg, " at %_ line %ld, ",
- GvSV(PL_curcop->cop_filegv), (long)PL_curcop->cop_line);
-#endif
if (context)
Perl_sv_catpvf(aTHX_ msg, "near \"%.*s\"\n", contlen, context);
else
Perl_sv_catpvf(aTHX_ msg, "%s\n", where);
if (PL_multi_start < PL_multi_end && (U32)(PL_curcop->cop_line - PL_multi_end) <= 1) {
-#ifdef IV_IS_QUAD
Perl_sv_catpvf(aTHX_ msg,
- " (Might be a runaway multi-line %c%c string starting on line %" PERL_\
-PRId64 ")\n",
+ " (Might be a runaway multi-line %c%c string starting on line %"IVdf")\n",
(int)PL_multi_open,(int)PL_multi_close,(IV)PL_multi_start);
-#else
- Perl_sv_catpvf(aTHX_ msg,
- " (Might be a runaway multi-line %c%c string starting on line %ld)\n",
- (int)PL_multi_open,(int)PL_multi_close,(long)PL_multi_start);
-#endif
PL_multi_end = 0;
}
if (PL_in_eval & EVAL_WARNONLY)
diff --git a/util.c b/util.c
index 24af6622f8..d9f289b889 100644
--- a/util.c
+++ b/util.c
@@ -1418,29 +1418,16 @@ Perl_vmess(pTHX_ const char *pat, va_list *args)
sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {
dTHR;
-#ifdef IV_IS_QUAD
if (PL_curcop->cop_line)
- Perl_sv_catpvf(aTHX_ sv, " at %_ line %" PERL_PRId64,
+ Perl_sv_catpvf(aTHX_ sv, " at %_ line %"IVdf,
GvSV(PL_curcop->cop_filegv), (IV)PL_curcop->cop_line);
-#else
- if (PL_curcop->cop_line)
- Perl_sv_catpvf(aTHX_ sv, " at %_ line %ld",
- GvSV(PL_curcop->cop_filegv), (long)PL_curcop->cop_line);
-#endif
if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');
-#ifdef IV_IS_QUAD
- Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %" PERL_PRId64,
+ Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %"IVdf,
PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
line_mode ? "line" : "chunk",
(IV)IoLINES(GvIOp(PL_last_in_gv)));
-#else
- Perl_sv_catpvf(aTHX_ sv, ", <%s> %s %ld",
- PL_last_in_gv == PL_argvgv ? "" : GvNAME(PL_last_in_gv),
- line_mode ? "line" : "chunk",
- (long)IoLINES(GvIOp(PL_last_in_gv)));
-#endif
}
#ifdef USE_THREADS
if (thr->tid)