Integrate:
[p5sagit/p5-mst-13.2.git] / pp.c
diff --git a/pp.c b/pp.c
index 0a15c74..ba6bf07 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1236,7 +1236,7 @@ PP(pp_divide)
                     }
                     RETURN;
                 } /* tried integer divide but it was not an integer result */
-            } /* else (abs(result) < 1.0) or (both UVs in range for NV) */
+            } /* else (PERL_ABS(result) < 1.0) or (both UVs in range for NV) */
         } /* left wasn't SvIOK */
     } /* right wasn't SvIOK */
 #endif /* PERL_TRY_UV_DIVIDE */
@@ -2471,25 +2471,23 @@ PP(pp_i_modulo_0)
      }
 }
 
+#ifdef __GLIBC__
 STATIC
 PP(pp_i_modulo_1)
 {
-#ifdef __GLIBC__
      /* This is the i_modulo with the workaround for the _moddi3 bug
-      * in (at least) glibc 2.2.5 (the "right = -right" is the workaround).
+      * in (at least) glibc 2.2.5 (the PERL_ABS() the workaround).
       * See below for pp_i_modulo. */
      dSP; dATARGET; tryAMAGICbin(modulo,opASSIGN);
      {
          dPOPTOPiirl;
          if (!right)
               DIE(aTHX_ "Illegal modulus zero");
-         if (right < 0)
-              right = -right;
-         SETi( left % right );
+         SETi( left % PERL_ABS(right) );
          RETURN;
      }
-#endif
 }
+#endif
 
 PP(pp_i_modulo)
 {
@@ -2522,8 +2520,7 @@ PP(pp_i_modulo)
                         PL_ppaddr[OP_I_MODULO] =
                             &Perl_pp_i_modulo_1;
                    /* Make certain we work right this time, too. */
-                   if (right < 0)
-                        right = -right;
+                   right = PERL_ABS(right);
               }
          }
 #endif