This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Silence compiler warning
authorKarl Williamson <public@khwilliamson.com>
Mon, 7 Jan 2013 03:01:28 +0000 (20:01 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 7 Jan 2013 04:22:43 +0000 (21:22 -0700)
One of our smoke compilers is not smart enough to know that the
remainder when dividing by two can only be a 0 or a 1.

regcomp.c

index 24d5561..75bb6a2 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -11724,8 +11724,9 @@ parseit:
                         _invlist_union_maybe_complement_2nd(
                                 cp_list,
                                 PL_XPosix_ptrs[classnum],
-                                namedclass % 2,  /* Complement if odd
-                                                    (NHORIZWS, NVERTWS) */
+                                cBOOL(namedclass % 2), /* Complement if odd
+                                                          (NHORIZWS, NVERTWS)
+                                                        */
                                 &cp_list);
                     }
                 }
@@ -11739,7 +11740,8 @@ parseit:
                         _invlist_union_maybe_complement_2nd(
                                 posixes,
                                 PL_ASCII,
-                                namedclass % 2, /* Complement if odd (NASCII) */
+                                cBOOL(namedclass % 2), /* Complement if odd
+                                                          (NASCII) */
                                 &posixes);
                 }
                 else {  /* Garden variety class */