[webkit-reviews] review granted: [Bug 107503] Fix DateMath.cpp to compile with -Wshorten-64-to-32 : [Attachment 183893] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 22 10:07:49 PST 2013


Darin Adler <darin at apple.com> has granted David Kilzer (:ddkilzer)
<ddkilzer at webkit.org>'s request for review:
Bug 107503: Fix DateMath.cpp to compile with -Wshorten-64-to-32
https://bugs.webkit.org/show_bug.cgi?id=107503

Attachment 183893: Patch
https://bugs.webkit.org/attachment.cgi?id=183893&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=183893&action=review


Seems OK. Things are still a bit of a mess. If we had more time to clean up
further, I think we could stop using long here. There’s no reason we need to
use strtol when we have perfectly good numeric conversion functions of our own.


> Source/WTF/wtf/DateMath.cpp:837
> +	   if (day <= std::numeric_limits<int>::min() || day >=
std::numeric_limits<int>::max())

These should be < and > rather than <= or >=. Unless there is some reason the
limit values are a problem. Except that probably will cause warnings on
platforms where long and int are the same size. Ugh.


More information about the webkit-reviews mailing list