Closed
Bug 685322
Opened 13 years ago
Closed 13 years ago
Create implicit constructors on floating-point types taking integer types
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla11
People
(Reporter: joe, Assigned: joe)
References
Details
Attachments
(1 file, 1 obsolete file)
3.35 KB,
patch
|
joe
:
review+
|
Details | Diff | Splinter Review |
This patch lets us implicitly convert from an Int{Point,Size,Rect} to a {Point,Size,Rect}, which is non-lossy and therefore should be supported! It also corrects a typo in the template parameters for IntPoint: -struct IntPoint : - public BasePoint<int32_t, Point> { - typedef BasePoint<int32_t, Point> Super;
Attachment #558971 -
Flags: review?(roc)
Attachment #558971 -
Flags: review?(roc) → review+
Assignee | ||
Comment 1•13 years ago
|
||
Bas rightfully points out that int -> float is lossy, since float can only represent 23 bits of fraction. (int->double would be non-lossy, though.) Therefore, I'm going to commit an explicit version of this patch. Carrying over r+ since this is strictly safer.
Assignee: nobody → joe
Attachment #558971 -
Attachment is obsolete: true
Attachment #565709 -
Flags: review+
Comment 2•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/677fe017e6a0
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
You need to log in
before you can comment on or make changes to this bug.
Description
•