In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/d334ccbe5dc41b4f3085a341a760e04562dac34d?hp=808724c8e7a94623556f18e681fba068b52291a5>

- Log -----------------------------------------------------------------
commit d334ccbe5dc41b4f3085a341a760e04562dac34d
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 1 20:12:47 2014 -0400

    POSIX math: Comment tweaks.

M       ext/POSIX/POSIX.xs

commit 002ae7aa909e12f903b68e5bf6b1d83705c6f482
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 1 20:08:45 2014 -0400

    POSIX math: lgammal, not gammal.

M       ext/POSIX/POSIX.xs

commit f256868e821a3fbdb18816d1f5f9f1e3588f77c7
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 1 20:06:39 2014 -0400

    Make certain pp_sin result is always initialized.

M       pp.c
-----------------------------------------------------------------------

Summary of changes:
 ext/POSIX/POSIX.xs | 17 +++++++++++------
 pp.c               |  3 ++-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 6740f5e..e5231b8 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -158,12 +158,13 @@
 /* XXX Add ldiv(), lldiv()?  It's C99, but from stdlib.h, not math.h  */
 
 /* XXX Beware old gamma() -- one cannot know whether that is the
-   gamma or the log of gamma, that's why the new tgamma and lgamma. */
+ * gamma or the log of gamma, that's why the new tgamma and lgamma.
+ * Though also remember tgamma_r and lgamma_r. */
 
 /* XXX The truthiness of acosh() is the canary for all of the
  * C99 math.  This is very likely wrong, especially in non-UNIX lands
- * like Win32 and VMS, but also older UNIXes have issues.  For Win32
- * we later do some undefines for these interfaces.
+ * like Win32 and VMS, but also older UNIXes have issues.  For Win32,
+ * and other non-fully-C99, we later do some undefines for these interfaces.
  *
  * But we are very trying very hard to avoid introducing separate Configure
  * symbols for all the 40-ish new math symbols.  Especially since the set
@@ -188,7 +189,7 @@
 #    define c99_fmin   fminl
 #    define c99_hypot  hypotl
 #    define c99_ilogb  ilogbl
-#    define c99_lgamma gammal
+#    define c99_lgamma lgammal
 #    define c99_log1p  log1pl
 #    define c99_log2   log2l
 #    define c99_logb   logbl
@@ -1902,7 +1903,9 @@ acos(x)
 #endif
            break;
        case 16:
-        /* XXX lgamma_r */
+        /* XXX lgamma_r -- the lgamma accesses a global variable (signgam),
+         * which is evil.  Some platforms have lgamma_r, which has
+         * extra parameter instead of the global variable. */
 #ifdef c99_lgamma
            RETVAL = c99_lgamma(x);
 #else
@@ -1964,7 +1967,9 @@ acos(x)
            RETVAL = tanh(x); /* C89 math */
            break;
        case 27:
-        /* XXX tgamma_r */
+        /* XXX tgamma_r -- the lgamma accesses a global variable (signgam),
+         * which is evil.  Some platforms have tgamma_r, which has
+         * extra parameter instead of the global variable. */
 #ifdef c99_tgamma
            RETVAL = c99_tgamma(x);
 #else
diff --git a/pp.c b/pp.c
index 723986c..b098ede 100644
--- a/pp.c
+++ b/pp.c
@@ -2703,7 +2703,7 @@ PP(pp_sin)
     {
       SV * const arg = POPs;
       const NV value = SvNV_nomg(arg);
-      NV result;
+      NV result = NV_NAN;
       if (neg_report) { /* log or sqrt */
          if (op_type == OP_LOG ? (value <= 0.0) : (value < 0.0)) {
              SET_NUMERIC_STANDARD();
@@ -2712,6 +2712,7 @@ PP(pp_sin)
          }
       }
       switch (op_type) {
+      default:
       case OP_SIN:  result = Perl_sin(value);  break;
       case OP_COS:  result = Perl_cos(value);  break;
       case OP_EXP:  result = Perl_exp(value);  break;

--
Perl5 Master Repository

Reply via email to