Closed Bug 670338 Opened 8 years ago Closed 8 years ago

Add double overload to NSToIntRound to stop build warnings

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: emorley, Assigned: emorley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #670111 +++

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 clarity reducing changes like:
-          TabWidth(i - startOffset, nextTab - mOffsetFromBlockOriginForTabs));
+          TabWidth(i - startOffset, 
+                   NSToIntRound(float(nextTab - mOffsetFromBlockOriginForTabs))));

Roc suggested that I add a double overload to NSToIntRound.

Hopefully this will reduce the number of build warnings in files other than nsTextFrameThebes.cpp as well.
Attached patch Patch v1Splinter Review
Double overload for NSToIntRound, broken out from bug 447838.

Was going to include this in bug 670111 along with the NSToCoord* changes, but that's already reviewed and checkin-needed, so thought it would just be easier to deal with separately.
Attachment #544978 - Flags: review?(roc)
Whiteboard: [build_warning]
Blocks: 670461
Comment on attachment 544978 [details] [diff] [review]
Patch v1

Review of attachment 544978 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #544978 - Flags: review?(roc) → review+
Passed try (comment 2).
Keywords: checkin-needed
Merged:
http://hg.mozilla.org/mozilla-central/rev/ed3036facfb2
Status: ASSIGNED → RESOLVED
Closed: 8 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/af960bd72863>
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
http://hg.mozilla.org/mozilla-central/rev/a82beacfb5e3
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.