Changeset 52292 in webkit


Ignore:
Timestamp:
Dec 17, 2009 2:37:17 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-17 Steve Block <steveblock@google.com>

Reviewed by Eric Seidel.

Fixes HTMLInputElement::stepMismatch() to avoid ambiguous overload of pow().
https://bugs.webkit.org/show_bug.cgi?id=32675

Build fix only, no new tests.

  • html/HTMLInputElement.cpp: Modified. (WebCore::HTMLInputElement::stepMismatch): Cast first argument of pow to double to force 'double pow(double, int)'
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r52288 r52292  
     12009-12-17  Steve Block  <steveblock@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Fixes HTMLInputElement::stepMismatch() to avoid ambiguous overload of pow().
     6        https://bugs.webkit.org/show_bug.cgi?id=32675
     7
     8        Build fix only, no new tests.
     9
     10        * html/HTMLInputElement.cpp: Modified.
     11        (WebCore::HTMLInputElement::stepMismatch): Cast first argument of pow to double to force 'double pow(double, int)'
     12
    1132009-12-17  Marc-Antoine Ruel  <maruel@chromium.org>
    214
  • trunk/WebCore/html/HTMLInputElement.cpp

    r52204 r52292  
    338338        // value is greater than step*2^DBL_MANT_DIG, the following fmod() makes
    339339        // no sense.
    340         if (doubleValue / pow(2, DBL_MANT_DIG) > step)
     340        if (doubleValue / pow(static_cast<double>(2), DBL_MANT_DIG) > step)
    341341            return false;
    342342        double remainder = fmod(doubleValue, step);
    343343        // Accepts errors in lower 7-bit.
    344         double acceptableError = step / pow(2, DBL_MANT_DIG - 7);
     344        double acceptableError = step / pow(static_cast<double>(2), DBL_MANT_DIG - 7);
    345345        return acceptableError < remainder && remainder < (step - acceptableError);
    346346    }
Note: See TracChangeset for help on using the changeset viewer.