Closed Bug 670111 Opened 13 years ago Closed 13 years ago

Add double overloads to NSToCoord(Round|Floor|Ceil|Clamped) to stop numerous build warnings

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: emorley, Assigned: emorley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

Bug 447838 is trying to stop the build warnings in nsTextFrameThebes.cpp, many of which are along the lines of:
> warning C4244: 'argument' : conversion from 'gfxFloat' to 'float', possible loss of data

To save countless delightful changes like:
-    *snappedEndEdge = NSToCoordFloor(gfxFloat(frameWidth) - advanceWidth);
+    *snappedEndEdge = NSToCoordFloor(float(gfxFloat(frameWidth) - advanceWidth));

Roc suggested that I add double overloads to NSToCoord(Round|Floor|Ceil|Clamped).

A quick glance at |conversion from 'gfxFloat' to 'float'| build warnings in files other than nsTextFrameThebes.cpp, shows that this will fix some of the warnings in other files as well :-)
Blocks: buildwarning
Attached patch Patch v1Splinter Review
Double overloads of NSToCoord(Round|Floor|Ceil|Clamped), broken out from bug 447838.

Thanks :-)
Attachment #544777 - Flags: review?(roc)
Comment on attachment 544777 [details] [diff] [review]
Patch v1

Review of attachment 544777 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #544777 - Flags: review?(roc) → review+
Whiteboard: [build_warning]
Merged:
http://hg.mozilla.org/mozilla-central/rev/e2139ab44181
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
Depends on: 629196
I've backed this out from inbound to see if it affects the frequency of bug 629196: <http://hg.mozilla.org/integration/mozilla-inbound/rev/2f5959074445>
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Ehsan, please can this and bug 670338 be relanded now, given 4 x 100 OS X 10.6 reftest try runs showed no correlation (https://bugzilla.mozilla.org/show_bug.cgi?id=629196#c27) and that the test has now been adjusted / bug 629196 resolved fixed anyway (https://bugzilla.mozilla.org/show_bug.cgi?id=629196#c30).

Thanks :-)
Sure, just pushed them both to inbound.  Thanks for the investigation!
http://hg.mozilla.org/mozilla-central/rev/10601c08fc30
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: