summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-12-30 10:03:43 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-12-30 10:03:43 +0000
commitd75503f100dffe40d0168c3895f6edca03ac3346 (patch)
treeb0683a01eb86150f865ff6ed11b4a1c82df80359
parenta06d4b7fa7822309a686f69b7ef2469437e518ec (diff)
parentd6171bb7b09dc5d1334c6ea447ccef40cc47f9fd (diff)
downloadperl-d75503f100dffe40d0168c3895f6edca03ac3346.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@13945
-rw-r--r--Changes187
-rw-r--r--XSUB.h2
-rwxr-xr-xext/DB_File/t/db-btree.t7
-rwxr-xr-xext/DB_File/t/db-hash.t1
-rwxr-xr-xext/DB_File/t/db-recno.t3
-rw-r--r--ext/Devel/DProf/DProf.t2
-rw-r--r--ext/PerlIO/t/encoding.t8
-rw-r--r--ext/SDBM_File/sdbm.t2
-rw-r--r--ext/Storable/t/store.t2
-rw-r--r--lib/strict.t6
-rw-r--r--os2/os2.c22
-rw-r--r--patchlevel.h2
-rw-r--r--perl.h2
-rwxr-xr-xt/cmd/while.t2
-rwxr-xr-xt/comp/cpp.aux4
-rwxr-xr-xt/comp/multiline.t2
-rwxr-xr-xt/comp/require.t2
-rwxr-xr-xt/comp/script.t2
-rwxr-xr-xt/io/argv.t12
-rwxr-xr-xt/io/dup.t8
-rw-r--r--t/lib/filter-util.pl2
-rwxr-xr-xt/op/anonsub.t2
-rwxr-xr-xt/op/do.t10
-rw-r--r--t/op/inccode.t120
-rwxr-xr-xt/op/runlevel.t2
-rwxr-xr-xt/op/write.t16
-rw-r--r--t/run/switches.t6
-rw-r--r--win32/include/netdb.h8
-rw-r--r--win32/include/sys/socket.h14
-rw-r--r--win32/perlhost.h56
-rw-r--r--win32/vmem.h20
-rw-r--r--wince/include/errno.h2
-rw-r--r--wince/include/netdb.h8
-rw-r--r--wince/include/sys/socket.h20
-rw-r--r--wince/include/sys/stat.h2
-rw-r--r--wince/perllib.c2
-rw-r--r--wince/perlmain.c4
-rw-r--r--wince/win32.h4
-rw-r--r--wince/win32iop.h2
-rw-r--r--wince/win32thread.c2
-rw-r--r--wince/win32thread.h2
-rw-r--r--wince/wince.c14
-rw-r--r--wince/wince.h18
-rw-r--r--wince/wincesck.c8
-rw-r--r--x2p/a2py.c2
45 files changed, 417 insertions, 207 deletions
diff --git a/Changes b/Changes
index cc5629aa40..f9ac71145a 100644
--- a/Changes
+++ b/Changes
@@ -31,6 +31,193 @@ or any other branch.
Version v5.7.2 Development release working toward v5.8
--------------
____________________________________________________________________________
+[ 13942] By: jhi on 2001/12/29 21:12:02
+ Log: Subject: [PATCH] cleaner close on tests, take 2
+ From: andreas.koenig@anima.de (Andreas J. Koenig)
+ Date: 29 Dec 2001 21:42:37 +0100
+ Message-ID: <m33d1tvjuq.fsf@anima.de>
+
+ (the DB_File patches)
+ Branch: perl
+ ! ext/DB_File/t/db-btree.t ext/DB_File/t/db-hash.t
+ ! ext/DB_File/t/db-recno.t
+____________________________________________________________________________
+[ 13941] By: jhi on 2001/12/29 20:25:22
+ Log: Integrate perlio; regen'ed config_H.?c
+ Branch: perl
+ !> win32/config_H.bc win32/config_H.gc win32/config_H.vc
+____________________________________________________________________________
+[ 13940] By: jhi on 2001/12/29 20:22:57
+ Log: Subject: [PATCH] cleaner close on tests, take 2
+ From: andreas.koenig@anima.de (Andreas J. Koenig)
+ Date: 29 Dec 2001 21:42:37 +0100
+ Message-ID: <m33d1tvjuq.fsf@anima.de>
+
+ (except for the three DB_File patch fragments)
+ Branch: perl
+ ! ext/Devel/DProf/DProf.t ext/PerlIO/t/encoding.t
+ ! ext/SDBM_File/sdbm.t ext/Storable/t/store.t lib/strict.t
+ ! t/cmd/while.t t/comp/cpp.aux t/comp/multiline.t
+ ! t/comp/require.t t/comp/script.t t/io/argv.t t/io/dup.t
+ ! t/lib/filter-util.pl t/op/anonsub.t t/op/do.t t/op/inccode.t
+ ! t/op/runlevel.t t/op/write.t t/run/switches.t
+____________________________________________________________________________
+[ 13939] By: jhi on 2001/12/29 20:17:55
+ Log: Subject: [PATCH] from the non-ANSI comment police (was: it won't compile on win32)
+ From: "H.Merijn Brand" <h.m.brand@hccnet.nl>
+ Date: Sat, 29 Dec 2001 20:38:59 +0100
+ Message-Id: <20011229203646.24CF.H.M.BRAND@hccnet.nl>
+
+ (NetWare tree not touched because it's very //)
+ Branch: perl
+ ! XSUB.h os2/os2.c perl.h win32/include/netdb.h
+ ! win32/include/sys/socket.h win32/perlhost.h win32/vmem.h
+ ! wince/include/errno.h wince/include/netdb.h
+ ! wince/include/sys/socket.h wince/include/sys/stat.h
+ ! wince/perllib.c wince/perlmain.c wince/win32.h
+ ! wince/win32iop.h wince/win32thread.c wince/win32thread.h
+ ! wince/wince.c wince/wince.h wince/wincesck.c x2p/a2py.c
+____________________________________________________________________________
+[ 13937] By: jhi on 2001/12/29 18:28:36
+ Log: Give up on serious testing of langinfo(). Leave the old
+ code in place, though.
+ Branch: perl
+ ! ext/I18N/Langinfo/Langinfo.t
+____________________________________________________________________________
+[ 13935] By: jhi on 2001/12/29 17:36:08
+ Log: Integrate perlio;
+
+ Define the two socket error numbers in terms of WSAEXXXXX equivalents
+
+ Fudge Config.pm so File::Spec does not croak.
+ Branch: perl
+ !> win32/FindExt.pm win32/win32.h
+____________________________________________________________________________
+[ 13932] By: jhi on 2001/12/29 17:24:24
+ Log: VOS tweaks from Paul Green.
+
+ The Configure tweaks: the _exe needs to be
+ set after the init; VOS has fd 3 hardwired to /dev/tty;
+ the grep/ln/make substitutions really need to stick.
+ Branch: perl
+ ! Configure hints/vos.sh perl.h util.c vos/build.cm
+ ! vos/config.alpha.def vos/config.alpha.h vos/config.ga.def
+ ! vos/config.ga.h vos/vosish.h
+____________________________________________________________________________
+[ 13930] By: jhi on 2001/12/29 15:35:00
+ Log: Subject: [PATCH] Pod whitespace cleanup, round 0.
+ From: coral@eekeek.org
+ Date: Fri, 28 Dec 2001 19:58:22 -0500
+ Message-Id: <200112290058.fBT0wMD26750@eekeek.org>
+ Branch: perl
+ ! pod/perl561delta.pod pod/perl572delta.pod pod/perlapi.pod
+ ! pod/perldelta.pod pod/perlfaq4.pod pod/perlfaq6.pod
+ ! pod/perlfaq7.pod pod/perlfunc.pod pod/perlpacktut.pod
+ ! pod/perlunicode.pod pod/perlxs.pod util.c
+____________________________________________________________________________
+[ 13929] By: jhi on 2001/12/29 15:31:20
+ Log: op/exec Win32 patch from Schwern via Abe Timmerman.
+ Branch: perl
+ ! t/op/exec.t
+____________________________________________________________________________
+[ 13928] By: jhi on 2001/12/29 15:30:14
+ Log: Subject: [PATCH lib/Pod/t/InputObjects.t]
+ From: Abe Timmerman <abe@ztreet.demon.nl>
+ Date: Sat, 29 Dec 2001 13:10:06 +0100
+ Message-ID: <cibr2u4f2ksggo4bgt8ijdkfn783avvvj4@4ax.com>
+ Branch: perl
+ + lib/Pod/t/InputObjects.t
+____________________________________________________________________________
+[ 13927] By: jhi on 2001/12/29 15:27:39
+ Log: Integrate perlio;
+
+ Quick fix (after couple of clever fixes failed) for
+ "accept leaks memory" fail [ID 20011223.001]
+
+ Nick Clark's embed.pl fix for my_socketpair
+ Branch: perl
+ !> embed.h embed.pl global.sym pod/perlapi.pod pp_sys.c proto.h
+____________________________________________________________________________
+[ 13925] By: jhi on 2001/12/29 15:21:53
+ Log: Slight tweaks on the MM_Win32.t.
+ Branch: perl
+ ! lib/ExtUtils/t/MM_Win32.t
+____________________________________________________________________________
+[ 13924] By: jhi on 2001/12/29 15:16:47
+ Log: Subject: [PATCH lib/ExtUtils/t/MM_Win32.t]
+ From: Abe Timmerman <abe@ztreet.demon.nl>
+ Date: Sat, 29 Dec 2001 12:51:36 +0100
+ Message-ID: <bmar2u8jdib45442jh1ht3e3i1qhlaek59@4ax.com>
+ Branch: perl
+ + lib/ExtUtils/t/MM_Win32.t
+ ! MANIFEST
+____________________________________________________________________________
+[ 13922] By: jhi on 2001/12/29 15:09:00
+ Log: Subject: [PATCH] Module names and other nits
+ From: Autrijus Tang <autrijus@autrijus.org>
+ Date: Sat, 29 Dec 2001 01:59:28 +0800
+ Message-ID: <20011229015928.A29712@geb.elixus.org>
+ Branch: perl
+ ! lib/Exporter/Heavy.pm pod/perl561delta.pod pod/perl56delta.pod
+ ! pod/perldebguts.pod pod/perldebug.pod pod/perlfaq4.pod
+ ! pod/perlfaq6.pod pod/perlfunc.pod pod/perlguts.pod
+ ! pod/perlpacktut.pod pod/perlsub.pod pod/perltodo.pod
+ ! pod/perlunicode.pod pod/perlutil.pod pod/perlxs.pod
+____________________________________________________________________________
+[ 13921] By: jhi on 2001/12/29 15:05:08
+ Log: socketpair tweaks from Nicholas Clark.
+ Branch: perl
+ ! ext/Socket/socketpair.t util.c
+____________________________________________________________________________
+[ 13919] By: jhi on 2001/12/28 17:01:39
+ Log: Retract #13917.
+ Branch: perl
+ ! doop.c
+____________________________________________________________________________
+[ 13918] By: jhi on 2001/12/28 17:00:53
+ Log: Subject: provisional MakeMaker patch for VMS
+ From: "Craig A. Berry" <craigberry@mac.com>
+ Date: Thu, 27 Dec 2001 22:29:37 -0600
+ Message-Id: <a05101004b8515264aa3a@[172.16.52.1]>
+ Branch: perl
+ ! lib/ExtUtils/MM_Unix.pm lib/ExtUtils/MM_VMS.pm
+____________________________________________________________________________
+[ 13917] By: jhi on 2001/12/28 16:57:19
+ Log: (retracted by #13919)
+ Branch: perl
+ ! doop.c
+____________________________________________________________________________
+[ 13915] By: jhi on 2001/12/28 01:16:45
+ Log: Remove debris in any case.
+ Branch: perl
+ ! Configure
+____________________________________________________________________________
+[ 13914] By: jhi on 2001/12/28 00:22:10
+ Log: Subject: [PATCH] Re: B::walksymtable oddness
+ From: "Mattia Barbon" <mbarbon@dsi.unive.it>
+ Date: Thu, 27 Dec 2001 19:14:24 +0100
+ Message-ID: <3C2B7310.861.18820D0@localhost>
+ Branch: perl
+ ! ext/B/B.pm
+____________________________________________________________________________
+[ 13913] By: jhi on 2001/12/27 23:57:34
+ Log: Subject: [PATCH] because (sys)?read doesn't reset buffers
+ From: Nicholas Clark <nick@unfortu.net>
+ Date: Fri, 28 Dec 2001 00:43:02 +0000
+ Message-ID: <20011228004301.B23373@Bagpuss.unfortu.net>
+ Branch: perl
+ ! ext/Socket/socketpair.t
+____________________________________________________________________________
+[ 13912] By: jhi on 2001/12/27 23:56:20
+ Log: Fast Latin1<->UTF-8 conversion for older Perls.
+ Branch: perl
+ ! pod/perluniintro.pod
+____________________________________________________________________________
+[ 13911] By: jhi on 2001/12/27 14:52:45
+ Log: Update Changes.
+ Branch: perl
+ ! Changes patchlevel.h
+____________________________________________________________________________
[ 13910] By: jhi on 2001/12/27 14:32:23
Log: More wait status trickery for BeOS.
Branch: perl
diff --git a/XSUB.h b/XSUB.h
index e05b369588..a6dfdc4c6c 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -281,7 +281,7 @@ C<xsubpp>. See L<perlxs/"The VERSIONCHECK: Keyword">.
# undef ungetc
# undef fileno
-//Following symbols were giving redefinition errors while building extensions - sgp 17th Oct 2000
+/* Following symbols were giving redefinition errors while building extensions - sgp 17th Oct 2000 */
#ifdef NETWARE
# undef readdir
# undef fstat
diff --git a/ext/DB_File/t/db-btree.t b/ext/DB_File/t/db-btree.t
index 62cccd706e..ef05de6946 100755
--- a/ext/DB_File/t/db-btree.t
+++ b/ext/DB_File/t/db-btree.t
@@ -156,6 +156,7 @@ ok(18, $@ =~ /^DB_File::BTREEINFO::FETCH - Unknown element 'fred' at/ ) ;
my ($X, %h) ;
ok(19, $X = tie(%h, 'DB_File',$Dfile, O_RDWR|O_CREAT, 0640, $DB_BTREE )) ;
+die "Could not tie: $!" unless $X;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
@@ -525,9 +526,9 @@ $dbh3->{compare} = sub { length $_[0] <=> length $_[1] } ;
my (%g, %k);
-tie(%h, 'DB_File',$Dfile1, O_RDWR|O_CREAT, 0640, $dbh1 ) ;
-tie(%g, 'DB_File',$Dfile2, O_RDWR|O_CREAT, 0640, $dbh2 ) ;
-tie(%k, 'DB_File',$Dfile3, O_RDWR|O_CREAT, 0640, $dbh3 ) ;
+tie(%h, 'DB_File',$Dfile1, O_RDWR|O_CREAT, 0640, $dbh1 ) or die $!;
+tie(%g, 'DB_File',$Dfile2, O_RDWR|O_CREAT, 0640, $dbh2 ) or die $!;
+tie(%k, 'DB_File',$Dfile3, O_RDWR|O_CREAT, 0640, $dbh3 ) or die $!;
my @Keys = qw( 0123 12 -1234 9 987654321 def ) ;
my (@srt_1, @srt_2, @srt_3);
diff --git a/ext/DB_File/t/db-hash.t b/ext/DB_File/t/db-hash.t
index 81851e16c8..931b03c96a 100755
--- a/ext/DB_File/t/db-hash.t
+++ b/ext/DB_File/t/db-hash.t
@@ -125,6 +125,7 @@ ok(14, $@ =~ /^DB_File::HASHINFO::FETCH - Unknown element 'fred' at/ );
# Now check the interface to HASH
my ($X, %h);
ok(15, $X = tie(%h, 'DB_File',$Dfile, O_RDWR|O_CREAT, 0640, $DB_HASH ) );
+die "Could not tie: $!" unless $X;
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
diff --git a/ext/DB_File/t/db-recno.t b/ext/DB_File/t/db-recno.t
index a676759d07..339baec22c 100755
--- a/ext/DB_File/t/db-recno.t
+++ b/ext/DB_File/t/db-recno.t
@@ -444,7 +444,7 @@ unlink $Dfile;
1 ;
EOM
- close FILE ;
+ close FILE or die "Could not close: $!";
BEGIN { push @INC, '.'; }
eval 'use SubDB ; ';
@@ -454,6 +454,7 @@ EOM
eval '
$X = tie(@h, "SubDB","recno.tmp", O_RDWR|O_CREAT, 0640, $DB_RECNO );
' ;
+ die "Could not tie: $!" unless $X;
main::ok(68, $@ eq "") ;
diff --git a/ext/Devel/DProf/DProf.t b/ext/Devel/DProf/DProf.t
index be711f1330..5ecba68b5b 100644
--- a/ext/Devel/DProf/DProf.t
+++ b/ext/Devel/DProf/DProf.t
@@ -49,7 +49,7 @@ sub profile {
my $t_start = new Benchmark;
open( R, "$perl \"$opt_d\" $test |" ) || warn "$0: Can't run. $!\n";
@results = <R>;
- close R;
+ close R or warn "Could not close: $!";
my $t_total = timediff( new Benchmark, $t_start );
if( $opt_v ){
diff --git a/ext/PerlIO/t/encoding.t b/ext/PerlIO/t/encoding.t
index e30e270535..eb523ca80d 100644
--- a/ext/PerlIO/t/encoding.t
+++ b/ext/PerlIO/t/encoding.t
@@ -19,7 +19,7 @@ my $russki = "koi8r$$";
if (open(GRK, ">$grk")) {
# alpha beta gamma in ISO 8859-7
print GRK "\xe1\xe2\xe3";
- close GRK;
+ close GRK or die "Could not close: $!";
}
{
@@ -30,7 +30,7 @@ if (open(GRK, ">$grk")) {
print "ok 2\n";
print $o readline($i);
print "ok 3\n";
- close($o);
+ close($o) or die "Could not close: $!";
close($i);
}
@@ -49,7 +49,7 @@ if (open(UTF, "<$utf")) {
print "ok 6\n";
print $o readline($i);
print "ok 7\n";
- close($o);
+ close($o) or die "Could not close: $!";
close($i);
}
@@ -76,7 +76,7 @@ if (!defined $warn) {
if (open(RUSSKI, ">$russki")) {
print RUSSKI "\x3c\x3f\x78";
- close RUSSKI;
+ close RUSSKI or die "Could not close: $!";
open(RUSSKI, "$russki");
binmode(RUSSKI, ":raw");
my $buf1;
diff --git a/ext/SDBM_File/sdbm.t b/ext/SDBM_File/sdbm.t
index e1ed259bfa..f1a5c63169 100644
--- a/ext/SDBM_File/sdbm.t
+++ b/ext/SDBM_File/sdbm.t
@@ -183,7 +183,7 @@ print ($h{''} eq 'bar' ? "ok 12\n" : "not ok 12\n");
1 ;
EOM
- close FILE ;
+ close FILE or die "Could not close: $!";
BEGIN { push @INC, '.'; }
diff --git a/ext/Storable/t/store.t b/ext/Storable/t/store.t
index d26755f129..b09b125c0d 100644
--- a/ext/Storable/t/store.t
+++ b/ext/Storable/t/store.t
@@ -113,7 +113,7 @@ eval { $r = fd_retrieve(::OUT); };
print "not " unless $@;
print "ok 20\n";
-close OUT;
+close OUT or die "Could not close: $!";
END { 1 while unlink 'store' }
diff --git a/lib/strict.t b/lib/strict.t
index 3a0a2eca8f..f03271b536 100644
--- a/lib/strict.t
+++ b/lib/strict.t
@@ -31,7 +31,7 @@ foreach (sort glob($^O eq 'MacOS' ? ":lib::strict:*" : "lib/strict/*")) {
local $/ = undef;
@prgs = (@prgs, split "\n########\n", <F>) ;
}
- close F ;
+ close F or die "Could not close: $!" ;
}
undef $/;
@@ -59,7 +59,7 @@ for (@prgs){
push @temps, $filename ;
open F, ">$filename" or die "Cannot open $filename: $!\n" ;
print F $code ;
- close F ;
+ close F or die "Could not close: $!" ;
}
shift @files ;
$prog = shift @files ;
@@ -67,7 +67,7 @@ for (@prgs){
}
open TEST, ">$tmpfile";
print TEST $prog,"\n";
- close TEST;
+ close TEST or die "Could not close: $!";
my $results = $Is_MSWin32 ?
`.\\perl -I../lib $switch $tmpfile 2>&1` :
$^O eq 'NetWare' ?
diff --git a/os2/os2.c b/os2/os2.c
index 655e613a92..830d900163 100644
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -2744,21 +2744,21 @@ my_flock(int handle, int o)
if (!(_emx_env & 0x200) || !use_my)
return flock(handle, o); /* Delegate to EMX. */
- // is this a file?
+ /* is this a file? */
if ((DosQueryHType(handle, &handle_type, &flag_word) != 0) ||
(handle_type & 0xFF))
{
errno = EBADF;
return -1;
}
- // set lock/unlock ranges
+ /* set lock/unlock ranges */
rNull.lOffset = rNull.lRange = rFull.lOffset = 0;
rFull.lRange = 0x7FFFFFFF;
- // set timeout for blocking
+ /* set timeout for blocking */
timeout = ((blocking = !(o & LOCK_NB))) ? 100 : 1;
- // shared or exclusive?
+ /* shared or exclusive? */
shared = (o & LOCK_SH) ? 1 : 0;
- // do not block the unlock
+ /* do not block the unlock */
if (o & (LOCK_UN | LOCK_SH | LOCK_EX)) {
rc = DosSetFileLocks(handle, &rFull, &rNull, timeout, shared);
switch (rc) {
@@ -2772,7 +2772,7 @@ my_flock(int handle, int o)
errno = ENOLCK;
return -1;
case ERROR_LOCK_VIOLATION:
- break; // not an error
+ break; /* not an error */
case ERROR_INVALID_PARAMETER:
case ERROR_ATOMIC_LOCK_NOT_SUPPORTED:
case ERROR_READ_LOCKS_NOT_SUPPORTED:
@@ -2786,9 +2786,9 @@ my_flock(int handle, int o)
return -1;
}
}
- // lock may block
+ /* lock may block */
if (o & (LOCK_SH | LOCK_EX)) {
- // for blocking operations
+ /* for blocking operations */
for (;;) {
rc =
DosSetFileLocks(
@@ -2826,7 +2826,7 @@ my_flock(int handle, int o)
errno = EINVAL;
return -1;
}
- // give away timeslice
+ /* give away timeslice */
DosSleep(1);
}
}
@@ -2880,7 +2880,7 @@ my_getpwent (void)
if (!use_my_pwent())
return getpwent(); /* Delegate to EMX. */
if (pwent_cnt++)
- return 0; // Return one entry only
+ return 0; /* Return one entry only */
return getpwuid(0);
}
@@ -2901,7 +2901,7 @@ struct group *
getgrent (void)
{
if (grent_cnt++)
- return 0; // Return one entry only
+ return 0; /* Return one entry only */
return getgrgid(0);
}
diff --git a/patchlevel.h b/patchlevel.h
index 19ed3e4934..43b0520604 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
- ,"DEVEL13910"
+ ,"DEVEL13942"
,NULL
};
diff --git a/perl.h b/perl.h
index ab7742252d..ddea22b0a4 100644
--- a/perl.h
+++ b/perl.h
@@ -254,7 +254,7 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
#if defined(HASVOLATILE) || defined(STANDARD_C)
# ifdef __cplusplus
-# define VOL // to temporarily suppress warnings
+# define VOL /* to temporarily suppress warnings */
# else
# define VOL volatile
# endif
diff --git a/t/cmd/while.t b/t/cmd/while.t
index ecc15eda53..226db471ef 100755
--- a/t/cmd/while.t
+++ b/t/cmd/while.t
@@ -8,7 +8,7 @@ print tmp "tvi920\n";
print tmp "vt100\n";
print tmp "Amiga\n";
print tmp "paper\n";
-close tmp;
+close tmp or die "Could not close: $!";
# test "last" command
diff --git a/t/comp/cpp.aux b/t/comp/cpp.aux
index 058903294e..9452bddbbe 100755
--- a/t/comp/cpp.aux
+++ b/t/comp/cpp.aux
@@ -25,11 +25,11 @@ X#endif
Xprint $ok;
END
print TRY $prog;
-close TRY;
+close TRY or die "Could not close Comp_cpp.tmp: $!";
open(TRY,">Comp_cpp.inc") || (die "Can't open temp include file: $!");
print TRY '#define OK "ok 3\n"' . "\n";
-close TRY;
+close TRY or die "Could not close Comp_cpp.tmp: $!";
print `$^X "-P" Comp_cpp.tmp`;
unlink "Comp_cpp.tmp", "Comp_cpp.inc";
diff --git a/t/comp/multiline.t b/t/comp/multiline.t
index 742ba4965d..78820c4e92 100755
--- a/t/comp/multiline.t
+++ b/t/comp/multiline.t
@@ -26,7 +26,7 @@ $y = 'now is the time' . "\n" .
is($x, $y, 'test data is sane');
print TRY $x;
-close TRY;
+close TRY or die "Could not close: $!";
open(TRY,'Comp.try') || (die "Can't reopen temp file.");
$count = 0;
diff --git a/t/comp/require.t b/t/comp/require.t
index 103a579235..ea4b96d20b 100755
--- a/t/comp/require.t
+++ b/t/comp/require.t
@@ -27,7 +27,7 @@ sub write_file {
binmode REQ;
use bytes;
print REQ @_;
- close REQ;
+ close REQ or die "Could not close $f: $!";
}
eval {require 5.005};
diff --git a/t/comp/script.t b/t/comp/script.t
index d70b767478..2dbdaf2afc 100755
--- a/t/comp/script.t
+++ b/t/comp/script.t
@@ -16,7 +16,7 @@ if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";}
open(try,">Comp.script") || (die "Can't open temp file.");
print try 'print "ok\n";'; print try "\n";
-close try;
+close try or die "Could not close: $!";
$x = `$Perl Comp.script`;
diff --git a/t/io/argv.t b/t/io/argv.t
index 56b5714488..a602a02259 100755
--- a/t/io/argv.t
+++ b/t/io/argv.t
@@ -15,7 +15,7 @@ my $devnull = File::Spec->devnull;
open(TRY, '>Io_argv1.tmp') || (die "Can't open temp file: $!");
print TRY "a line\n";
-close TRY;
+close TRY or die "Could not close: $!";
$x = runperl(
prog => 'while (<>) { print $., $_; }',
@@ -50,9 +50,9 @@ is($y, "1a line\n2a line\n3a line\n", '<> from @ARGV');
open(TRY, '>Io_argv1.tmp') or die "Can't open temp file: $!";
-close TRY;
+close TRY or die "Could not close: $!";
open(TRY, '>Io_argv2.tmp') or die "Can't open temp file: $!";
-close TRY;
+close TRY or die "Could not close: $!";
@ARGV = ('Io_argv1.tmp', 'Io_argv2.tmp');
$^I = '_bak'; # not .bak which confuses VMS
$/ = undef;
@@ -67,7 +67,7 @@ open(TRY, '<Io_argv1.tmp') or die "Can't open temp file: $!";
print while <TRY>;
open(TRY, '<Io_argv2.tmp') or die "Can't open temp file: $!";
print while <TRY>;
-close TRY;
+close TRY or die "Could not close: $!";
undef $^I;
ok( eof TRY );
@@ -95,7 +95,7 @@ ok( eof(), 'eof() true after closing ARGV' );
{
local $/;
- open F, 'Io_argv1.tmp' or die;
+ open F, 'Io_argv1.tmp' or die "Could not open Io_argv1.tmp: $!";
<F>; # set $. = 1
is( <F>, undef );
@@ -108,7 +108,7 @@ ok( eof(), 'eof() true after closing ARGV' );
open F, $devnull or die; # restart cycle again
ok( defined(<F>) );
is( <F>, undef );
- close F;
+ close F or die "Could not close: $!";
}
END { unlink 'Io_argv1.tmp', 'Io_argv1.tmp_bak', 'Io_argv2.tmp', 'Io_argv2.tmp_bak' }
diff --git a/t/io/dup.t b/t/io/dup.t
index 96fe3bedeb..6555d07274 100755
--- a/t/io/dup.t
+++ b/t/io/dup.t
@@ -40,11 +40,11 @@ else {
system sprintf "$echo 1>&2", 7;
}
-close(STDOUT);
-close(STDERR);
+close(STDOUT) or die "Could not close: $!";
+close(STDERR) or die "Could not close: $!";
-open(STDOUT,">&DUPOUT");
-open(STDERR,">&DUPERR");
+open(STDOUT,">&DUPOUT") or die "Could not open: $!";
+open(STDERR,">&DUPERR") or die "Could not open: $!";
if (($^O eq 'MSWin32') || ($^O eq 'NetWare') || ($^O eq 'VMS')) { print `type Io.dup` }
else { system 'cat Io.dup' }
diff --git a/t/lib/filter-util.pl b/t/lib/filter-util.pl
index 826d85307e..c378f221d7 100644
--- a/t/lib/filter-util.pl
+++ b/t/lib/filter-util.pl
@@ -25,7 +25,7 @@ sub writeFile
binmode(F) if $filename =~ /bin$/i;
foreach (@strings)
{ print F }
- close F ;
+ close F or die "Could not close: $!" ;
}
sub ok
diff --git a/t/op/anonsub.t b/t/op/anonsub.t
index fef40f935a..8eca75b811 100755
--- a/t/op/anonsub.t
+++ b/t/op/anonsub.t
@@ -26,7 +26,7 @@ for (@prgs){
my($prog,$expected) = split(/\nEXPECT\n/, $_);
open TEST, ">$tmpfile";
print TEST "$prog\n";
- close TEST;
+ close TEST or die "Could not close: $!";
my $results = $Is_VMS ?
`MCR $^X "-I[-.lib]" $switch $tmpfile 2>&1` :
$Is_MSWin32 ?
diff --git a/t/op/do.t b/t/op/do.t
index 913481feb1..744a62b3c3 100755
--- a/t/op/do.t
+++ b/t/op/do.t
@@ -61,31 +61,31 @@ unshift @INC, '.';
if (open(DO, ">$$.16")) {
print DO "ok(1, 'do in scalar context') if defined wantarray && not wantarray\n";
- close DO;
+ close DO or die "Could not close: $!";
}
my $a = do "$$.16";
if (open(DO, ">$$.17")) {
print DO "ok(1, 'do in list context') if defined wantarray && wantarray\n";
- close DO;
+ close DO or die "Could not close: $!";
}
my @a = do "$$.17";
if (open(DO, ">$$.18")) {
print DO "ok(1, 'do in void context') if not defined wantarray\n";
- close DO;
+ close DO or die "Could not close: $!";
}
do "$$.18";
# bug ID 20010920.007
eval qq{ do qq(a file that does not exist); };
-ok( !$@ );
+ok( !$@, "do on a non-existing file, first try" );
eval qq{ do uc qq(a file that does not exist); };
-ok( !$@ );
+ok( !$@, "do on a non-existing file, second try" );
END {
1 while unlink("$$.16", "$$.17", "$$.18");
diff --git a/t/op/inccode.t b/t/op/inccode.t
index bd66628c0a..49ab85fbc0 100644
--- a/t/op/inccode.t
+++ b/t/op/inccode.t
@@ -20,7 +20,7 @@ sub get_temp_fh {
push @tempfiles, $f;
open my $fh, ">$f" or die "Can't create $f: $!";
print $fh "package ".substr($_[0],0,-3)."; 1;";
- close $fh;
+ close $fh or die "Couldn't close: $!";
open $fh, $f or die "Can't open $f: $!";
return $fh;
}
@@ -39,22 +39,29 @@ sub fooinc {
push @INC, \&fooinc;
-ok( !eval { require Bar; 1 }, 'Trying non-magic package' );
-
-ok( eval { require Foo; 1 }, 'require() magic via code ref' );
-ok( exists $INC{'Foo.pm'}, ' %INC sees it' );
-is( ref $INC{'Foo.pm'}, 'CODE', ' key is a coderef in %INC' );
-is( $INC{'Foo.pm'}, \&fooinc, ' key is correct in %INC' );
-
-ok( eval "use Foo1; 1;", 'use()' );
-ok( exists $INC{'Foo1.pm'}, ' %INC sees it' );
-is( ref $INC{'Foo1.pm'}, 'CODE', ' key is a coderef in %INC' );
-is( $INC{'Foo1.pm'}, \&fooinc, ' key is correct in %INC' );
-
-ok( eval { do 'Foo2.pl'; 1 }, 'do()' );
-ok( exists $INC{'Foo2.pl'}, ' %INC sees it' );
-is( ref $INC{'Foo2.pl'}, 'CODE', ' key is a coderef in %INC' );
-is( $INC{'Foo2.pl'}, \&fooinc, ' key is correct in %INC' );
+my $evalret = eval { require Bar; 1 };
+ok( !$evalret, 'Trying non-magic package' );
+
+$evalret = eval { require Foo; 1 };
+die $@ if $@;
+ok( $evalret, 'require Foo; magic via code ref' );
+ok( exists $INC{'Foo.pm'}, ' %INC sees Foo.pm' );
+is( ref $INC{'Foo.pm'}, 'CODE', ' val Foo.pm is a coderef in %INC' );
+is( $INC{'Foo.pm'}, \&fooinc, ' val Foo.pm is correct in %INC' );
+
+$evalret = eval "use Foo1; 1;";
+die $@ if $@;
+ok( $evalret, 'use Foo1' );
+ok( exists $INC{'Foo1.pm'}, ' %INC sees Foo1.pm' );
+is( ref $INC{'Foo1.pm'}, 'CODE', ' val Foo1.pm is a coderef in %INC' );
+is( $INC{'Foo1.pm'}, \&fooinc, ' val Foo1.pm is correct in %INC' );
+
+$evalret = eval { do 'Foo2.pl'; 1 };
+die $@ if $@;
+ok( $evalret, 'do "Foo2.pl"' );
+ok( exists $INC{'Foo2.pl'}, ' %INC sees Foo2.pl' );
+is( ref $INC{'Foo2.pl'}, 'CODE', ' val Foo2.pl is a coderef in %INC' );
+is( $INC{'Foo2.pl'}, \&fooinc, ' val Foo2.pl is correct in %INC' );
pop @INC;
@@ -72,23 +79,28 @@ sub fooinc2 {
my $arrayref = [ \&fooinc2, 'Bar' ];
push @INC, $arrayref;
-ok( eval { require Foo; 1; }, 'Originally loaded packages preserved' );
-ok( !eval { require Foo3; 1; }, 'Original magic INC purged' );
-
-ok( eval { require Bar; 1 }, 'require() magic via array ref' );
-ok( exists $INC{'Bar.pm'}, ' %INC sees it' );
-is( ref $INC{'Bar.pm'}, 'ARRAY', ' key is an arrayref in %INC' );
-is( $INC{'Bar.pm'}, $arrayref, ' key is correct in %INC' );
-
-ok( eval "use Bar1; 1;", 'use()' );
-ok( exists $INC{'Bar1.pm'}, ' %INC sees it' );
-is( ref $INC{'Bar1.pm'}, 'ARRAY', ' key is an arrayref in %INC' );
-is( $INC{'Bar1.pm'}, $arrayref, ' key is correct in %INC' );
-
-ok( eval { do 'Bar2.pl'; 1 }, 'do()' );
-ok( exists $INC{'Bar2.pl'}, ' %INC sees it' );
-is( ref $INC{'Bar2.pl'}, 'ARRAY', ' key is an arrayref in %INC' );
-is( $INC{'Bar2.pl'}, $arrayref, ' key is correct in %INC' );
+$evalret = eval { require Foo; 1; };
+die $@ if $@;
+ok( $evalret, 'Originally loaded packages preserved' );
+$evalret = eval { require Foo3; 1; };
+ok( !$evalret, 'Original magic INC purged' );
+
+$evalret = eval { require Bar; 1 };
+die $@ if $@;
+ok( $evalret, 'require Bar; magic via array ref' );
+ok( exists $INC{'Bar.pm'}, ' %INC sees Bar.pm' );
+is( ref $INC{'Bar.pm'}, 'ARRAY', ' val Bar.pm is an arrayref in %INC' );
+is( $INC{'Bar.pm'}, $arrayref, ' val Bar.pm is correct in %INC' );
+
+ok( eval "use Bar1; 1;", 'use Bar1' );
+ok( exists $INC{'Bar1.pm'}, ' %INC sees Bar1.pm' );
+is( ref $INC{'Bar1.pm'}, 'ARRAY', ' val Bar1.pm is an arrayref in %INC' );
+is( $INC{'Bar1.pm'}, $arrayref, ' val Bar1.pm is correct in %INC' );
+
+ok( eval { do 'Bar2.pl'; 1 }, 'do "Bar2.pl"' );
+ok( exists $INC{'Bar2.pl'}, ' %INC sees Bar2.pl' );
+is( ref $INC{'Bar2.pl'}, 'ARRAY', ' val Bar2.pl is an arrayref in %INC' );
+is( $INC{'Bar2.pl'}, $arrayref, ' val Bar2.pl is correct in %INC' );
pop @INC;
@@ -105,33 +117,39 @@ sub FooLoader::INC {
my $href = bless( {}, 'FooLoader' );
push @INC, $href;
-ok( eval { require Quux; 1 }, 'require() magic via hash object' );
-ok( exists $INC{'Quux.pm'}, ' %INC sees it' );
+$evalret = eval { require Quux; 1 };
+die $@ if $@;
+ok( $evalret, 'require Quux; magic via hash object' );
+ok( exists $INC{'Quux.pm'}, ' %INC sees Quux.pm' );
is( ref $INC{'Quux.pm'}, 'FooLoader',
- ' key is an object in %INC' );
-is( $INC{'Quux.pm'}, $href, ' key is correct in %INC' );
+ ' val Quux.pm is an object in %INC' );
+is( $INC{'Quux.pm'}, $href, ' val Quux.pm is correct in %INC' );
pop @INC;
my $aref = bless( [], 'FooLoader' );
push @INC, $aref;
-ok( eval { require Quux1; 1 }, 'require() magic via array object' );
-ok( exists $INC{'Quux1.pm'}, ' %INC sees it' );
+$evalret = eval { require Quux1; 1 };
+die $@ if $@;
+ok( $evalret, 'require Quux1; magic via array object' );
+ok( exists $INC{'Quux1.pm'}, ' %INC sees Quux1.pm' );
is( ref $INC{'Quux1.pm'}, 'FooLoader',
- ' key is an object in %INC' );
-is( $INC{'Quux1.pm'}, $aref, ' key is correct in %INC' );
+ ' val Quux1.pm is an object in %INC' );
+is( $INC{'Quux1.pm'}, $aref, ' val Quux1.pm is correct in %INC' );
pop @INC;
my $sref = bless( \(my $x = 1), 'FooLoader' );
push @INC, $sref;
-ok( eval { require Quux2; 1 }, 'require() magic via scalar object' );
-ok( exists $INC{'Quux2.pm'}, ' %INC sees it' );
+$evalret = eval { require Quux2; 1 };
+die $@ if $@;
+ok( $evalret, 'require Quux2; magic via scalar object' );
+ok( exists $INC{'Quux2.pm'}, ' %INC sees Quux2.pm' );
is( ref $INC{'Quux2.pm'}, 'FooLoader',
- ' key is an object in %INC' );
-is( $INC{'Quux2.pm'}, $sref, ' key is correct in %INC' );
+ ' val Quux2.pm is an object in %INC' );
+is( $INC{'Quux2.pm'}, $sref, ' val Quux2.pm is correct in %INC' );
pop @INC;
@@ -146,9 +164,11 @@ push @INC, sub {
}
};
-ok( eval { require Toto; 1 }, 'require() magic via anonymous code ref' );
-ok( exists $INC{'Toto.pm'}, ' %INC sees it' );
-ok( ! ref $INC{'Toto.pm'}, q/ key isn't a ref in %INC/ );
-is( $INC{'Toto.pm'}, 'xyz', ' key is correct in %INC' );
+$evalret = eval { require Toto; 1 };
+die $@ if $@;
+ok( $evalret, 'require Toto; magic via anonymous code ref' );
+ok( exists $INC{'Toto.pm'}, ' %INC sees Toto.pm' );
+ok( ! ref $INC{'Toto.pm'}, q/ val Toto.pm isn't a ref in %INC/ );
+is( $INC{'Toto.pm'}, 'xyz', ' val Toto.pm is correct in %INC' );
pop @INC;
diff --git a/t/op/runlevel.t b/t/op/runlevel.t
index 03e253e6e6..6a10e8b4ab 100755
--- a/t/op/runlevel.t
+++ b/t/op/runlevel.t
@@ -31,7 +31,7 @@ for (@prgs){
my($prog,$expected) = split(/\nEXPECT\n/, $_);
open TEST, ">$tmpfile";
print TEST "$prog\n";
- close TEST;
+ close TEST or die "Could not close: $!";
my $results = $Is_VMS ?
`MCR $^X "-I[-.lib]" $switch $tmpfile 2>&1` :
$Is_MSWin32 ?
diff --git a/t/op/write.t b/t/op/write.t
index fdc6e56d86..24759965a4 100755
--- a/t/op/write.t
+++ b/t/op/write.t
@@ -36,7 +36,7 @@ $good = 'good';
$multiline = "forescore\nand\nseven years\n";
$foo = 'when in the course of human events it becomes necessary';
write(OUT);
-close OUT;
+close OUT or die "Could not close: $!";
$right =
"the quick brown fox
@@ -75,7 +75,7 @@ $good = 'good';
$multiline = "forescore\nand\nseven years\n";
$foo = 'when in the course of human events it becomes necessary';
write(OUT2);
-close OUT2;
+close OUT2 or die "Could not close: $!";
$right =
"the quick brown fox
@@ -118,7 +118,7 @@ $good = 'good';
$multiline = "forescore\nand\nseven years\n";
$foo = 'when in the course of human events it becomes necessary';
write(OUT2);
-close OUT2;
+close OUT2 or die "Could not close: $!";
$right =
"the brown quick fox
@@ -185,7 +185,7 @@ open(OUT3, '>Op_write.tmp') || die "Can't create Op_write.tmp";
$foo = 'fit ';
write(OUT3);
-close OUT3;
+close OUT3 or die "Could not close: $!";
$right =
"fit\n";
@@ -207,7 +207,7 @@ $this,$that
write LEX;
$that = 8;
write LEX;
- close LEX;
+ close LEX or die "Could not close: $!";
}
# LEX_INTERPNORMAL test
my %e = ( a => 1 );
@@ -217,7 +217,7 @@ format OUT4 =
.
open OUT4, ">Op_write.tmp" or die "Can't create Op_write.tmp";
write (OUT4);
-close OUT4;
+close OUT4 or die "Could not close: $!";
if (`$CAT Op_write.tmp` eq "1\n") {
print "ok 9\n";
1 while unlink "Op_write.tmp";
@@ -237,7 +237,7 @@ open(OUT10, '>Op_write.tmp') || die "Can't create Op_write.tmp";
$test1 = 12.95;
write(OUT10);
-close OUT10;
+close OUT10 or die "Could not close: $!";
$right = " 12.95 00012.95\n";
if (`$CAT Op_write.tmp` eq $right)
@@ -260,7 +260,7 @@ open(OUT11, '>Op_write.tmp') || die "Can't create Op_write.tmp";
$test1 = 12.95;
write(OUT11);
-close OUT11;
+close OUT11 or die "Could not close: $!";
$right =
"00012.95
diff --git a/t/run/switches.t b/t/run/switches.t
index 67331b63cd..f920f37ca7 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -77,7 +77,7 @@ INIT { print "block 3\n"; }
print "block 4\n";
END { print "block 5\n"; }
SWTEST
- close $f;
+ close $f or die "Could not close: $!";
$r = runperl(
switches => [ '-c' ],
progfile => $filename,
@@ -122,7 +122,7 @@ SKIP: {
#!perl -s
print $x
SWTEST
- close $f;
+ close $f or die "Could not close: $!";
$r = runperl(
switches => [ '-s' ],
progfile => $filename,
@@ -142,7 +142,7 @@ package swtest;
sub import { print map "<$_>", @_ }
1;
SWTESTPM
- close $f;
+ close $f or die "Could not close: $!";
$r = runperl(
switches => [ '-Mswtest' ],
prog => '1',
diff --git a/win32/include/netdb.h b/win32/include/netdb.h
index b0c5ea1949..43c03c7544 100644
--- a/win32/include/netdb.h
+++ b/win32/include/netdb.h
@@ -1,7 +1,7 @@
-// netdb.h
+/* netdb.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_NETDB
@@ -9,4 +9,4 @@
#include <sys/socket.h>
-#endif //_INC_NETDB
+#endif /* _INC_NETDB */
diff --git a/win32/include/sys/socket.h b/win32/include/sys/socket.h
index d1f1de6b6a..0f71ad855a 100644
--- a/win32/include/sys/socket.h
+++ b/win32/include/sys/socket.h
@@ -1,7 +1,7 @@
-// sys/socket.h
+/* sys/socket.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_SYS_SOCKET
#define _INC_SYS_SOCKET
@@ -109,9 +109,9 @@ void win32_endprotoent(void);
void win32_endservent(void);
#ifndef WIN32SCK_IS_STDSCK
-//
-// direct to our version
-//
+
+/* direct to our version */
+
#define htonl win32_htonl
#define htons win32_htons
#define ntohl win32_ntohl
@@ -176,4 +176,4 @@ void win32_endservent(void);
}
#endif
-#endif // _INC_SYS_SOCKET
+#endif /* _INC_SYS_SOCKET */
diff --git a/win32/perlhost.h b/win32/perlhost.h
index 9493a73187..475158fce5 100644
--- a/win32/perlhost.h
+++ b/win32/perlhost.h
@@ -210,7 +210,7 @@ protected:
DWORD m_dwEnvCount;
LPSTR* m_lppEnvList;
- BOOL m_bTopLevel; // is this a toplevel host?
+ BOOL m_bTopLevel; /* is this a toplevel host? */
static long num_hosts;
public:
inline int LastHost(void) { return num_hosts == 1L; };
@@ -2051,7 +2051,7 @@ CPerlHost::CPerlHost(CPerlHost& host)
CPerlHost::~CPerlHost(void)
{
-// Reset();
+/* Reset(); */
InterlockedDecrement(&num_hosts);
delete m_pvDir;
m_pVMemParse->Release();
@@ -2078,7 +2078,7 @@ CPerlHost::Find(LPCSTR lpStr)
int
lookup(const void *arg1, const void *arg2)
-{ // Compare strings
+{ /* Compare strings */
char*ptr1, *ptr2;
char c1,c2;
@@ -2091,18 +2091,18 @@ lookup(const void *arg1, const void *arg2)
if(c2 == '\0' || c2 == '=')
break;
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
}
else if(c2 == '\0' || c2 == '=')
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
else if(c1 != c2) {
c1 = toupper(c1);
c2 = toupper(c2);
if(c1 != c2) {
if(c1 < c2)
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
}
}
}
@@ -2117,7 +2117,7 @@ CPerlHost::Lookup(LPCSTR lpStr)
int
compare(const void *arg1, const void *arg2)
-{ // Compare strings
+{ /* Compare strings */
char*ptr1, *ptr2;
char c1,c2;
@@ -2130,18 +2130,18 @@ compare(const void *arg1, const void *arg2)
if(c1 == c2)
break;
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
}
else if(c2 == '\0' || c2 == '=')
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
else if(c1 != c2) {
c1 = toupper(c1);
c2 = toupper(c2);
if(c1 != c2) {
if(c1 < c2)
- return -1; // string 1 < string 2
+ return -1; /* string 1 < string 2 */
- return 1; // string 1 > string 2
+ return 1; /* string 1 > string 2 */
}
}
}
@@ -2161,7 +2161,7 @@ CPerlHost::Add(LPCSTR lpStr)
szBuffer[index] = '\0';
- // replacing ?
+ /* replacing ? */
lpPtr = Lookup(szBuffer);
if(lpPtr != NULL) {
Renew(*lpPtr, length, char);
@@ -2231,45 +2231,45 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
DWORD dwSize, dwEnvIndex;
int nLength, compVal;
- // get the process environment strings
+ /* get the process environment strings */
lpAllocPtr = lpTmp = (LPSTR)GetEnvironmentStrings();
- // step over current directory stuff
+ /* step over current directory stuff */
while(*lpTmp == '=')
lpTmp += strlen(lpTmp) + 1;
- // save the start of the environment strings
+ /* save the start of the environment strings */
lpEnvPtr = lpTmp;
for(dwSize = 1; *lpTmp != '\0'; lpTmp += strlen(lpTmp) + 1) {
- // calculate the size of the environment strings
+ /* calculate the size of the environment strings */
dwSize += strlen(lpTmp) + 1;
}
- // add the size of current directories
+ /* add the size of current directories */
dwSize += vDir.CalculateEnvironmentSpace();
- // add the additional space used by changes made to the environment
+ /* add the additional space used by changes made to the environment */
dwSize += CalculateEnvironmentSpace();
New(1, lpStr, dwSize, char);
lpPtr = lpStr;
if(lpStr != NULL) {
- // build the local environment
+ /* build the local environment */
lpStr = vDir.BuildEnvironmentSpace(lpStr);
dwEnvIndex = 0;
lpLocalEnv = GetIndex(dwEnvIndex);
while(*lpEnvPtr != '\0') {
if(!lpLocalEnv) {
- // all environment overrides have been added
- // so copy string into place
+ /* all environment overrides have been added */
+ /* so copy string into place */
strcpy(lpStr, lpEnvPtr);
nLength = strlen(lpEnvPtr) + 1;
lpStr += nLength;
lpEnvPtr += nLength;
}
else {
- // determine which string to copy next
+ /* determine which string to copy next */
compVal = compare(&lpEnvPtr, &lpLocalEnv);
if(compVal < 0) {
strcpy(lpStr, lpEnvPtr);
@@ -2285,7 +2285,7 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
}
lpLocalEnv = GetIndex(dwEnvIndex);
if(compVal == 0) {
- // this string was replaced
+ /* this string was replaced */
lpEnvPtr += strlen(lpEnvPtr) + 1;
}
}
@@ -2293,8 +2293,8 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
}
while(lpLocalEnv) {
- // still have environment overrides to add
- // so copy the strings into place if not an override
+ /* still have environment overrides to add */
+ /* so copy the strings into place if not an override */
char *ptr = strchr(lpLocalEnv, '=');
if(ptr && ptr[1]) {
strcpy(lpStr, lpLocalEnv);
@@ -2303,11 +2303,11 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir)
lpLocalEnv = GetIndex(dwEnvIndex);
}
- // add final NULL
+ /* add final NULL */
*lpStr = '\0';
}
- // release the process environment strings
+ /* release the process environment strings */
FreeEnvironmentStrings(lpAllocPtr);
return lpPtr;
diff --git a/win32/vmem.h b/win32/vmem.h
index a0e5eba070..2727b5cb7e 100644
--- a/win32/vmem.h
+++ b/win32/vmem.h
@@ -134,21 +134,21 @@ protected:
void* Expand(void* block, size_t size);
void WalkHeap(void);
- HANDLE m_hHeap; // memory heap for this script
- char m_FreeDummy[minAllocSize]; // dummy free block
- PBLOCK m_pFreeList; // pointer to first block on free list
- PBLOCK m_pRover; // roving pointer into the free list
- HeapRec m_heaps[maxHeaps]; // list of all non-contiguous heap areas
- int m_nHeaps; // no. of heaps in m_heaps
- long m_lAllocSize; // current alloc size
- long m_lRefCount; // number of current users
- CRITICAL_SECTION m_cs; // access lock
+ HANDLE m_hHeap; /* memory heap for this script */
+ char m_FreeDummy[minAllocSize]; /* dummy free block */
+ PBLOCK m_pFreeList; /* pointer to first block on free list */
+ PBLOCK m_pRover; /* roving pointer into the free list */
+ HeapRec m_heaps[maxHeaps]; /* list of all non-contiguous heap areas */
+ int m_nHeaps; /* no. of heaps in m_heaps */
+ long m_lAllocSize; /* current alloc size */
+ long m_lRefCount; /* number of current users */
+ CRITICAL_SECTION m_cs; /* access lock */
#ifdef _DEBUG_MEM
FILE* m_pLog;
#endif
};
-// #define _DEBUG_MEM
+/* #define _DEBUG_MEM */
#ifdef _DEBUG_MEM
#define ASSERT(f) if(!(f)) DebugBreak();
diff --git a/wince/include/errno.h b/wince/include/errno.h
index 4dba2d89d9..592816fbe2 100644
--- a/wince/include/errno.h
+++ b/wince/include/errno.h
@@ -24,7 +24,7 @@ extern int errno;
#define ENOMEM 12
#define EACCES 13
#define EFAULT 14
-#define EOSERR 15 // rk
+#define EOSERR 15 /* rk */
#define EBUSY 16
#define EEXIST 17
#define EXDEV 18
diff --git a/wince/include/netdb.h b/wince/include/netdb.h
index b0c5ea1949..43c03c7544 100644
--- a/wince/include/netdb.h
+++ b/wince/include/netdb.h
@@ -1,7 +1,7 @@
-// netdb.h
+/* netdb.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_NETDB
@@ -9,4 +9,4 @@
#include <sys/socket.h>
-#endif //_INC_NETDB
+#endif /* _INC_NETDB */
diff --git a/wince/include/sys/socket.h b/wince/include/sys/socket.h
index 2d6f7b8306..fbc6e098db 100644
--- a/wince/include/sys/socket.h
+++ b/wince/include/sys/socket.h
@@ -1,7 +1,7 @@
-// sys/socket.h
+/* sys/socket.h */
-// djl
-// Provide UNIX compatibility
+/* djl */
+/* Provide UNIX compatibility */
#ifndef _INC_SYS_SOCKET
#define _INC_SYS_SOCKET
@@ -51,10 +51,10 @@ typedef struct _OVERLAPPED {
#endif
#endif
-#endif //_WINDOWS_
-// #ifndef __GNUC__
+#endif /* _WINDOWS_ */
+/* #ifndef __GNUC__ */
#include <winsock.h>
-// #endif
+/* #endif */
#define ENOTSOCK WSAENOTSOCK
#undef HOST_NOT_FOUND
@@ -147,9 +147,9 @@ void win32_endprotoent(void);
void win32_endservent(void);
#ifndef WIN32SCK_IS_STDSCK
-//
-// direct to our version
-//
+
+/* direct to our version */
+
#define htonl win32_htonl
#define htons win32_htons
#define ntohl win32_ntohl
@@ -214,4 +214,4 @@ void win32_endservent(void);
}
#endif
-#endif // _INC_SYS_SOCKET
+#endif /* _INC_SYS_SOCKET */
diff --git a/wince/include/sys/stat.h b/wince/include/sys/stat.h
index 7a5e383fc9..2f5c6348d5 100644
--- a/wince/include/sys/stat.h
+++ b/wince/include/sys/stat.h
@@ -3,7 +3,7 @@
#include <sys/types.h>
-// stat.h
+/* stat.h */
#define _S_IFMT 0170000 /* file type mask */
#define _S_IFDIR 0040000 /* directory */
#define _S_IFCHR 0020000 /* character special */
diff --git a/wince/perllib.c b/wince/perllib.c
index 3d4d37e500..527103f086 100644
--- a/wince/perllib.c
+++ b/wince/perllib.c
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 20:58:55 keuchel@w2k>
+/* Time-stamp: <01/08/01 20:58:55 keuchel@w2k> */
#include "EXTERN.h"
#include "perl.h"
diff --git a/wince/perlmain.c b/wince/perlmain.c
index 86e6c95524..cebbfb3d0f 100644
--- a/wince/perlmain.c
+++ b/wince/perlmain.c
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 20:58:19 keuchel@w2k>
+/* Time-stamp: <01/08/01 20:58:19 keuchel@w2k> */
#include "EXTERN.h"
#include "perl.h"
@@ -14,7 +14,7 @@ int _CRT_glob = 0;
#endif
-// Called from w32console/wmain.c
+/* Called from w32console/wmain.c */
int
main(int argc, char **argv, char **env)
diff --git a/wince/win32.h b/wince/win32.h
index c9c3a037f1..b46fb2f76a 100644
--- a/wince/win32.h
+++ b/wince/win32.h
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 20:59:54 keuchel@w2k>
+/* Time-stamp: <01/08/01 20:59:54 keuchel@w2k> */
/* WIN32.H
*
@@ -116,7 +116,7 @@ struct utsname {
/* Define USE_SOCKETS_AS_HANDLES to enable emulation of windows sockets as
* real filehandles. XXX Should always be defined (the other version is untested) */
-//#define USE_SOCKETS_AS_HANDLES
+/* #define USE_SOCKETS_AS_HANDLES */
/* read() and write() aren't transparent for socket handles */
#define PERL_SOCK_SYSREAD_IS_RECV
diff --git a/wince/win32iop.h b/wince/win32iop.h
index 3744168a96..020f2387fa 100644
--- a/wince/win32iop.h
+++ b/wince/win32iop.h
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 21:00:16 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:00:16 keuchel@w2k> */
#ifndef WIN32IOP_H
#define WIN32IOP_H
diff --git a/wince/win32thread.c b/wince/win32thread.c
index a94ffa4234..4675822c66 100644
--- a/wince/win32thread.c
+++ b/wince/win32thread.c
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 21:00:29 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:00:29 keuchel@w2k> */
#include "EXTERN.h"
#include "perl.h"
diff --git a/wince/win32thread.h b/wince/win32thread.h
index adae6180e7..33e11a5c64 100644
--- a/wince/win32thread.h
+++ b/wince/win32thread.h
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 21:00:36 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:00:36 keuchel@w2k> */
#ifndef _WIN32THREAD_H
#define _WIN32THREAD_H
diff --git a/wince/wince.c b/wince/wince.c
index c1375817b8..b6b9f140db 100644
--- a/wince/wince.c
+++ b/wince/wince.c
@@ -871,8 +871,8 @@ win32_fseek(FILE *pf,long offset,int origin)
return fseek(pf, offset, origin);
}
-// fpos_t seems to be int64 on hpc pro! Really stupid.
-// But maybe someday there will be such large disks in a hpc...
+/* fpos_t seems to be int64 on hpc pro! Really stupid. */
+/* But maybe someday there will be such large disks in a hpc... */
DllExport int
win32_fgetpos(FILE *pf, fpos_t *p)
{
@@ -1233,7 +1233,7 @@ win32_dynaload(const char* filename)
return hModule;
}
-// this is needed by Cwd.pm...
+/* this is needed by Cwd.pm... */
static
XS(w32_GetCwd)
@@ -1293,7 +1293,7 @@ XS(w32_GetOSVersion)
XPUSHs(newSViv(osver.dwMajorVersion));
XPUSHs(newSViv(osver.dwMinorVersion));
XPUSHs(newSViv(osver.dwBuildNumber));
- // WINCE = 3
+ /* WINCE = 3 */
XPUSHs(newSViv(osver.dwPlatformId));
PUTBACK;
}
@@ -1560,12 +1560,12 @@ wce_hitreturn()
return;
}
-//////////////////////////////////////////////////////////////////////
+/* //////////////////////////////////////////////////////////////////// */
void
win32_argv2utf8(int argc, char** argv)
{
- // do nothing...
+ /* do nothing... */
}
void
@@ -1600,7 +1600,7 @@ Perl_sys_intern_clear(pTHX)
# endif
}
-//////////////////////////////////////////////////////////////////////
+/* //////////////////////////////////////////////////////////////////// */
#undef getcwd
diff --git a/wince/wince.h b/wince/wince.h
index dec518b280..29ec27472b 100644
--- a/wince/wince.h
+++ b/wince/wince.h
@@ -1,17 +1,17 @@
-// wince.h
-//
-// Time-stamp: <01/08/01 20:48:08 keuchel@w2k>
+/* wince.h */
-// This file includes extracts from the celib-headers, because
-// the celib-headers produces macro conflicts with defines in
-// win32iop.h etc
+/* Time-stamp: <01/08/01 20:48:08 keuchel@w2k> */
+
+/* This file includes extracts from the celib-headers, because */
+/* the celib-headers produces macro conflicts with defines in */
+/* win32iop.h etc */
#ifndef WINCE_H
#define WINCE_H 1
#include "celib_defs.h"
-// include local copies of celib headers...
+/* include local copies of celib headers... */
#include "errno.h"
#include "sys/stat.h"
#include "time.h"
@@ -38,7 +38,7 @@ XCE_EXPORT void XCEShowMessageA(const char *fmt, ...);
#define gmtime xcegmtime
#define localtime xcelocaltime
#define asctime xceasctime
-//#define utime xceutime
+/* #define utime xceutime */
#define futime xcefutime
#define ftime xceftime
#define ctime xcectime
@@ -113,7 +113,7 @@ XCE_EXPORT DWORD XCEAPI XCEGetModuleFileNameA(HMODULE hModule, LPTSTR lpName, DW
XCE_EXPORT HMODULE XCEAPI XCEGetModuleHandleA(const char *lpName);
XCE_EXPORT FARPROC XCEAPI XCEGetProcAddressA(HMODULE hMod, const char *name);
-//////////////////////////////////////////////////////////////////////
+/* //////////////////////////////////////////////////////////////////// */
#define getgid xcegetgid
#define getegid xcegetegid
diff --git a/wince/wincesck.c b/wince/wincesck.c
index beb7489e4f..003a250dd6 100644
--- a/wince/wincesck.c
+++ b/wince/wincesck.c
@@ -1,4 +1,4 @@
-// Time-stamp: <01/08/01 21:01:12 keuchel@w2k>
+/* Time-stamp: <01/08/01 21:01:12 keuchel@w2k> */
/* wincesck.c
*
@@ -10,7 +10,7 @@
* License or the Artistic License, as specified in the README file.
*/
-// The socket calls use fd functions from celib...
+/* The socket calls use fd functions from celib... */
#define WIN32IO_IS_STDIO
#define WIN32SCK_IS_STDSCK
@@ -50,7 +50,7 @@ XCE_EXPORT struct protoent *xcegetprotobynumber(int number);
#define getprotobyname xcegetprotobyname
#define getprotobynumber xcegetprotobynumber
-// uses fdtab...
+/* uses fdtab... */
#include "cesocket2.h"
#endif
@@ -234,7 +234,7 @@ win32_select(int nfds, Perl_fd_set* rd, Perl_fd_set* wr,
Perl_fd_set* ex, const struct timeval* timeout)
{
StartSockets();
- // select not yet fixed
+ /* select not yet fixed */
errno = ENOSYS;
return -1;
}
diff --git a/x2p/a2py.c b/x2p/a2py.c
index cd396a28de..1b14fddd83 100644
--- a/x2p/a2py.c
+++ b/x2p/a2py.c
@@ -59,7 +59,7 @@ main(register int argc, register char **argv, register char **env)
STR *tmpstr;
#ifdef NETWARE
- fnInitGpfGlobals(); // For importing the CLIB calls in place of Watcom calls
+ fnInitGpfGlobals(); /* For importing the CLIB calls in place of Watcom calls */
#endif /* NETWARE */
myname = argv[0];