r66228 - in /branches/upstream/libscalar-number-perl/current: ./ lib/Scalar/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri Dec 24 21:19:43 UTC 2010
Author: jawnsy-guest
Date: Fri Dec 24 21:19:36 2010
New Revision: 66228
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66228
Log:
[svn-upgrade] new version libscalar-number-perl (0.006)
Added:
branches/upstream/libscalar-number-perl/current/t/pod_cvg_pp.t
Modified:
branches/upstream/libscalar-number-perl/current/.cvsignore
branches/upstream/libscalar-number-perl/current/Build.PL
branches/upstream/libscalar-number-perl/current/Changes
branches/upstream/libscalar-number-perl/current/MANIFEST
branches/upstream/libscalar-number-perl/current/META.yml
branches/upstream/libscalar-number-perl/current/Makefile.PL
branches/upstream/libscalar-number-perl/current/README
branches/upstream/libscalar-number-perl/current/SIGNATURE
branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.pm
branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.xs
branches/upstream/libscalar-number-perl/current/t/class.t
branches/upstream/libscalar-number-perl/current/t/class_pp.t
branches/upstream/libscalar-number-perl/current/t/id_cmp.t
branches/upstream/libscalar-number-perl/current/t/id_cmp_pp.t
branches/upstream/libscalar-number-perl/current/t/num_forms.pl
branches/upstream/libscalar-number-perl/current/t/part.t
branches/upstream/libscalar-number-perl/current/t/part_pp.t
branches/upstream/libscalar-number-perl/current/t/pod_cvg.t
branches/upstream/libscalar-number-perl/current/t/pod_syn.t
branches/upstream/libscalar-number-perl/current/t/setup_pp.pl
branches/upstream/libscalar-number-perl/current/t/val_cmp.at
Modified: branches/upstream/libscalar-number-perl/current/.cvsignore
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/.cvsignore?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/.cvsignore (original)
+++ branches/upstream/libscalar-number-perl/current/.cvsignore Fri Dec 24 21:19:36 2010
@@ -1,4 +1,4 @@
Build Makefile
_build blib
-META.yml Makefile.PL SIGNATURE
+META.yml MYMETA.yml Makefile.PL SIGNATURE
Scalar-Number-*
Modified: branches/upstream/libscalar-number-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/Build.PL?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/Build.PL (original)
+++ branches/upstream/libscalar-number-perl/current/Build.PL Fri Dec 24 21:19:36 2010
@@ -1,3 +1,4 @@
+{ use 5.006; }
use warnings;
use strict;
@@ -50,6 +51,15 @@
})->new(
module_name => "Scalar::Number",
license => "perl",
+ configure_requires => {
+ "Module::Build" => 0,
+ "perl" => "5.006",
+ "strict" => 0,
+ "warnings" => 0,
+ },
+ configure_recommends => {
+ "ExtUtils::CBuilder" => "0.15",
+ },
build_requires => {
"Data::Float" => "0.008",
"Data::Integer" => "0.003",
@@ -77,6 +87,7 @@
recommends => {
"XSLoader" => 0,
},
+ needs_compiler => 0,
dynamic_config => 1,
meta_add => { distribution_type => "module" },
test_types => { author => ".at" },
@@ -84,4 +95,4 @@
sign => 1,
)->create_build_script;
-exit 0;
+1;
Modified: branches/upstream/libscalar-number-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/Changes?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/Changes (original)
+++ branches/upstream/libscalar-number-perl/current/Changes Fri Dec 24 21:19:36 2010
@@ -1,3 +1,43 @@
+version 0.006; 2010-10-23
+
+ * port to Perl 5.13.6, which changed the behaviour of signed zeroes
+ in Perl arithmetic
+
+ * fix test suite's treatment of signed zeroes in some places, where
+ it was liable to produce false test failures depending on the C
+ library implementation
+
+ * in XS, turn the runtime-determined iok_maybe_spurious flag into a
+ compile-time constant derived from the Perl version number
+
+ * in XS, declare "PROTOTYPES: DISABLE" to prevent automatic generation
+ of unintended prototypes
+
+ * in t/setup_pp.pl, avoid a warning that occurs if XSLoader::load()
+ is given no arguments, which is now a valid usage
+
+version 0.005; 2010-10-20
+
+ * in XS, use PERL_NO_GET_CONTEXT for efficiency
+
+ * in XS, declare all local symbols static
+
+ * check for required Perl version at runtime
+
+ * use full stricture in test suite
+
+ * also test POD coverage of pure Perl implementation, and rename an
+ internal function to satisfy the coverage test
+
+ * in Build.PL, explicitly set needs_compiler to avoid bogus
+ auto-dependency on ExtUtils::CBuilder
+
+ * in Build.PL, explicitly declare configure-time requirements
+
+ * remove bogus "exit 0" from Build.PL
+
+ * add MYMETA.yml to .cvsignore
+
version 0.004; 2009-05-02
* load some modules at build time instead of configure time, to avoid
Modified: branches/upstream/libscalar-number-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/MANIFEST?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/MANIFEST (original)
+++ branches/upstream/libscalar-number-perl/current/MANIFEST Fri Dec 24 21:19:36 2010
@@ -16,6 +16,7 @@
t/part.t
t/part_pp.t
t/pod_cvg.t
+t/pod_cvg_pp.t
t/pod_syn.t
t/setup_pp.pl
t/values.data
Modified: branches/upstream/libscalar-number-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/META.yml?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/META.yml (original)
+++ branches/upstream/libscalar-number-perl/current/META.yml Fri Dec 24 21:19:36 2010
@@ -1,12 +1,34 @@
---
-name: Scalar-Number
-version: 0.004
+abstract: 'numeric aspects of scalars'
author:
- 'Andrew Main (Zefram) <zefram at fysh.org>'
-abstract: numeric aspects of scalars
+build_requires:
+ Data::Float: 0.008
+ Data::Integer: 0.003
+ Module::Build: 0
+ Test::More: 0
+ perl: 5.006
+ strict: 0
+ warnings: 0
+configure_requires:
+ Module::Build: 0
+ perl: 5.006
+ strict: 0
+ warnings: 0
+distribution_type: module
+dynamic_config: 1
+generated_by: 'Module::Build version 0.3607'
license: perl
-resources:
- license: http://dev.perl.org/licenses/
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Scalar-Number
+provides:
+ Scalar::Number:
+ file: lib/Scalar/Number.pm
+ version: 0.006
+recommends:
+ XSLoader: 0
requires:
Carp: 0
Data::Float: 0.008
@@ -18,23 +40,6 @@
perl: 5.006
strict: 0
warnings: 0
-build_requires:
- Data::Float: 0.008
- Data::Integer: 0.003
- Module::Build: 0
- Test::More: 0
- perl: 5.006
- strict: 0
- warnings: 0
-recommends:
- XSLoader: 0
-dynamic_config: 1
-provides:
- Scalar::Number:
- file: lib/Scalar/Number.pm
- version: 0.004
-generated_by: Module::Build version 0.31012
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-distribution_type: module
+resources:
+ license: http://dev.perl.org/licenses/
+version: 0.006
Modified: branches/upstream/libscalar-number-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/Makefile.PL?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/Makefile.PL (original)
+++ branches/upstream/libscalar-number-perl/current/Makefile.PL Fri Dec 24 21:19:36 2010
@@ -1,32 +1,35 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.31012
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
require 5.006;
-
+
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
-
+
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
-
+
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
-
+
require Cwd;
require File::Spec;
require CPAN;
-
+
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
-
+
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
-
+
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
use lib '_build/lib';
Module::Build::Compat->run_build_pl(args => \@ARGV);
+ my $build_script = 'Build';
+ $build_script .= '.com' if $^O eq 'VMS';
+ exit(0) unless(-e $build_script); # cpantesters convention
require MyModuleBuilder;
Module::Build::Compat->write_makefile(build_class => 'MyModuleBuilder');
Modified: branches/upstream/libscalar-number-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/README?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/README (original)
+++ branches/upstream/libscalar-number-perl/current/README Fri Dec 24 21:19:36 2010
@@ -32,7 +32,7 @@
COPYRIGHT
-Copyright (C) 2007, 2009 Andrew Main (Zefram) <zefram at fysh.org>
+Copyright (C) 2007, 2009, 2010 Andrew Main (Zefram) <zefram at fysh.org>
LICENSE
Modified: branches/upstream/libscalar-number-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/SIGNATURE?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/SIGNATURE (original)
+++ branches/upstream/libscalar-number-perl/current/SIGNATURE Fri Dec 24 21:19:36 2010
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.55.
+signed via the Module::Signature module, version 0.66.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,33 +14,34 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 5d9ea9284e9c176a668c88dbf16e46a6f6f00c41 .cvsignore
-SHA1 562e81ba346b5a08db57a8e644bb919eca6deb9c Build.PL
-SHA1 66c1fbd37a048fbfdfa153870f7b43cc04138cd6 Changes
-SHA1 040c7640154a8aa4207ce1a22fa2489d52328352 MANIFEST
-SHA1 4c90c7d64d3723f509cb4f0d3697fdd0b6bfc4dd META.yml
-SHA1 684ab827ae5405876abe203f5a032ffa6b575cf7 Makefile.PL
-SHA1 0c435061be67398463511c4e991fc1168f4f7108 README
+SHA1 1eb7c5cdcf9fd0c49af63fa42a57d4af0b8f4f66 .cvsignore
+SHA1 bde3c76c0460cd3ea60db8db98532d4f70db5e7e Build.PL
+SHA1 373a04b7b306994b1773c94741d96ddaf3713511 Changes
+SHA1 f207f7da5d66b089f894b70b45d8b984e2a68aa9 MANIFEST
+SHA1 9409974d0af4b89d751eba090f48ac9c7094ea4d META.yml
+SHA1 0f1b3b6269550b5135e10b3cae1b6b41d274b276 Makefile.PL
+SHA1 71d6d4850359ec175c6c6feb9830bb814a5286b5 README
SHA1 b5c0b4101833065a1b5822cbdff0465330f52f80 lib/Scalar/.cvsignore
-SHA1 9061010f3a4a86ea2d73e6b13527aadee5127a0f lib/Scalar/Number.pm
-SHA1 adc2998f14d6afccdb28f4f3e9fca22f0d3d9971 lib/Scalar/Number.xs
-SHA1 873e3af6b48699eab9c77e1cad9434c1467efac9 t/class.t
-SHA1 7c2c99152a6b3a60b1e236762d17dae873c6de78 t/class_pp.t
-SHA1 64fae460f6a1322cc7f91db1403f3c79ff97d509 t/id_cmp.t
-SHA1 8ba2a397831cf260662f2d91f08a65c90c7ce71a t/id_cmp_pp.t
-SHA1 ee342126c606b17dc9e225c79bab22783d574c95 t/num_forms.pl
-SHA1 56b25ba9618d155bd7a7d52b2b9ec19f367689fd t/part.t
-SHA1 1386d05ae655d38de426ccf7abf253339d2faecf t/part_pp.t
-SHA1 0e141eecf3ca4903ef38d9413b5403a9ddb0392f t/pod_cvg.t
-SHA1 74a957cd8b93f25672ecc6aa578a671d084dd343 t/pod_syn.t
-SHA1 ff8983e6aa98339774459694db104fcec0bd0987 t/setup_pp.pl
-SHA1 515d7bb5d0c21832edc0a1c29509f36c5b95698b t/val_cmp.at
+SHA1 1daac5cc137b4f761ebdb77ac5ada01faa2e644f lib/Scalar/Number.pm
+SHA1 75d967c9649a9671f9048dcd25c9684891c9c3ac lib/Scalar/Number.xs
+SHA1 07c53564db36f8cdc104bc8acc6043734a5c6976 t/class.t
+SHA1 c8b108972eb882bb7d011afb9f026cd0bf47e0e8 t/class_pp.t
+SHA1 eb9934710616a5915c6333f0a4eedf79f996e47c t/id_cmp.t
+SHA1 df2471f508c93ea2a0f514dc55915dd4b7ad4f0d t/id_cmp_pp.t
+SHA1 a3f9a4aa77cbe3a54d7e3e70e7ace5ddd009ed7f t/num_forms.pl
+SHA1 2771c2e900726416e55414033f0a5b3a41e2ca5d t/part.t
+SHA1 4dd22cd59652f8d142c642fbe63538af7fb9f0b9 t/part_pp.t
+SHA1 904d9a4f76525e2303e4b0c168c68230f223c8de t/pod_cvg.t
+SHA1 3f447b1d0b8a6247c3a311087f8d66da1c3ca5db t/pod_cvg_pp.t
+SHA1 65c75abdef6f01a5d1588a307f2ddfe2333dc961 t/pod_syn.t
+SHA1 4278252027f78436b54d4a8f7cd308c9642e189f t/setup_pp.pl
+SHA1 c2a4a8ada07c9d5cf31930d47158292cfe6f543b t/val_cmp.at
SHA1 9eb602d316820b4779373e94992140dd5937f87e t/val_cmp_pp.at
SHA1 006502a882473614f46463941e42004a9b1f6096 t/values.data
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-iEYEARECAAYFAkn8sw4ACgkQOV9mt2VyAVEx3wCeONigT/MEDjtsOtrUh0kihQ1p
-pksAn1/O4o0J/WOMdLcd+TN5jLZZv+ec
-=aa4O
+iEYEARECAAYFAkzDS0gACgkQOV9mt2VyAVHv4gCgplM11o4cwq0Rwjf+QSZzl+XO
+8cIAoJT1g2B/Bs/5Is0rsIyZPtSQl3St
+=OMRA
-----END PGP SIGNATURE-----
Modified: branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.pm?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.pm (original)
+++ branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.pm Fri Dec 24 21:19:36 2010
@@ -39,10 +39,11 @@
package Scalar::Number;
+{ use 5.006; }
use warnings;
use strict;
-our $VERSION = "0.004";
+our $VERSION = "0.006";
use parent "Exporter";
our @EXPORT_OK = qw(
@@ -136,9 +137,9 @@
# efficiently.
eval { local $SIG{__DIE__}; require Scalar::Util; };
if($@ eq "") {
- *refaddr = \&Scalar::Util::refaddr;
+ *_refaddr = \&Scalar::Util::refaddr;
} else {
- *refaddr = sub($) {
+ *_refaddr = sub($) {
overload::StrVal($_[0]) =~ /0x([0-9a-f]+)\)\z/
or die "don't understand StrVal output";
return hex_natint($1);
@@ -190,13 +191,13 @@
no warnings qw(numeric uninitialized);
while(ref($val) ne "") {
my $meth = overload::Method($val, "0+");
- return refaddr($val) unless defined $meth;
+ return _refaddr($val) unless defined $meth;
my $newval = eval { local $SIG{__DIE__};
$meth->($val, undef, "");
};
if($@ ne "" || (ref($newval) ne "" &&
- refaddr($newval) == refaddr($val))) {
- return refaddr($val);
+ _refaddr($newval) == _refaddr($val))) {
+ return _refaddr($val);
}
$val = $newval;
}
@@ -449,7 +450,7 @@
=head1 COPYRIGHT
-Copyright (C) 2007, 2009 Andrew Main (Zefram) <zefram at fysh.org>
+Copyright (C) 2007, 2009, 2010 Andrew Main (Zefram) <zefram at fysh.org>
=head1 LICENSE
Modified: branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.xs?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.xs (original)
+++ branches/upstream/libscalar-number-perl/current/lib/Scalar/Number.xs Fri Dec 24 21:19:36 2010
@@ -1,12 +1,22 @@
+#define PERL_NO_GET_CONTEXT 1
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
+#define PERL_DECIMAL_VERSION \
+ PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
+#define PERL_VERSION_GE(r,v,s) \
+ (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
+
+#define Q_IOK_MAYBE_SPURIOUS (!PERL_VERSION_GE(5,7,1))
+#define Q_STRING_ZERO_FLOATS PERL_VERSION_GE(5,13,6)
+
/*
* The way an SV is interpreted for its numerical value varies between Perl
- * versions. The new way (perl 5.8+) is that the IOK and NOK flags
+ * versions. The new way (perl 5.7.1+) is that the IOK and NOK flags
* strictly indicate that the numerical value is acceptably represented by
- * the corresponding field. The old way (up to perl 5.6) is that the IOK
+ * the corresponding field. The old way (up to perl 5.7.0) is that the IOK
* and NOK flags indicate that the corresponding field is filled, but it
* might be a conversion from the other form. In the old form, most
* arithmetic is floating point, so to handle an integer that can't be
@@ -23,10 +33,8 @@
* new yes no use IV/UV
* new yes yes use IV/UV
*
- * Which set of rules applies is controlled by the iok_maybe_spurious flag.
+ * Which set of rules applies is controlled by the Q_IOK_MAYBE_SPURIOUS flag.
*/
-
-int iok_maybe_spurious;
/*
* string_2num() resolves a string SV into one that has the same numeric
@@ -36,31 +44,41 @@
* have an unrelated string value. Warns for non-numeric strings.
*/
-static SV *string_2num(SV *s)
+#define string_2num(s) THX_string_2num(aTHX_ s)
+static SV *THX_string_2num(pTHX_ SV *s)
{
if(SvIOK(s) || SvNOK(s)) return s;
s = sv_mortalcopy(s);
- if(!iok_maybe_spurious && (SvIV(s), SvIOK(s))) {
+ if(!Q_IOK_MAYBE_SPURIOUS && (SvIV(s), SvIOK(s))) {
if(Q_HAVE_SIGNED_ZERO && SvIVX(s) == 0) {
/* It's a zero, and asking for SvIV has squashed
* it to an integer zero, but it wouldn't
- * necessarily be considered an integer zero by
- * other operations. To match the behaviour of
- * the printf("%.f")-based test, we regard the
- * behaviour of the negate operation canonical.
- * This preserves sign iff the string value
- * starts with a sign.
+ * necessarily be considered an integer zero
+ * by other operations. We seek to match the
+ * behaviour of the printf("%.f")-based test,
+ * thus regarding the behaviour of the negate
+ * operation canonical.
*/
- char c = *SvPV_nolen(s);
- if(c == '-') {
- sv_setnv(s, -0.0);
- SvIOK_off(s);
- } else if(c == '+') {
- sv_setnv(s, 0.0);
- SvIOK_off(s);
+ if(Q_STRING_ZERO_FLOATS) {
+ /* String zeroes now always turn into
+ * floating-point zeroes.
+ */
+ sv_setnv(s, SvNV(s));
} else {
- sv_setiv(s, 0);
- SvNOK_off(s);
+ /* Preserve sign iff the string value
+ * starts with a sign character.
+ */
+ char c = *SvPV_nolen(s);
+ if(c == '-') {
+ sv_setnv(s, -0.0);
+ SvIOK_off(s);
+ } else if(c == '+') {
+ sv_setnv(s, 0.0);
+ SvIOK_off(s);
+ } else {
+ sv_setiv(s, 0);
+ SvNOK_off(s);
+ }
}
}
} else {
@@ -81,12 +99,13 @@
the boot function. */
static NV neg_natint_limit, pos_natint_limit;
-static SV *numscl_val_cmp(SV *a, SV *b)
+#define numscl_val_cmp(a, b) THX_numscl_val_cmp(aTHX_ a, b)
+static SV *THX_numscl_val_cmp(pTHX_ SV *a, SV *b)
{
bool aiok, biok;
int result;
- aiok = iok_maybe_spurious ? !SvNOK(a) : !!SvIOK(a);
- biok = iok_maybe_spurious ? !SvNOK(b) : !!SvIOK(b);
+ aiok = Q_IOK_MAYBE_SPURIOUS ? !SvNOK(a) : !!SvIOK(a);
+ biok = Q_IOK_MAYBE_SPURIOUS ? !SvNOK(b) : !!SvIOK(b);
if(aiok && biok) {
if(SvIOK_UV(a)) {
if(SvIOK_UV(b)) {
@@ -152,13 +171,9 @@
MODULE = Scalar::Number PACKAGE = Scalar::Number
+PROTOTYPES: DISABLE
+
BOOT:
-{
- SV *t = newSVnv(0.5);
- (void) SvIV(t);
- iok_maybe_spurious = !!SvIOK(t);
- SvREFCNT_dec(t);
-}
{
int i;
neg_natint_limit = -1.0;
@@ -184,7 +199,7 @@
scalar = sv_2mortal(newSVuv(PTR2UV(SvRV(scalar))));
}
scalar = string_2num(scalar);
- if(iok_maybe_spurious && SvNOK(scalar)) {
+ if(Q_IOK_MAYBE_SPURIOUS && SvNOK(scalar)) {
RETVAL = newSVnv(SvNVX(scalar));
} else if(SvIOK_notUV(scalar)) {
RETVAL = newSViv(SvIVX(scalar));
@@ -201,7 +216,7 @@
PROTOTYPE: $
CODE:
scalar = string_2num(scalar);
- if(iok_maybe_spurious ? !SvNOK(scalar) : SvIOK(scalar)) {
+ if(Q_IOK_MAYBE_SPURIOUS ? !SvNOK(scalar) : SvIOK(scalar)) {
RETVAL = 1;
} else {
NV val = SvNVX(scalar);
@@ -224,7 +239,7 @@
CODE:
scalar = string_2num(scalar);
if(SvNOK(scalar)) {
- RETVAL = !(Q_HAVE_SIGNED_ZERO && !iok_maybe_spurious &&
+ RETVAL = !(Q_HAVE_SIGNED_ZERO && !Q_IOK_MAYBE_SPURIOUS &&
SvIOK(scalar) && SvIVX(scalar) == 0);
} else {
UV mag = SvIOK_UV(scalar) ? SvUVX(scalar) :
@@ -270,8 +285,8 @@
CODE:
a = string_2num(a);
b = string_2num(b);
- aiok = iok_maybe_spurious ? !SvNOK(a) : !!SvIOK(a);
- biok = iok_maybe_spurious ? !SvNOK(b) : !!SvIOK(b);
+ aiok = Q_IOK_MAYBE_SPURIOUS ? !SvNOK(a) : !!SvIOK(a);
+ biok = Q_IOK_MAYBE_SPURIOUS ? !SvNOK(b) : !!SvIOK(b);
anan = !aiok && SvNVX(a) != SvNVX(a);
bnan = !biok && SvNVX(b) != SvNVX(b);
if(anan || bnan) {
Modified: branches/upstream/libscalar-number-perl/current/t/class.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/class.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/class.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/class.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Data::Float 0.008
qw(have_signed_zero have_nan have_infinite significand_bits);
use Data::Integer 0.001 qw(natint_bits);
@@ -16,12 +19,12 @@
if($_ eq "z") {
if(have_signed_zero) {
push @tests,
- [ 1, 0, [ natint_forms(0) ] ],
- [ 0, 1, [ float_forms(+0.0) ] ],
- [ 0, 1, [ float_forms(-0.0) ] ];
+ [ 1, 0, [ natint_forms("0") ] ],
+ [ 0, 1, [ float_forms("+0") ] ],
+ [ 0, 1, [ float_forms("-0") ] ];
} else {
push @tests, [ 1, 1,
- [ natint_forms(0), float_forms(0) ] ];
+ [ natint_forms("0"), float_forms("0") ] ];
}
next;
}
@@ -47,7 +50,7 @@
my $nzero = $ozero;
my $tzero = $ozero;
$func->($tzero);
- is zero_flavour($tzero), zero_flavour($nzero);
+ is zpat($tzero), zpat($nzero);
}
}
Modified: branches/upstream/libscalar-number-perl/current/t/class_pp.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/class_pp.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/class_pp.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/class_pp.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,7 @@
+use warnings;
+use strict;
+
do "t/setup_pp.pl" or die $@ || $!;
do "t/class.t" or die $@ || $!;
+
1;
Modified: branches/upstream/libscalar-number-perl/current/t/id_cmp.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/id_cmp.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/id_cmp.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/id_cmp.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Data::Float 0.008 qw(have_signed_zero have_nan have_infinite);
use Test::More;
@@ -10,9 +13,9 @@
[ float_forms("-0x1.edp+6") ],
[ natint_forms("-0x1"), float_forms("-0x1p+0") ],
[ float_forms("-0x1.1p-3") ],
- have_signed_zero ? [ float_forms(-0.0) ] : [],
- have_signed_zero ? [ natint_forms(0) ] : [ natint_forms(0), float_forms(0) ],
- have_signed_zero ? [ float_forms(+0.0) ] : [],
+ have_signed_zero ? [ float_forms("-0") ] : [],
+ have_signed_zero ? [ natint_forms("0") ] : [ natint_forms("0"), float_forms("0") ],
+ have_signed_zero ? [ float_forms("+0") ] : [],
[ float_forms("+0x1.1p-3") ],
[ natint_forms("+0x1"), float_forms("+0x1p+0") ],
[ float_forms("+0x1.edp+6") ],
Modified: branches/upstream/libscalar-number-perl/current/t/id_cmp_pp.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/id_cmp_pp.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/id_cmp_pp.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/id_cmp_pp.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,7 @@
+use warnings;
+use strict;
+
do "t/setup_pp.pl" or die $@ || $!;
do "t/id_cmp.t" or die $@ || $!;
+
1;
Modified: branches/upstream/libscalar-number-perl/current/t/num_forms.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/num_forms.pl?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/num_forms.pl (original)
+++ branches/upstream/libscalar-number-perl/current/t/num_forms.pl Fri Dec 24 21:19:36 2010
@@ -4,10 +4,7 @@
use Data::Float 0.008;
use Data::Integer 0.003;
-sub zero_flavour($) {
- my($v) = @_;
- return sprintf("%+.f%+.f%+.f", $v, -$v, - -$v);
-}
+sub zpat($) { my($z) = @_; my $nz = -$z; sprintf("%+.f%+.f%+.f",$z,$nz,-$nz) }
sub natint_forms($) {
my($hex) = @_;
@@ -24,8 +21,8 @@
push @forms, $fval;
}
if((my $t = $ival) == 0) {
- push @forms, "0.0";
- @forms = grep { zero_flavour($_) eq "+0+0+0" } @forms;
+ push @forms, "0", "0.0", "+0", "+0.0", "-0", "-0.0";
+ @forms = grep { zpat($_) eq "+0+0+0" } @forms;
}
return @forms;
}
@@ -48,10 +45,9 @@
{ no warnings "void"; use integer; $ival + 0; }
my @forms = ($fval, $ival);
if($class eq "ZERO") {
- push @forms, "0", "0.0";
- push @forms, sprintf("%+.f", $fval), sprintf("%+.1f", $fval);
- my $flavour = zero_flavour($fval);
- @forms = grep { zero_flavour($_) eq $flavour } @forms;
+ push @forms, "0", "0.0", "+0", "+0.0", "-0", "-0.0";
+ my $flavour = zpat($fval);
+ @forms = grep { zpat($_) eq $flavour } @forms;
}
return @forms;
}
Modified: branches/upstream/libscalar-number-perl/current/t/part.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/part.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/part.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/part.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Data::Integer 0.003 qw(min_sint max_uint hex_natint);
use Test::More tests => 1 + 3 + 4*22 + 5*8 + 6*2;
@@ -8,7 +11,7 @@
foreach my $nzero (0, +0.0, -0.0) {
my $tzero = $nzero;
scalar_num_part($tzero);
- is zero_flavour($tzero), zero_flavour($nzero);
+ is zpat($tzero), zpat($nzero);
}
sub match($$) {
@@ -20,7 +23,7 @@
if((my $t = $_[1]) == 0) {
my $tn = $num_part;
my $tc = $_[1];
- is zero_flavour($tn), zero_flavour($tc);
+ is zpat($tn), zpat($tc);
} else {
ok 1;
}
Modified: branches/upstream/libscalar-number-perl/current/t/part_pp.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/part_pp.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/part_pp.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/part_pp.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,7 @@
+use warnings;
+use strict;
+
do "t/setup_pp.pl" or die $@ || $!;
do "t/part.t" or die $@ || $!;
+
1;
Modified: branches/upstream/libscalar-number-perl/current/t/pod_cvg.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/pod_cvg.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/pod_cvg.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/pod_cvg.t Fri Dec 24 21:19:36 2010
@@ -1,4 +1,9 @@
+use warnings;
+use strict;
+
use Test::More;
plan skip_all => "Test::Pod::Coverage not available"
unless eval "use Test::Pod::Coverage; 1";
Test::Pod::Coverage::all_pod_coverage_ok();
+
+1;
Added: branches/upstream/libscalar-number-perl/current/t/pod_cvg_pp.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/pod_cvg_pp.t?rev=66228&op=file
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/pod_cvg_pp.t (added)
+++ branches/upstream/libscalar-number-perl/current/t/pod_cvg_pp.t Fri Dec 24 21:19:36 2010
@@ -1,0 +1,7 @@
+use warnings;
+use strict;
+
+do "t/setup_pp.pl" or die $@ || $!;
+do "t/pod_cvg.t" or die $@ || $!;
+
+1;
Modified: branches/upstream/libscalar-number-perl/current/t/pod_syn.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/pod_syn.t?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/pod_syn.t (original)
+++ branches/upstream/libscalar-number-perl/current/t/pod_syn.t Fri Dec 24 21:19:36 2010
@@ -1,3 +1,8 @@
+use warnings;
+use strict;
+
use Test::More;
plan skip_all => "Test::Pod not available" unless eval "use Test::Pod 1.00; 1";
Test::Pod::all_pod_files_ok();
+
+1;
Modified: branches/upstream/libscalar-number-perl/current/t/setup_pp.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/setup_pp.pl?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/setup_pp.pl (original)
+++ branches/upstream/libscalar-number-perl/current/t/setup_pp.pl Fri Dec 24 21:19:36 2010
@@ -12,7 +12,7 @@
no warnings "redefine";
*XSLoader::load = sub {
die "XS loading disabled for Scalar::Number"
- if $_[0] eq "Scalar::Number";
+ if ($_[0] || "") eq "Scalar::Number";
goto &$orig_load;
};
Modified: branches/upstream/libscalar-number-perl/current/t/val_cmp.at
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libscalar-number-perl/current/t/val_cmp.at?rev=66228&op=diff
==============================================================================
--- branches/upstream/libscalar-number-perl/current/t/val_cmp.at (original)
+++ branches/upstream/libscalar-number-perl/current/t/val_cmp.at Fri Dec 24 21:19:36 2010
@@ -33,7 +33,6 @@
use_ok "Scalar::Number", qw(sclnum_val_cmp);
-sub zpat($) { my($z) = @_; sprintf("%+.f%+.f%+.f", $z, -$z, - -$z) }
foreach my $vz (@zeroes) {
my $pz = zpat($vz);
for(my $ib = @values; $ib--; ) { foreach my $vb (@{$values[$ib]}) {
More information about the Pkg-perl-cvs-commits
mailing list