New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data::Dumper and negative numbers #1784
Comments
From @eserteThe Data::Dumper output of negative numbers in FreeBSD's perl seems to Consider the following outputs: /usr/perl5.00503/bin/perl -MData::Dumper -e 'print Data::Dumper->Dump([-12])' /usr/perl5.6.0/bin/perl -MData::Dumper -e 'print Data::Dumper->Dump([-12])' Flags: Site configuration information for perl v5.6.0: Configured by eserte at Wed Apr 5 22:54:41 CEST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Locally applied patches: @INC for perl v5.6.0: Environment for perl v5.6.0: |
From @gsarOn Thu, 06 Apr 2000 01:14:52 +0200, Slaven Rezic wrote:
Please try this. Sarathy Inline Patch-----------------------------------8<-----------------------------------
Change 5970 by gsar@auger on 2000/04/27 18:05:11
Data::Dumper fumbles negative numbers on 32-bit platforms where
IV is >32bits
Affected files ...
... //depot/perl/ext/Data/Dumper/Dumper.xs#18 edit
... //depot/perl/t/lib/dumper.t#10 edit
Differences ...
==== //depot/perl/ext/Data/Dumper/Dumper.xs#18 (text) ====
Index: perl/ext/Data/Dumper/Dumper.xs
--- perl/ext/Data/Dumper/Dumper.xs.~1~ Thu Apr 27 11:05:14 2000
+++ perl/ext/Data/Dumper/Dumper.xs Thu Apr 27 11:05:14 2000
@@ -584,8 +584,7 @@
if (SvIOK(val)) {
STRLEN len;
- i = SvIV(val);
- (void) sprintf(tmpbuf, "%"IVdf, (IV)i);
+ (void) sprintf(tmpbuf, "%"IVdf, SvIV(val));
len = strlen(tmpbuf);
sv_catpvn(retval, tmpbuf, len);
}
==== //depot/perl/t/lib/dumper.t#10 (xtext) ====
Index: perl/t/lib/dumper.t
--- perl/t/lib/dumper.t.~1~ Thu Apr 27 11:05:14 2000
+++ perl/t/lib/dumper.t Thu Apr 27 11:05:14 2000
@@ -287,7 +287,7 @@
package main;
use Data::Dumper;
$foo = 5;
- @foo = (10,\*foo);
+ @foo = (-10,\*foo);
%foo = (a=>1,b=>\$foo,c=>\@foo);
$foo{d} = \%foo;
$foo[2] = \%foo;
@@ -299,7 +299,7 @@
#*::foo = \5;
#*::foo = [
# #0
-# 10,
+# -10,
# #1
# do{my $o},
# #2
@@ -330,7 +330,7 @@
#$foo = \*::foo;
#*::foo = \5;
#*::foo = [
-# 10,
+# -10,
# do{my $o},
# {
# 'a' => 1,
@@ -356,7 +356,7 @@
##
$WANT = <<'EOT';
#@bar = (
-# 10,
+# -10,
# \*::foo,
# {}
#);
@@ -383,7 +383,7 @@
##
$WANT = <<'EOT';
#$bar = [
-# 10,
+# -10,
# \*::foo,
# {}
#];
@@ -411,7 +411,7 @@
$WANT = <<'EOT';
#$foo = \*::foo;
#@bar = (
-# 10,
+# -10,
# $foo,
# {
# a => 1,
@@ -433,7 +433,7 @@
$WANT = <<'EOT';
#$foo = \*::foo;
#$bar = [
-# 10,
+# -10,
# $foo,
# {
# a => 1,
End of Patch. |
From [Unknown Contact. See original ticket]Gurusamy Sarathy writes:
Do not see any support for IsUV.... Ilya |
From @gsarOn Thu, 27 Apr 2000 14:27:35 EDT, Ilya Zakharevich wrote:
True, patch welcome. Sarathy |
From @eserteGurusamy Sarathy <gsar@ActiveState.com> writes:
20:52 eserte@vran 322 (src/new.perl-5.6.0): ./perl -Ilib -MData::Dumper -e 'print Data::Dumper->Dump([-12])' Thanks! Seems to work now. The new test also passes. Regards, |
Migrated from rt.perl.org#3039 (status was 'resolved')
Searchable as RT3039$
The text was updated successfully, but these errors were encountered: