Change 19029 by [EMAIL PROTECTED] on 2003/03/19 15:42:44
Integrate:
[ 19014]
clarify behaviour of $a++
[ 19015]
add comment at undef postinc special case
[ 19016]
add tests for existing behaviour of undef postinc/dec
[ 19017]
according to the new Porting/Glossary, sig_num doesn't have an
extra '0' at the end
[ 19018]
there is no trailing NULL in sig_name or sig_num, so don't
talk about it
Affected files ...
... //depot/maint-5.8/perl/Porting/Glossary#5 integrate
... //depot/maint-5.8/perl/pod/perlop.pod#6 integrate
... //depot/maint-5.8/perl/pp.c#14 integrate
... //depot/maint-5.8/perl/t/op/inc.t#2 integrate
... //depot/maint-5.8/perl/win32/config.bc#4 integrate
... //depot/maint-5.8/perl/win32/config.gc#4 integrate
... //depot/maint-5.8/perl/win32/config.vc#4 integrate
... //depot/maint-5.8/perl/win32/config.vc64#4 integrate
Differences ...
==== //depot/maint-5.8/perl/Porting/Glossary#5 (text) ====
Index: perl/Porting/Glossary
--- perl/Porting/Glossary#4~18978~ Fri Mar 14 02:52:06 2003
+++ perl/Porting/Glossary Wed Mar 19 07:42:44 2003
@@ -4124,7 +4124,7 @@
sig_size (sig_name.U):
This variable contains the number of elements of the sig_name
- and sig_num arrays, excluding the final NULL entry.
+ and sig_num arrays.
signal_t (d_voidsig.U):
This variable holds the type of the signal handler (void or int).
==== //depot/maint-5.8/perl/pod/perlop.pod#6 (text) ====
Index: perl/pod/perlop.pod
--- perl/pod/perlop.pod#5~18783~ Wed Feb 26 11:39:59 2003
+++ perl/pod/perlop.pod Wed Mar 19 07:42:44 2003
@@ -127,6 +127,10 @@
print ++($foo = 'Az'); # prints 'Ba'
print ++($foo = 'zz'); # prints 'aaa'
+C<undef> is always treated as numeric, and in particular is changed
+to C<0> before incrementing (so that a post-increment of an undef value
+will return C<0> rather than C<undef>).
+
The auto-decrement operator is not magical.
=head2 Exponentiation
==== //depot/maint-5.8/perl/pp.c#14 (text) ====
Index: perl/pp.c
--- perl/pp.c#13~18850~ Fri Mar 7 12:38:51 2003
+++ perl/pp.c Wed Mar 19 07:42:44 2003
@@ -858,6 +858,7 @@
else
sv_inc(TOPs);
SvSETMAGIC(TOPs);
+ /* special case for undef: see thread at 2003-03/msg00536.html in archive */
if (!SvOK(TARG))
sv_setiv(TARG, 0);
SETs(TARG);
==== //depot/maint-5.8/perl/t/op/inc.t#2 (xtext) ====
Index: perl/t/op/inc.t
--- perl/t/op/inc.t#1~17645~ Fri Jul 19 12:29:57 2002
+++ perl/t/op/inc.t Wed Mar 19 07:42:44 2003
@@ -2,7 +2,7 @@
# use strict;
-print "1..24\n";
+print "1..26\n";
my $test = 1;
@@ -86,6 +86,12 @@
$b = -$a;
$b=$b-1;
ok ($b == -(++$a), $a);
+
+$a = undef;
+ok ($a++ eq '0', do { $a=undef; $a++ }, "postinc undef returns '0'");
+
+$a = undef;
+ok (!defined($a--), do { $a=undef; $a-- }, "postdec undef returns undef");
# Verify that shared hash keys become unshared.
==== //depot/maint-5.8/perl/win32/config.bc#4 (text) ====
Index: perl/win32/config.bc
--- perl/win32/config.bc#3~18347~ Sun Dec 22 22:37:31 2002
+++ perl/win32/config.bc Wed Mar 19 07:42:44 2003
@@ -827,7 +827,7 @@
sig_count='26'
sig_name='ZERO HUP INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM
TERM USR1 USR2 CHLD NUM19 USR3 BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE",
"KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD",
"NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
-sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 18 0'
+sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 18'
sig_num_init='0, 1, 2, 21, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 18, 0'
sig_size='27'
signal_t='void'
==== //depot/maint-5.8/perl/win32/config.gc#4 (text) ====
Index: perl/win32/config.gc
--- perl/win32/config.gc#3~18347~ Sun Dec 22 22:37:31 2002
+++ perl/win32/config.gc Wed Mar 19 07:42:44 2003
@@ -827,7 +827,7 @@
sig_count='26'
sig_name='ZERO HUP INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM
TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE",
"KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18",
"NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
-sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0'
+sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20'
sig_num_init='0, 1, 2, 21, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 20, 0'
sig_size='27'
signal_t='void'
==== //depot/maint-5.8/perl/win32/config.vc#4 (text) ====
Index: perl/win32/config.vc
--- perl/win32/config.vc#3~18347~ Sun Dec 22 22:37:31 2002
+++ perl/win32/config.vc Wed Mar 19 07:42:44 2003
@@ -827,7 +827,7 @@
sig_count='26'
sig_name='ZERO HUP INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM
TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE",
"KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18",
"NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
-sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0'
+sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20'
sig_num_init='0, 1, 2, 21, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 20, 0'
sig_size='27'
signal_t='void'
==== //depot/maint-5.8/perl/win32/config.vc64#4 (text) ====
Index: perl/win32/config.vc64
--- perl/win32/config.vc64#3~18347~ Sun Dec 22 22:37:31 2002
+++ perl/win32/config.vc64 Wed Mar 19 07:42:44 2003
@@ -827,7 +827,7 @@
sig_count='26'
sig_name='ZERO HUP INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM
TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD'
sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE",
"KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18",
"NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
-sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0'
+sig_num='0 1 2 21 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20'
sig_num_init='0, 1, 2, 21, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 20, 0'
sig_size='27'
signal_t='void'
End of Patch.