diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-03-29 16:31:38 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2001-03-29 16:31:38 +0000 |
commit | 72ce49315d15130348444317fc8556e96fa06011 (patch) | |
tree | 8c3701c3ae8336c8c2eafe7e8b7551da06b6da32 | |
parent | 0026721a5b588a091ec5fe2016e8d00b8be712ab (diff) | |
parent | 4c421ebcd3bbf75a4a53e0b1b09a20c98dd5cf98 (diff) | |
download | perl-72ce49315d15130348444317fc8556e96fa06011.tar.gz |
Integrate mainline
p4raw-id: //depot/perlio@9451
-rw-r--r-- | Changes | 158 | ||||
-rw-r--r-- | Makefile.SH | 2 | ||||
-rw-r--r-- | dump.c | 2 | ||||
-rw-r--r-- | ext/Data/Dumper/Dumper.xs | 2 | ||||
-rw-r--r-- | ext/Encode/Encode.xs | 2 | ||||
-rw-r--r-- | ext/Storable/Storable.xs | 15 | ||||
-rw-r--r-- | lib/ExtUtils/typemap | 4 | ||||
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | pod/perlhack.pod | 2 | ||||
-rw-r--r-- | pod/perliol.pod | 16 | ||||
-rw-r--r-- | t/lib/charnames.t | 17 | ||||
-rw-r--r-- | t/lib/cwd.t | 50 | ||||
-rwxr-xr-x | t/op/bop.t | 29 | ||||
-rwxr-xr-x | t/op/vec.t | 12 | ||||
-rwxr-xr-x | t/op/ver.t | 27 | ||||
-rw-r--r-- | toke.c | 3 | ||||
-rw-r--r-- | utils/h2xs.PL | 22 |
17 files changed, 308 insertions, 57 deletions
@@ -31,6 +31,164 @@ or any other branch. Version v5.7.1 Development release working toward v5.8 -------------- ____________________________________________________________________________ +[ 9447] By: jhi on 2001/03/29 15:39:34 + Log: Integrate perlio. + Branch: perl + !> win32/makefile.mk +____________________________________________________________________________ +[ 9446] By: nick on 2001/03/29 15:30:03 + Log: Integrate win32/makefile.mk with mainline. + Branch: perlio + !> win32/makefile.mk +____________________________________________________________________________ +[ 9445] By: nick on 2001/03/29 15:27:32 + Log: Fix breakage ... + Branch: perlio + ! win32/makefile.mk +____________________________________________________________________________ +[ 9444] By: jhi on 2001/03/29 15:03:08 + Log: Subject: RE: Borland C++ for Win32 fixes; perl@9359 (also perl@9424) + From: "Konovalov, Vadim" <vkonovalov@lucent.com> + Date: Thu, 29 Mar 2001 10:32:59 +0400 + Message-ID: <402099F49BEED211999700805FC7359FA8442D@ru0028exch01.spb.lucent.com> + Branch: perl + ! win32/makefile.mk +____________________________________________________________________________ +[ 9443] By: jhi on 2001/03/29 15:02:12 + Log: Integrate perlio. + Branch: perl + +> win32/buildext.pl + !> MANIFEST ext/PerlIO/Via/Via.xs perlio.c perlio.h sv.c + !> t/io/utf8.t t/lib/io_scalar.t win32/makefile.mk +____________________________________________________________________________ +[ 9442] By: nick on 2001/03/29 14:59:11 + Log: Work in progress - determine win32 extensions to build via script. + Branch: perlio + + win32/buildext.pl + ! MANIFEST win32/makefile.mk +____________________________________________________________________________ +[ 9441] By: jhi on 2001/03/29 14:51:47 + Log: Reintroduce the use of external pwd. + Branch: perl + ! t/lib/cwd.t +____________________________________________________________________________ +[ 9440] By: jhi on 2001/03/29 14:42:58 + Log: use warnings instead of -w. + Branch: perl + ! utils/h2xs.PL +____________________________________________________________________________ +[ 9439] By: jhi on 2001/03/29 14:41:52 + Log: Subject: [PATCH h2xs.PL perl@9423] h2xs -w nits + From: Jonathan Stowe <gellyfish@gellyfish.com> + Date: Thu, 29 Mar 2001 09:34:12 +0100 (BST) + Message-ID: <Pine.LNX.4.30.0103290929130.19409-100000@orpheus.gellyfish.com> + Branch: perl + ! utils/h2xs.PL +____________________________________________________________________________ +[ 9438] By: jhi on 2001/03/29 14:39:38 + Log: Subject: [PATCH perl@9424] minor pod nits + From: Robin Barker <rmb1@cise.npl.co.uk> + Date: Thu, 29 Mar 2001 14:43:05 +0100 (BST) + Message-Id: <200103291343.OAA10827@tempest.npl.co.uk> + Branch: perl + ! pod/perlhack.pod pod/perliol.pod +____________________________________________________________________________ +[ 9437] By: jhi on 2001/03/29 14:29:16 + Log: Subject: [PATCH perl@9424] typemap cast warning + From: Robin Barker <rmb1@cise.npl.co.uk> + Date: Thu, 29 Mar 2001 13:58:47 +0100 (BST) + Message-Id: <200103291258.NAA09360@tempest.npl.co.uk> + Branch: perl + ! lib/ExtUtils/typemap +____________________________________________________________________________ +[ 9436] By: jhi on 2001/03/29 14:26:03 + Log: Subject: [PATCH perl@9424] printf warning + From: Robin Barker <rmb1@cise.npl.co.uk> + Date: Thu, 29 Mar 2001 13:29:21 +0100 (BST) + Message-Id: <200103291229.NAA03968@tempest.npl.co.uk> + Branch: perl + ! dump.c ext/Data/Dumper/Dumper.xs ext/Encode/Encode.xs + ! ext/Storable/Storable.xs toke.c +____________________________________________________________________________ +[ 9435] By: nick on 2001/03/29 14:23:31 + Log: Win32 has name conflict with ERROR + Branch: perlio + ! ext/PerlIO/Via/Via.xs +____________________________________________________________________________ +[ 9434] By: jhi on 2001/03/29 14:17:48 + Log: Subject: [PATCH: 9424] some tests (was Re: Perl5.7.* Unicode/EBCDIC status.) + From: Peter Prymmer <pvhp@forte.com> + Date: Wed, 28 Mar 2001 19:09:57 -0800 (PST) + Message-ID: <Pine.OSF.4.10.10103281858520.314137-100000@aspara.forte.com> + Branch: perl + ! t/lib/charnames.t t/op/bop.t t/op/vec.t t/op/ver.t +____________________________________________________________________________ +[ 9433] By: jhi on 2001/03/29 13:52:44 + Log: test-prep target was missing. + Branch: perl + ! Makefile.SH +____________________________________________________________________________ +[ 9432] By: nick on 2001/03/29 12:40:03 + Log: Make as-shipped compiler default to MSVC6 + Branch: perlio + ! win32/makefile.mk +____________________________________________________________________________ +[ 9431] By: nick on 2001/03/29 12:12:16 + Log: Allow someone to write PerlIO::Array, PerlIO::Code, ... + akin to PerlIO::Scalar. + Branch: perlio + ! perlio.c perlio.h +____________________________________________________________________________ +[ 9430] By: nick on 2001/03/29 10:56:35 + Log: Integrate mainline. + Branch: perlio + !> lib/File/Basename.pm lib/File/CheckTree.pm lib/File/Compare.pm + !> lib/File/Copy.pm lib/File/DosGlob.pm lib/File/Find.pm + !> lib/File/Path.pm lib/File/stat.pm t/lib/filecopy.t + !> win32/makefile.mk win32/win32sck.c +____________________________________________________________________________ +[ 9429] By: nick on 2001/03/29 09:03:43 + Log: Noticed that two tests were skipped as perlio:: package + isn't there any more. Changed the skip condition. + Avoid core-dump if sv_utf8_upgrade() called on something + that does not become SvPOK after SvPV() (e.g. a ref). + Branch: perlio + ! sv.c t/io/utf8.t t/lib/io_scalar.t +____________________________________________________________________________ +[ 9428] By: jhi on 2001/03/29 01:31:47 + Log: Subject: [PATCH] Enable warnings in File::* (was: B::Terse and warnings) + From: Benjamin Sugars <bsugars@canoe.ca> + Date: Tue, 27 Mar 2001 16:27:38 -0500 (EST) + Message-ID: <Pine.LNX.4.21.0103271612250.2007-100000@marmot.rim.canoe.ca> + Branch: perl + ! lib/File/Basename.pm lib/File/CheckTree.pm lib/File/Compare.pm + ! lib/File/Copy.pm lib/File/DosGlob.pm lib/File/Find.pm + ! lib/File/Path.pm lib/File/stat.pm t/lib/filecopy.t +____________________________________________________________________________ +[ 9427] By: jhi on 2001/03/29 00:49:30 + Log: Subject: Borland C++ for Win32 fixes; perl@9359 (also perl@9424) + From: "Vadim Konovalov" <watman@inbox.ru> + Date: Thu, 29 Mar 2001 01:50:12 +0400 + Message-ID: <001c01c0b7d1$463dd880$5742983e@vad> + Branch: perl + ! win32/makefile.mk win32/win32sck.c +____________________________________________________________________________ +[ 9426] By: gsar on 2001/03/29 00:28:04 + Log: dmake can only handle == and != in comparisons; support building + with Borland's VCL libraries (from Vadim Konovalov) + Branch: maint-5.6/perl + ! win32/makefile.mk +____________________________________________________________________________ +[ 9425] By: nick on 2001/03/28 19:29:56 + Log: Integrate (@snapshot) + Branch: perlio + !> Changes Makefile.SH patchlevel.h t/lib/cwd.t +____________________________________________________________________________ +[ 9424] By: jhi on 2001/03/28 19:03:16 + Log: Update Changes. + Branch: perl + ! Changes patchlevel.h +____________________________________________________________________________ [ 9423] By: jhi on 2001/03/28 18:52:09 Log: Rmdir lib/XS on cleanup. Branch: perl diff --git a/Makefile.SH b/Makefile.SH index 8033ca9528..b8227a6193 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -903,7 +903,7 @@ test_notty: test_prep utest ucheck: test_prep PERL=./perl UTF8=-utf8 $(MAKE) _test -# Backward compat. +test-prep: test_prep test-tty: test_tty @@ -195,7 +195,7 @@ Perl_sv_peek(pTHX_ SV *sv) unref++; } else if (DEBUG_R_TEST && SvREFCNT(sv) > 1) { - Perl_sv_catpvf(aTHX_ t, "<%u>", SvREFCNT(sv)); + Perl_sv_catpvf(aTHX_ t, "<%"UVuf">", (UV)SvREFCNT(sv)); } diff --git a/ext/Data/Dumper/Dumper.xs b/ext/Data/Dumper/Dumper.xs index bfa50d7413..99cd099eb8 100644 --- a/ext/Data/Dumper/Dumper.xs +++ b/ext/Data/Dumper/Dumper.xs @@ -128,7 +128,7 @@ esc_q_utf8(pTHX_ SV* sv, register char *src, register STRLEN slen) r[j++] = '\\'; r[j++] = 'x'; r[j++] = '{'; - j += sprintf(r + j, "%x", k); + j += sprintf(r + j, "%"UVxf, k); r[j++] = '}'; dquote = TRUE; } diff --git a/ext/Encode/Encode.xs b/ext/Encode/Encode.xs index 13ba7045c4..a486939550 100644 --- a/ext/Encode/Encode.xs +++ b/ext/Encode/Encode.xs @@ -97,7 +97,7 @@ PerlIOEncode_pushed(PerlIO *f, const char *mode, SV *arg) { e->enc = Nullsv; errno = EINVAL; - Perl_warner(aTHX_ WARN_IO, "Cannot find encoding \"%_\"", arg); + Perl_warner(aTHX_ WARN_IO, "Cannot find encoding \"%"SVf"\"", arg); return -1; } SvREFCNT_inc(e->enc); diff --git a/ext/Storable/Storable.xs b/ext/Storable/Storable.xs index 647673e86e..dfb0f76ea1 100644 --- a/ext/Storable/Storable.xs +++ b/ext/Storable/Storable.xs @@ -3086,7 +3086,8 @@ static SV *retrieve_idx_blessed(stcxt_t *cxt, char *cname) sva = av_fetch(cxt->aclass, idx, FALSE); if (!sva) - CROAK(("Class name #%d should have been seen already", idx)); + CROAK(("Class name #%"IVdf" should have been seen already", + (IV)idx)); class = SvPVX(*sva); /* We know it's a PV, by construction */ @@ -3281,7 +3282,8 @@ static SV *retrieve_hook(stcxt_t *cxt, char *cname) sva = av_fetch(cxt->aclass, idx, FALSE); if (!sva) - CROAK(("Class name #%d should have been seen already", idx)); + CROAK(("Class name #%"IVdf" should have been seen already", + (IV)idx)); class = SvPVX(*sva); /* We know it's a PV, by construction */ TRACEME(("class ID %d => %s", idx, class)); @@ -3382,7 +3384,7 @@ static SV *retrieve_hook(stcxt_t *cxt, char *cname) tag = ntohl(tag); svh = av_fetch(cxt->aseen, tag, FALSE); if (!svh) - CROAK(("Object #%d should have been retrieved already", tag)); + CROAK(("Object #%"IVdf" should have been retrieved already", (IV)tag)); xsv = *svh; ary[i] = SvREFCNT_inc(xsv); } @@ -4532,7 +4534,7 @@ static SV *retrieve(stcxt_t *cxt, char *cname) I32 tagn; svh = hv_fetch(cxt->hseen, (char *) &tag, sizeof(tag), FALSE); if (!svh) - CROAK(("Old tag 0x%x should have been mapped already", tag)); + CROAK(("Old tag 0x%"UVxf" should have been mapped already", (UV)tag)); tagn = SvIV(*svh); /* Mapped tag number computed earlier below */ /* @@ -4541,7 +4543,7 @@ static SV *retrieve(stcxt_t *cxt, char *cname) svh = av_fetch(cxt->aseen, tagn, FALSE); if (!svh) - CROAK(("Object #%d should have been retrieved already", tagn)); + CROAK(("Object #%"IVdf" should have been retrieved already", (IV)tagn)); sv = *svh; TRACEME(("has retrieved #%d at 0x%"UVxf, tagn, PTR2UV(sv))); SvREFCNT_inc(sv); /* One more reference to this same sv */ @@ -4582,7 +4584,8 @@ again: tag = ntohl(tag); svh = av_fetch(cxt->aseen, tag, FALSE); if (!svh) - CROAK(("Object #%d should have been retrieved already", tag)); + CROAK(("Object #%"IVdf" should have been retrieved already", + (IV)tag)); sv = *svh; TRACEME(("had retrieved #%d at 0x%"UVxf, tag, PTR2UV(sv))); SvREFCNT_inc(sv); /* One more reference to this same sv */ diff --git a/lib/ExtUtils/typemap b/lib/ExtUtils/typemap index 3304df5f59..08ca108465 100644 --- a/lib/ExtUtils/typemap +++ b/lib/ExtUtils/typemap @@ -122,14 +122,14 @@ T_PTRREF T_REF_IV_REF if (sv_isa($arg, \"${type}\")) { IV tmp = SvIV((SV*)SvRV($arg)); - $var = *($type *) tmp; + $var = *INT2PTR($type *, tmp); } else Perl_croak(aTHX_ \"$var is not of type ${ntype}\") T_REF_IV_PTR if (sv_isa($arg, \"${ntype}\")) { IV tmp = SvIV((SV*)SvRV($arg)); - $var = ($type) tmp; + $var = INT2PTR($type, tmp); } else Perl_croak(aTHX_ \"$var is not of type ${ntype}\") diff --git a/patchlevel.h b/patchlevel.h index 7824ce3356..aeed76a742 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -70,7 +70,7 @@ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) static char *local_patches[] = { NULL - ,"DEVEL9423" + ,"DEVEL9447" ,NULL }; diff --git a/pod/perlhack.pod b/pod/perlhack.pod index 33a15e34da..5a8f61e418 100644 --- a/pod/perlhack.pod +++ b/pod/perlhack.pod @@ -1796,7 +1796,7 @@ The compiler emitted code for these lines, but the code was unexecuted. Unexecuted procedures. -=over4 +=back For further information, see your system's manual pages for pixie and prof. diff --git a/pod/perliol.pod b/pod/perliol.pod index 68f581428c..36f1bed1fc 100644 --- a/pod/perliol.pod +++ b/pod/perliol.pod @@ -128,13 +128,21 @@ layer), then follow the functions which fall into four basic groups: =over 4 -=item 1. Opening and setup functions +=item 1. -=item 2. Basic IO operations +Opening and setup functions -=item 3. Stdio class buffering options. +=item 2. -=item 4. Functions to support Perl's traditional "fast" access to the buffer. +Basic IO operations + +=item 3. + +Stdio class buffering options. + +=item 4. + +Functions to support Perl's traditional "fast" access to the buffer. =back diff --git a/t/lib/charnames.t b/t/lib/charnames.t index 9773a2025d..07c91e6682 100644 --- a/t/lib/charnames.t +++ b/t/lib/charnames.t @@ -39,10 +39,19 @@ EOE } # If octal representation of unicode char is \0xyzt, then the utf8 is \3xy\2zt -$encoded_be = "\320\261"; -$encoded_alpha = "\316\261"; -$encoded_bet = "\327\221"; -$encoded_deseng = "\360\220\221\215"; +if (ord('A') == 65) { # as on ASCII or UTF-8 machines + $encoded_be = "\320\261"; + $encoded_alpha = "\316\261"; + $encoded_bet = "\327\221"; + $encoded_deseng = "\360\220\221\215"; +} +else { # EBCDIC where UTF-EBCDIC may be used (this may be 1047 specific since + # UTF-EBCDIC is codepage specific) + $encoded_be = "\270\102\130"; + $encoded_alpha = "\264\130"; + $encoded_bet = "\270\125\130"; + $encoded_deseng = "\336\102\103\124"; +} sub to_bytes { pack"a*", shift; diff --git a/t/lib/cwd.t b/t/lib/cwd.t index f9cdffbd0f..d2c3944b67 100644 --- a/t/lib/cwd.t +++ b/t/lib/cwd.t @@ -10,7 +10,7 @@ use Cwd; use strict; use warnings; -print "1..10\n"; +print "1..14\n"; # check imports print +(defined(&cwd) && @@ -23,6 +23,34 @@ print +(!defined(&chdir) && !defined(&fast_abs_path) ? "" : "not "), "ok 2\n"; +# Must find an external pwd (or equivalent) command. + +my $pwd_cmd = + ($^O eq "Win32") ? "cd" : (grep { -x && -f } map { "$_/pwd" } + split m/$Config{path_sep}/, $ENV{PATH})[0]; + +if (defined $pwd_cmd) { + chomp(my $start = `$pwd_cmd`); + if ($?) { + for (3..6) { + print "ok $_ # Skip: '$pwd_cmd' failed\n"; + } + } else { + my $cwd = cwd; + my $getcwd = getcwd; + my $fastcwd = fastcwd; + my $fastgetcwd = fastgetcwd; + print +($cwd eq $start ? "" : "not "), "ok 3\n"; + print +($getcwd eq $start ? "" : "not "), "ok 4\n"; + print +($fastcwd eq $start ? "" : "not "), "ok 5\n"; + print +($fastgetcwd eq $start ? "" : "not "), "ok 6\n"; + } +} else { + for (3..6) { + print "ok $_ # Skip: no pwd command found\n"; + } +} + mkdir "pteerslt", 0777; mkdir "pteerslt/path", 0777; mkdir "pteerslt/path/to", 0777; @@ -34,19 +62,19 @@ my $getcwd = getcwd; my $fastcwd = fastcwd; my $fastgetcwd = fastgetcwd; my $want = "t/pteerslt/path/to/a/dir"; -print +($cwd =~ m|$want$| ? "" : "not "), "ok 3\n"; -print +($getcwd =~ m|$want$| ? "" : "not "), "ok 4\n"; -print +($fastcwd =~ m|$want$| ? "" : "not "), "ok 5\n"; -print +($fastgetcwd =~ m|$want$| ? "" : "not "), "ok 6\n"; +print +($cwd =~ m|$want$| ? "" : "not "), "ok 7\n"; +print +($getcwd =~ m|$want$| ? "" : "not "), "ok 8\n"; +print +($fastcwd =~ m|$want$| ? "" : "not "), "ok 9\n"; +print +($fastgetcwd =~ m|$want$| ? "" : "not "), "ok 10\n"; # Cwd::chdir should also update $ENV{PWD} -print +($ENV{PWD} =~ m|$want$| ? "" : "not "), "ok 7\n"; +print +($ENV{PWD} =~ m|$want$| ? "" : "not "), "ok 11\n"; Cwd::chdir ".."; rmdir "dir"; Cwd::chdir ".."; rmdir "a"; Cwd::chdir ".."; rmdir "to"; Cwd::chdir ".."; rmdir "path"; Cwd::chdir ".."; rmdir "pteerslt"; -print +($ENV{PWD} =~ m|\bt$| ? "" : "not "), "ok 8\n"; +print +($ENV{PWD} =~ m|\bt$| ? "" : "not "), "ok 12\n"; if ($Config{d_symlink}) { my @dirs = split " " => $Config{libpth}; @@ -58,13 +86,13 @@ if ($Config{d_symlink}) { my $abs_path = Cwd::abs_path($rel); my $fast_abs_path = Cwd::fast_abs_path($rel); - print +($abs_path eq $target ? "" : "not "), "ok 9\n"; - print +($fast_abs_path eq $target ? "" : "not "), "ok 10\n"; + print +($abs_path eq $target ? "" : "not "), "ok 13\n"; + print +($fast_abs_path eq $target ? "" : "not "), "ok 14\n"; chdir ".."; rmdir "pteerslt"; unlink "linktest"; } else { - print "ok 9 # Skip: no symlink\n"; - print "ok 10 # Skip: no symlink\n"; + print "ok 13 # skipped\n"; + print "ok 14 # skipped\n"; } diff --git a/t/op/bop.t b/t/op/bop.t index 0354f009f9..c433875aa8 100755 --- a/t/op/bop.t +++ b/t/op/bop.t @@ -99,12 +99,20 @@ print "ok 35\n" if sprintf("%vd", $a) eq '248.444'; # UTF8 ~ behaviour # +my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; + my @not36; for (0x100...0xFFF) { $a = ~(chr $_); - push @not36, sprintf("%#03X", $_) - if $a ne chr(~$_) or length($a) != 1 or ~$a ne chr($_); + if ($Is_EBCDIC) { + push @not36, sprintf("%#03X", $_) + if $a ne chr(~$_) or length($a) != 1; + } + else { + push @not36, sprintf("%#03X", $_) + if $a ne chr(~$_) or length($a) != 1 or ~$a ne chr($_); + } } if (@not36) { print "# test 36 failed\n"; @@ -117,10 +125,17 @@ my @not37; for my $i (0xEEE...0xF00) { for my $j (0x0..0x120) { $a = ~(chr ($i) . chr $j); - push @not37, sprintf("%#03X %#03X", $i, $j) - if $a ne chr(~$i).chr(~$j) or - length($a) != 2 or - ~$a ne chr($i).chr($j); + if ($Is_EBCDIC) { + push @not37, sprintf("%#03X %#03X", $i, $j) + if $a ne chr(~$i).chr(~$j) or + length($a) != 2; + } + else { + push @not37, sprintf("%#03X %#03X", $i, $j) + if $a ne chr(~$i).chr(~$j) or + length($a) != 2 or + ~$a ne chr($i).chr($j); + } } } if (@not37) { @@ -129,7 +144,7 @@ if (@not37) { } print "ok 37\n"; -print "not " unless ~chr(~0) eq "\0"; +print "not " unless ~chr(~0) eq "\0" or $Is_EBCDIC; print "ok 38\n"; my @not39; diff --git a/t/op/vec.t b/t/op/vec.t index 7fe0974770..4b8934d7a2 100755 --- a/t/op/vec.t +++ b/t/op/vec.t @@ -2,6 +2,8 @@ print "1..30\n"; +my $Is_EBCDIC = (ord('A') == 193) ? 1 : 0; + print vec($foo,0,1) == 0 ? "ok 1\n" : "not ok 1\n"; print length($foo) == 0 ? "ok 2\n" : "not ok 2\n"; vec($foo,0,1) = 1; @@ -62,8 +64,14 @@ print "ok 25\n"; eval { vec($foo, 1, 8) = 13 }; print "not " if $@; print "ok 26\n"; -print "not " if $foo ne "\xc4\x0d\xc3\xbf\xc3\xbe"; -print "ok 27\n"; +if ($Is_EBCDIC) { + print "not " if $foo ne "\x8c\x0d\xff\x8a\x69"; + print "ok 27\n"; +} +else { + print "not " if $foo ne "\xc4\x0d\xc3\xbf\xc3\xbe"; + print "ok 27\n"; +} $foo = "\x{100}" . "\xff\xfe"; $x = substr $foo, 1; vec($x, 2, 4) = 7; diff --git a/t/op/ver.t b/t/op/ver.t index e248a48482..2eddabd22d 100755 --- a/t/op/ver.t +++ b/t/op/ver.t @@ -128,8 +128,14 @@ print "ok $test\n"; ++$test; } print "ok $test\n"; ++$test; - print "not " unless - sprintf("%vd", 1.22.333.4444) eq '1.22.197.141.225.133.156'; + if (ord("\t") == 9) { # ASCII + print "not " unless + sprintf("%vd", 1.22.333.4444) eq '1.22.197.141.225.133.156'; + } + else { + print "not " unless + sprintf("%vd", 1.22.333.4444) eq '1.22.142.84.187.81.112'; + } print "ok $test\n"; ++$test; if (ord("\t") == 9) { # ASCII @@ -140,7 +146,12 @@ print "ok $test\n"; ++$test; } print "ok $test\n"; ++$test; - print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.C5.8D.E1.85.9C'; + if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.C5.8D.E1.85.9C'; + } + else { + print "not " unless sprintf("%vX", v1.22.333.4444) eq '1.16.8E.54.BB.51.70'; + } print "ok $test\n"; ++$test; if (ord("\t") == 9) { # ASCII @@ -151,8 +162,14 @@ print "ok $test\n"; ++$test; } print "ok $test\n"; ++$test; - print "not " unless sprintf("%*vb", "##", v1.22.333.4444) - eq '1##10110##11000101##10001101##11100001##10000101##10011100'; + if (ord("\t") == 9) { # ASCII + print "not " unless sprintf("%*vb", "##", v1.22.333.4444) + eq '1##10110##11000101##10001101##11100001##10000101##10011100'; + } + else { + print "not " unless sprintf("%*vb", "##", v1.22.333.4444) + eq '1##10110##10001110##1010100##10111011##1010001##1110000'; + } print "ok $test\n"; ++$test; } @@ -187,7 +187,8 @@ S_tokereport(pTHX_ char *thing, char* s, I32 rv) SV *report; DEBUG_T({ report = newSVpv(thing, 0); - Perl_sv_catpvf(aTHX_ report, ":line %i:%i:", CopLINE(PL_curcop), rv); + Perl_sv_catpvf(aTHX_ report, ":line %d:%"IVdf":", CopLINE(PL_curcop), + (IV)rv); if (s - PL_bufptr > 0) sv_catpvn(report, PL_bufptr, s - PL_bufptr); diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 896d05f5c8..932e015433 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -35,6 +35,8 @@ $Config{startperl} print OUT <<'!NO!SUBS!'; +use warnings; + =head1 NAME h2xs - convert .h C header files to Perl extensions @@ -471,7 +473,9 @@ $opt_c = 1 if $opt_A; $opt_c = $opt_f = 1 if $opt_X; my %const_xsub = map { $_,1 } split(/,+/, $opt_s) if $opt_s; -my $extralibs; + +my $extralibs = ''; + my @path_h; while (my $arg = shift) { @@ -635,7 +639,8 @@ if( @path_h ){ my ($ext, $nested, @modparts, $modfname, $modpname); -(chdir 'ext', $ext = 'ext/') if -d 'ext'; + +$ext = chdir 'ext' ? 'ext/' : ''; if( $module =~ /::/ ){ $nested = 1; @@ -896,7 +901,7 @@ sub AUTOLOAD { my \$constname; $tmp (\$constname = \$AUTOLOAD) =~ s/.*:://; - croak "&$module::constant not defined" if \$constname eq 'constant'; + croak "&${module}::constant not defined" if \$constname eq 'constant'; my \$val = constant(\$constname, \@_ ? \$_[0] : 0); if (\$! != 0) { if (\$! =~ /Invalid/ || \$!{EINVAL}) { @@ -1196,7 +1201,7 @@ END for my $n (@$list) { my $c = substr $n, $off, 1; $leading{$c} = [] unless exists $leading{$c}; - push @{$leading{$c}}, substr $n, $off + 1; + push @{$leading{$c}}, $off < length $n ? substr $n, $off + 1 : $n } if (keys(%leading) == 1) { @@ -1287,7 +1292,7 @@ if( ! $opt_c ) { static int not_here(char *s) { - croak("$module::%s not implemented on this architecture", s); + croak("${module}::%s not implemented on this architecture", s); return -1; } @@ -1298,8 +1303,7 @@ END print_tievar_subs(\*XS, $_, $vdecl_hash{$_}) for @vdecls; -my $prefix; -$prefix = "PREFIX = $opt_p" if defined $opt_p; +my $prefix = defined $opt_p ? "PREFIX = $opt_p" : ''; # Now switch from C to XS by issuing the first MODULE declaration: print XS <<"END"; @@ -1634,7 +1638,7 @@ sub normalize_type { # Second arg: do not strip const's before \* else { $type =~ s/$ignore_mods//go; } - $type =~ s/([^\s\w])/ \1 /g; + $type =~ s/([^\s\w])/ $1 /g; $type =~ s/\s+$//; $type =~ s/^\s+//; $type =~ s/\s+/ /g; @@ -1745,7 +1749,7 @@ EOC print PL <<END; 'LIBS' => ['$extralibs'], # e.g., '-lm' 'DEFINE' => '$opt_F', # e.g., '-DHAVE_SOMETHING' -$Icomment 'INC' => '$I', # e.g., '$Ihelp-I/usr/include/other' +$Icomment 'INC' => '$I', # e.g., '${Ihelp}-I/usr/include/other' END my $C = grep $_ ne "$modfname.c", (glob '*.c'), (glob '*.cc'), (glob '*.C'); |