Closed Bug 957859 Opened 6 years ago Closed 6 years ago

gfx\layers\Compositor.cpp(116) : warning C4305: 'argument' : truncation from 'double' to 'mozilla::gfx::Float'

Categories

(Core :: Graphics: Layers, defect)

x86
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

Build warning, found when trying bug 957784:
{
gfx\layers\Compositor.cpp(116) : warning C4305: 'argument' : truncation from 'double' to 'mozilla::gfx::Float'

This is in numeric literals passed into the Color() constructor.

As shown here...
 http://mxr.mozilla.org/mozilla-central/source/gfx/2d/Types.h#143
gfx::Color uses "f" suffixes on numeric literals internally, to force "float" type.

We should just use those in this code, too.
Actually, I'll just make this bug track all the related warnings for this file, since they're all the same category (truncating a numeric literal to from double to float):
{
c:\builds\moz2_slave\try-w32-0000000000000000000000\build\gfx\layers\Compositor.cpp(103) : warning C4305: 'initializing' : truncation from 'double' to 'float'
c:\builds\moz2_slave\try-w32-0000000000000000000000\build\gfx\layers\Compositor.cpp(116) : warning C4305: 'argument' : truncation from 'double' to 'mozilla::gfx::Float'
c:\builds\moz2_slave\try-w32-0000000000000000000000\build\gfx\layers\Compositor.cpp(116) : warning C4305: 'argument' : truncation from 'double' to 'mozilla::gfx::Float'
c:\builds\moz2_slave\try-w32-0000000000000000000000\build\gfx\layers\Compositor.cpp(125) : warning C4305: '*=' : truncation from 'double' to 'mozilla::gfx::Float'
c:\builds\moz2_slave\try-w32-0000000000000000000000\build\gfx\layers\Compositor.cpp(126) : warning C4305: '*=' : truncation from 'double' to 'mozilla::gfx::Float'
c:\builds\moz2_slave\try-w32-0000000000000000000000\build\gfx\layers\Compositor.cpp(127) : warning C4305: '*=' : truncation from 'double' to 'mozilla::gfx::Float'
}
Attached patch fix (obsolete) — Splinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #8357471 - Flags: review?(nical.bugzilla)
Attached patch fix v2Splinter Review
Updated fix, now adding an "f" suffix to an arg for a Color in ContainerLayerComposite.cpp, too, to fix:
{
gfx\layers\composite/ContainerLayerComposite.cpp(179) : warning C4305: 'argument' : truncation from 'double' to 'mozilla::gfx::Float'
}
Attachment #8357471 - Attachment is obsolete: true
Attachment #8357471 - Flags: review?(nical.bugzilla)
Attachment #8357494 - Flags: review?(nical.bugzilla)
Hardware: x86_64 → x86
Attachment #8357494 - Flags: review?(nical.bugzilla) → review+
https://hg.mozilla.org/mozilla-central/rev/198d23cf8b64
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.