[libmath-prime-util-perl] 05/40: Remove unused variables, set reproducible random results in a benchmark

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:49:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.30
in repository libmath-prime-util-perl.

commit 472e956f6d3f65b5bb7a286f134ea81785eb14e7
Author: Dana Jacobsen <dana at acm.org>
Date:   Fri Jun 21 13:29:54 2013 -0700

    Remove unused variables, set reproducible random results in a benchmark
---
 XS.xs                          | 1 -
 examples/bench-mp-nextprime.pl | 1 +
 factor.c                       | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/XS.xs b/XS.xs
index e7817cf..e2f5679 100644
--- a/XS.xs
+++ b/XS.xs
@@ -477,7 +477,6 @@ is_prime(IN SV* n)
       set_val_from_sv(val, n);
       XSRETURN_UV(_XS_is_prime(val));
     } else {
-      SV* result;
       const char* sub = 0;
       if (_XS_get_callgmp())
         sub = (ix == 0) ? "Math::Prime::Util::GMP::is_prime"
diff --git a/examples/bench-mp-nextprime.pl b/examples/bench-mp-nextprime.pl
index dca6555..12580e0 100755
--- a/examples/bench-mp-nextprime.pl
+++ b/examples/bench-mp-nextprime.pl
@@ -7,6 +7,7 @@ use Math::Primality;
 use Benchmark qw/:all/;
 my $count = shift || -2;
 srand(29);  # So we have repeatable results
+Math::Prime::Util::prime_set_config(irand => sub { int(rand(4294967295)) });
 
 test_at_digits($_, 1000) for (5, 15, 25, 50, 200);
 
diff --git a/factor.c b/factor.c
index f8fbd9b..0e0f61e 100644
--- a/factor.c
+++ b/factor.c
@@ -560,7 +560,7 @@ static void lucas_seq(UV* Uret, UV* Vret, UV* Qkret, UV n, IV P, IV Q, UV k)
 int _XS_is_lucas_pseudoprime(UV n, int strength)
 {
   IV P, Q, D;
-  UV U, V, Qk, d, s, b;
+  UV U, V, Qk, d, s;
 
   if (n == 2 || n == 3) return 1;
   if (n < 5 || (n%2) == 0) return 0;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list