Closed Bug 1245525 Opened 4 years ago Closed 4 years ago

Some compiler warnings when compiling without some warnings disabled in Moz2D

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: bas.schouten, Assigned: bas.schouten)

Details

Attachments

(1 file)

There's some of these that are easy to improve. Seems fine to just do this and not have the warnings even if they'd be working.
Comment on attachment 8715326 [details]
MozReview Request: Bug 1245525: Fix some compiler errors in Moz2D type classes. r=jrmuizel

https://reviewboard.mozilla.org/r/33387/#review30111

::: gfx/2d/BaseMargin.h:24
(Diff revision 1)
> -  bool Top()     const { return mBits & eSideBitsTop; }
> +  bool Top()     const { return !!(mBits & eSideBitsTop); }

What warning is this?

::: gfx/2d/Matrix.h:301
(Diff revision 1)
> -      !FuzzyEqual(_31, floor(_31 + 0.5)) ||
> +      !FuzzyEqual(_31, floor(_31 + Float(0.5))) ||

0.5f
Attachment #8715326 - Flags: review?(jmuizelaar)
(In reply to Jeff Muizelaar [:jrmuizel] from comment #2)
> Comment on attachment 8715326 [details]
> MozReview Request: Bug 1245525: Fix some compiler errors in Moz2D type
> classes. r=jrmuizel
> 
> https://reviewboard.mozilla.org/r/33387/#review30111
> 
> ::: gfx/2d/BaseMargin.h:24
> (Diff revision 1)
> > -  bool Top()     const { return mBits & eSideBitsTop; }
> > +  bool Top()     const { return !!(mBits & eSideBitsTop); }
> 
> What warning is this?

C4800 (https://msdn.microsoft.com/en-us/library/b6801kcy.aspx)

> ::: gfx/2d/Matrix.h:301
> (Diff revision 1)
> > -      !FuzzyEqual(_31, floor(_31 + 0.5)) ||
> > +      !FuzzyEqual(_31, floor(_31 + Float(0.5))) ||
> 
> 0.5f

Actually, no, _31 is of type Float, should we at some point decide to make Moz2D use double precision it would be great not to have to change our constants. This maintains consistency.
Flags: needinfo?(jmuizelaar)
https://hg.mozilla.org/mozilla-central/rev/d527c9506afa
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Flags: needinfo?(jmuizelaar)
You need to log in before you can comment on or make changes to this bug.