In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/a0d9739dbf6962a32b3417203c52f88526e790d8?hp=b15c1b561a4d9a6ec5ecdf68b69fda7ef7d09cb7>

- Log -----------------------------------------------------------------
commit a0d9739dbf6962a32b3417203c52f88526e790d8
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 22 09:25:42 2014 -0400

    POSIX math: add todo about the macro interface emulations.

M       ext/POSIX/POSIX.xs

commit 62904ca6e0a1bd27a0f4bcbc3cdf0cde63db84a9
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 22 14:51:01 2014 -0400

    Further tweaking for bad skip() usage.
    
    See also e96513a2.

M       t/test.pl

commit d3475fb81a1317499d42d46a16d7a21789b26667
Author: Jarkko Hietaniemi <[email protected]>
Date:   Sun Sep 21 21:53:24 2014 -0400

    No point in pack 'w' for inf/nan.
    
    (For inf, the existing code already did this, slowly.)

M       pp_pack.c
-----------------------------------------------------------------------

Summary of changes:
 ext/POSIX/POSIX.xs |  5 +++++
 pp_pack.c          |  7 ++++++-
 t/test.pl          | 13 +++++++------
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index d84db98..e9fba62 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -372,6 +372,11 @@
 #    endif
 #  endif
 
+/* XXX these isgreater/isnormal/isunordered macros definitions should
+ * be moved further in the file to be part of the emulations, so that
+ * platforms can e.g. #undef c99_isunordered and have it work like
+ * it does for the other interfaces. */
+
 #  if !defined(isgreater) && defined(isunordered)
 #    define isgreater(x, y)         (!isunordered((x), (y)) && (x) > (y))
 #    define isgreaterequal(x, y)    (!isunordered((x), (y)) && (x) >= (y))
diff --git a/pp_pack.c b/pp_pack.c
index d703a99..17f7182 100644
--- a/pp_pack.c
+++ b/pp_pack.c
@@ -2900,12 +2900,17 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV 
**beglist, SV **endlist )
                    char   buf[1 + (int)((308 + 1) / 2)]; /* valid C */
 #endif
                    char  *in = buf + sizeof(buf);
+                    static const char S_cannot_compress[] =
+                        "Cannot compress integer in pack";
+
+                    if (Perl_isinfnan(anv))
+                        Perl_croak(aTHX_ S_cannot_compress);
 
                    anv = Perl_floor(anv);
                    do {
                        const NV next = Perl_floor(anv / 128);
                        if (in <= buf)  /* this cannot happen ;-) */
-                           Perl_croak(aTHX_ "Cannot compress integer in pack");
+                           Perl_croak(aTHX_ S_cannot_compress);
                        *--in = (unsigned char)(anv - (next * 128)) | 0x80;
                        anv = next;
                    } while (anv > 0);
diff --git a/t/test.pl b/t/test.pl
index 0cfae31..92f732e 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -477,17 +477,18 @@ sub next_test {
 # be compatible with Test::More::skip().
 sub skip {
     my $why = shift;
-    my $n    = @_ ? shift : 1;
+    my $n   = @_ ? shift : 1;
     my $bad_swap;
     {
       local $^W = 0;
       $bad_swap = $why > 0 && $n == 0;
     }
-    if ($bad_swap) {
-      die qq[$0: expected skip(why, count), got skip($why, "$n")\n];
-    }
-    if (@_) {
-      die qq[$0: expected skip(why, count), got skip($why, "$n", @_)\n];
+    if ($bad_swap || @_) {
+      my $arg = "$why, '$n'";
+      if (@_) {
+        $arg .= join(", ", '', map { qq['$_'] } @_);
+      }
+      die qq[$0: expected skip(why, count), got skip($arg)\n];
     }
     for (1..$n) {
         _print "ok $test # skip $why\n";

--
Perl5 Master Repository

Reply via email to