From: Jarkko Hietaniemi Date: Wed, 3 Mar 1999 08:29:43 +0000 (+0000) Subject: Use '!' to mark native integer packings instead of '_'. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f61d411c4d3cff1213d879acac3d5b738473d376;p=p5sagit%2Fp5-mst-13.2.git Use '!' to mark native integer packings instead of '_'. p4raw-id: //depot/cfgperl@3053 --- diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 7503b5a..81099d3 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -51,10 +51,10 @@ no useful value. See L. (F) The "use" keyword is recognized and executed at compile time, and returns no useful value. See L. -=item '_' allowed only after types %s +=item '!' allowed only after types %s -(F) The '_' is allowed in pack() and unpack() only after certain types. -See L. +(F) The '!' is allowed in pack() and unpack() only after certain types. +See L. =item % may only be used in unpack diff --git a/pp.c b/pp.c index 7577394..3e9e607 100644 --- a/pp.c +++ b/pp.c @@ -3274,7 +3274,7 @@ PP(pp_unpack) #endif if (isSPACE(datumtype)) continue; - if (*pat == '_') { + if (*pat == '!') { char *natstr = "sSiIlL"; if (strchr(natstr, datumtype)) { @@ -3284,7 +3284,7 @@ PP(pp_unpack) pat++; } else - croak("'_' allowed only after types %s", natstr); + croak("'!' allowed only after types %s", natstr); } if (pat >= patend) len = 1; @@ -4294,7 +4294,7 @@ PP(pp_pack) #endif if (isSPACE(datumtype)) continue; - if (*pat == '_') { + if (*pat == '!') { char *natstr = "sSiIlL"; if (strchr(natstr, datumtype)) { @@ -4304,7 +4304,7 @@ PP(pp_pack) pat++; } else - croak("'_' allowed only after types %s", natstr); + croak("'!' allowed only after types %s", natstr); } if (*pat == '*') { len = strchr("@Xxu", datumtype) ? 0 : items; diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index 23476e1..87ddaef 100755 --- a/t/lib/ipc_sysv.t +++ b/t/lib/ipc_sysv.t @@ -115,17 +115,17 @@ if($Config{'d_semget'} eq 'define' && my $nsem = 10; - semctl($sem,0,SETALL,pack("s_*",(0) x $nsem)) or print "not "; + semctl($sem,0,SETALL,pack("s!*",(0) x $nsem)) or print "not "; print "ok 10\n"; $data = ""; semctl($sem,0,GETALL,$data) or print "not "; print "ok 11\n"; - print "not " unless length($data) == length(pack("s_*",(0) x $nsem)); + print "not " unless length($data) == length(pack("s!*",(0) x $nsem)); print "ok 12\n"; - my @data = unpack("s_*",$data); + my @data = unpack("s!*",$data); my $adata = "0" x $nsem; @@ -135,14 +135,14 @@ if($Config{'d_semget'} eq 'define' && my $poke = 2; $data[$poke] = 1; - semctl($sem,0,SETALL,pack("s_*",@data)) or print "not "; + semctl($sem,0,SETALL,pack("s!*",@data)) or print "not "; print "ok 14\n"; $data = ""; semctl($sem,0,GETALL,$data) or print "not "; print "ok 15\n"; - @data = unpack("s_*",$data); + @data = unpack("s!*",$data); my $bdata = "0" x $poke . "1" . "0" x ($nsem-$poke-1); diff --git a/t/op/pack.t b/t/op/pack.t index 4bfbfa3..5b72797 100755 --- a/t/op/pack.t +++ b/t/op/pack.t @@ -248,22 +248,22 @@ print "ok ", $test++, "\n"; # 73..78: packing native shorts/ints/longs -print "not " unless length(pack("s_", 0)) == $Config{shortsize}; +print "not " unless length(pack("s!", 0)) == $Config{shortsize}; print "ok ", $test++, "\n"; -print "not " unless length(pack("i_", 0)) == $Config{intsize}; +print "not " unless length(pack("i!", 0)) == $Config{intsize}; print "ok ", $test++, "\n"; -print "not " unless length(pack("l_", 0)) == $Config{longsize}; +print "not " unless length(pack("l!", 0)) == $Config{longsize}; print "ok ", $test++, "\n"; -print "not " unless length(pack("s_", 0)) <= length(pack("i_", 0)); +print "not " unless length(pack("s!", 0)) <= length(pack("i!", 0)); print "ok ", $test++, "\n"; -print "not " unless length(pack("i_", 0)) <= length(pack("l_", 0)); +print "not " unless length(pack("i!", 0)) <= length(pack("l!", 0)); print "ok ", $test++, "\n"; -print "not " unless length(pack("i_", 0)) == length(pack("i", 0)); +print "not " unless length(pack("i!", 0)) == length(pack("i", 0)); print "ok ", $test++, "\n"; # 79..138: pack <-> unpack bijectionism