Bug 142539 - Use std::numeric_limits<unsigned>::max() instead of (unsigned)-1
Summary: Use std::numeric_limits<unsigned>::max() instead of (unsigned)-1
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
Depends on:
Reported: 2015-03-10 12:22 PDT by Mark Lam
Modified: 2015-03-12 17:02 PDT (History)
2 users (show)

See Also:

the patch. (9.45 KB, patch)
2015-03-10 12:26 PDT, Mark Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2015-03-10 12:22:20 PDT
There is some residual code that is still using (unsigned)-1 to express std::numeric_limits<unsigned>::max().  We should fix them.
Comment 1 Mark Lam 2015-03-10 12:26:52 PDT
Created attachment 248346 [details]
the patch.
Comment 2 WebKit Commit Bot 2015-03-10 13:18:53 PDT
Comment on attachment 248346 [details]
the patch.

Clearing flags on attachment: 248346

Committed r181343: <http://trac.webkit.org/changeset/181343>
Comment 3 WebKit Commit Bot 2015-03-10 13:18:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Filip Pizlo 2015-03-12 16:51:51 PDT
Why not use UINT_MAX?  That's much clearer.
Comment 5 Mark Lam 2015-03-12 17:02:18 PDT
(In reply to comment #4)
> Why not use UINT_MAX?  That's much clearer.

I was misled by http://www.cplusplus.com/reference/climits/ which that UINT_MAX is 16 bit.  I see from http://en.cppreference.com/w/cpp/types/climits that I was wrong.  If you feel strongly about it, I can switch all the sites to UINT_MAX.