[libmath-prime-util-perl] 31/40: signed chars fix for defined-out LMO function

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:49:05 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 3ca27cda101285d029d674eed516fdc351c8e9d0
Author: Dana Jacobsen <dana at acm.org>
Date:   Wed Jul 24 17:21:44 2013 -0700

    signed chars fix for defined-out LMO function
---
 lehmer.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lehmer.c b/lehmer.c
index 214d205..a141d76 100644
--- a/lehmer.c
+++ b/lehmer.c
@@ -669,7 +669,7 @@ UV _XS_LMO_pi(UV n)
   IV S1;
   UV S2, P2;
   const UV* primes = 0;  /* small prime cache */
-  char* mu = 0;          /* moebius to n^1/3 */
+  signed char* mu = 0;          /* moebius to n^1/3 */
   UV*   lpf = 0;         /* least prime factor to n^1/3 */
   DECLARE_TIMING_VARIABLES;
   if (n < SIEVE_LIMIT)
@@ -696,13 +696,11 @@ UV _XS_LMO_pi(UV n)
   TIMING_START;
   /* We could call MPU's:
    *    mu = _moebius_range(0, n13+1)
-   * but (1) it's a bit slower (something to be addressed), and (2) we will
-   * do the least prime factor calculation at the same time.
+   * but we will do the least prime factor calculation at the same time.
    */
-  New(0, mu, n13+1, char);
+  New(0, mu, n13+1, signed char);
   memset(mu, 1, sizeof(char) * (n13+1));
-  New(0, lpf, n13+1, UV);
-  memset(lpf, 0, sizeof(UV) * (n13+1));
+  Newz(0, lpf, n13+1, UV);
   mu[0] = 0;
   for (i = 1; i <= a; i++) {
     UV primei = primes[i];

-- 
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