Fix build: using integer absolute value function 'abs' when argument is of floating...
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Mar 2014 22:24:52 +0000 (22:24 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Mar 2014 22:24:52 +0000 (22:24 +0000)
<http://webkit.org/b/130286>

Reviewed by Filip Pizlo.

Fixes the following build failure using trunk clang:

    JavaScriptCore/assembler/MacroAssembler.h:992:17: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
            value = abs(value);
                    ^
    JavaScriptCore/assembler/MacroAssembler.h:992:17: note: use function 'fabs' instead
            value = abs(value);
                    ^~~
                    fabs

* assembler/MacroAssembler.h:
(JSC::MacroAssembler::shouldBlindDouble): Switch from abs() to
fabs().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165683 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/MacroAssembler.h

index 3ff4053d48972dff182866ed62b554245874899b..089684dd845cba3884b4c1b3ae1f66297c5c9b8d 100644 (file)
@@ -1,3 +1,24 @@
+2014-03-15  David Kilzer  <ddkilzer@apple.com>
+
+        Fix build: using integer absolute value function 'abs' when argument is of floating point type
+        <http://webkit.org/b/130286>
+
+        Reviewed by Filip Pizlo.
+
+        Fixes the following build failure using trunk clang:
+
+            JavaScriptCore/assembler/MacroAssembler.h:992:17: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
+                    value = abs(value);
+                            ^
+            JavaScriptCore/assembler/MacroAssembler.h:992:17: note: use function 'fabs' instead
+                    value = abs(value);
+                            ^~~
+                            fabs
+
+        * assembler/MacroAssembler.h:
+        (JSC::MacroAssembler::shouldBlindDouble): Switch from abs() to
+        fabs().
+
 2014-03-14  Oliver Hunt  <oliver@apple.com>
 
         Reinstate intialiser syntax in for-in loops
index 60be600dc749a380817aef6c9d092e90a74f9af3..a1a610e7fc30af8e5039775a0c664bfc2c368a59 100644 (file)
@@ -989,7 +989,7 @@ public:
         if (bitwise_cast<uint64_t>(value * 1.0) != bitwise_cast<uint64_t>(value))
             return shouldConsiderBlinding();
 
-        value = abs(value);
+        value = fabs(value);
         // Only allow a limited set of fractional components
         double scaledValue = value * 8;
         if (scaledValue / 8 != value)