Last Comment Bug 670111 - Add double overloads to NSToCoord(Round|Floor|Ceil|Clamped) to stop numerous build warnings
: Add double overloads to NSToCoord(Round|Floor|Ceil|Clamped) to stop numerous ...
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla8
Assigned To: Ed Morley [:emorley]
: Milan Sreckovic [:milan]
Depends on: 629196
Blocks: buildwarning 447838
  Show dependency treegraph
Reported: 2011-07-08 04:46 PDT by Ed Morley [:emorley]
Modified: 2011-07-27 03:42 PDT (History)
5 users (show)
bzbarsky: in‑testsuite-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (3.22 KB, patch)
2011-07-08 04:50 PDT, Ed Morley [:emorley]
roc: review+
Details | Diff | Splinter Review

Description User image Ed Morley [:emorley] 2011-07-08 04:46:01 PDT
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 :-)
Comment 1 User image Ed Morley [:emorley] 2011-07-08 04:50:21 PDT
Created attachment 544777 [details] [diff] [review]
Patch v1

Double overloads of NSToCoord(Round|Floor|Ceil|Clamped), broken out from bug 447838.

Thanks :-)
Comment 2 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2011-07-08 15:16:39 PDT
Comment on attachment 544777 [details] [diff] [review]
Patch v1

Review of attachment 544777 [details] [diff] [review]:
Comment 3 User image Ed Morley [:emorley] 2011-07-09 03:58:22 PDT
Passed try:
Comment 4 User image Boris Zbarsky [:bz] (still a bit busy) 2011-07-11 06:21:40 PDT
Comment 5 User image Mounir Lamouri (:mounir) 2011-07-12 03:42:43 PDT
Comment 6 User image :Ehsan Akhgari 2011-07-15 13:29:59 PDT
I've backed this out from inbound to see if it affects the frequency of bug 629196: <>
Comment 7 User image Joe Drew (not getting mail) 2011-07-17 17:30:12 PDT
And this backout was merged to m-c:
Comment 8 User image Ed Morley [:emorley] 2011-07-26 12:42:00 PDT
Ehsan, please can this and bug 670338 be relanded now, given 4 x 100 OS X 10.6 reftest try runs showed no correlation ( and that the test has now been adjusted / bug 629196 resolved fixed anyway (

Thanks :-)
Comment 9 User image :Ehsan Akhgari 2011-07-26 14:55:23 PDT
Sure, just pushed them both to inbound.  Thanks for the investigation!
Comment 10 User image Marco Bonardo [::mak] 2011-07-27 03:42:35 PDT

Note You need to log in before you can comment on or make changes to this bug.