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

RESOLVED FIXED in mozilla8

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

(Blocks: 1 bug)

Trunk
mozilla8
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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 :-)
(Assignee)

Updated

6 years ago
Blocks: 187528
(Assignee)

Comment 1

6 years ago
Created attachment 544777 [details] [diff] [review]
Patch v1

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+
(Assignee)

Comment 3

6 years ago
Passed try:
http://dev.philringnalda.com/tbpl/?tree=Try&rev=7e2dec83b318
Keywords: checkin-needed
(Assignee)

Updated

6 years ago
Whiteboard: [build_warning]
http://hg.mozilla.org/integration/mozilla-inbound/rev/e2139ab44181
Flags: in-testsuite-
Keywords: checkin-needed
Merged:
http://hg.mozilla.org/mozilla-central/rev/e2139ab44181
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
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 → ---
And this backout was merged to m-c: http://hg.mozilla.org/mozilla-central/rev/2f5959074445
(Assignee)

Comment 8

6 years ago
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
Last Resolved: 6 years ago6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.