|Submitter||Diff||Changes||Open Issues||Last Updated|
|Error loading review requests:|
58 bytes, text/x-review-board-request
|Details | Review|
In our code base, we use nscoord_MAX to clamp some huge integers. I'm wondering how did this definition  come out? Why it is not (1 << 31 - 1)? If this is for avoiding integer overflows while adding two integers, would it be better to define nscoord_MAX to be (1 << 30 - 1)? Since (1 << 30) + (1 << 30) would still overflow.  http://searchfox.org/mozilla-central/rev/ae78ab94fadabc89fc6258d03c4a1a70f763f43a/gfx/src/nsCoord.h#49
Hmm... looks like we set nscoord_MAX to (1 << 30) for applying a runtime rounding algorithm on XP_WIN32 platform .  http://searchfox.org/mozilla-central/rev/f433f0dd7158d7bfc4c4607161fc6baa88b5a9f4/xpcom/ds/nsMathUtils.h#41
The value has been change in bug 1383492. Is it enough for you, Jeremy?
Yes, thanks for the info. Let's resolve this. \o/