Closed
Bug 729781
Opened 13 years ago
Closed 12 years ago
FrameLayerBuilder.cpp:1529:91: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.29 KB,
patch
|
Details | Diff | Splinter Review |
layout/base/FrameLayerBuilder.cpp: In member function ‘void mozilla::{anonymous}::ContainerState::InvalidateForLayerChange(nsDisplayItem*, mozilla::layers::Layer*)’:
layout/base/FrameLayerBuilder.cpp:1529:91: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
The code in question:
> 1529 NS_ASSERTION(appUnitsPerDevPixel ==
> 1530 mContainerFrame->PresContext()->AppUnitsPerDevPixel(),
> 1531 "app units per dev pixel should be constant in a container");
* appUnitsPerDevPixel is a signed value (PRInt32) (because it's potentially obtained via nsDisplayZoom::GetParentAppUnitsPerDevPixel() which returns a PRInt32)
* PresContext()->AppUnitsPerDevPixel() returns an unsigned value (PRUint32)
Simplest solution is to just cast one of the values to the other one's type.
(I think this was introduced by
http://hg.mozilla.org/mozilla-central/rev/8a2432d7f8f3
which changed PresContext::AppUnitsPerDevPixel() to return PRUint32)
Reporter | ||
Comment 1•13 years ago
|
||
Attachment #599827 -
Flags: review?(tnikkel)
Reporter | ||
Updated•13 years ago
|
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Comment 2•13 years ago
|
||
Instead of just papering over this warning can we make the types consistent? Ie make AppUnitsPerDevPixel in FrameLayerBuilder.cpp return PRUint32, which means display zoom items should store their values as PRUint32's, which means we have to change nsSubDocumentFrame::BuildDisplayList, which means changing ConvertAppUnitsRoundOut to take PRUint32's. This is just continuing what 8a2432d7f8f3 started by converting appunits per dev pixel into an unsigned int.
Reporter | ||
Comment 3•13 years ago
|
||
That works too. I think I looked ~2 layers into Comment 2 and saw signed integers, and stopped looking since it was just for code inside of an assertion anyway. :) But yeah, taking 8a2432d7f8f3 to its logical conclusion sounds reasonable.
Updated•13 years ago
|
Attachment #599827 -
Flags: review?(tnikkel)
![]() |
||
Comment 4•12 years ago
|
||
From what I can see:
- The assertion was removed in Bug 733607
- nsDisplayZoom::GetParentAppUnitsPerDevPixel() returns a int32_t
- PresContext()->AppUnitsPerDevPixel() returns a nscoord now
- In nsCoord.h, nscoord can equal int32_t or a float, but since #define NS_COORD_IS_FLOAT is commented out, it's a int32_t
- ConvertAppUnitsRoundOut() all take int_32t parameters now
So I'm guessing this bug can be closed now...?
Flags: needinfo?(dholbert)
![]() |
||
Comment 5•12 years ago
|
||
(In reply to Cykesiopka from comment #4)
> - ConvertAppUnitsRoundOut() all take int_32t parameters now
int32_t, sorry.
Reporter | ||
Comment 6•12 years ago
|
||
(In reply to Cykesiopka from comment #4)
> From what I can see:
> - The assertion was removed in Bug 733607
> So I'm guessing this bug can be closed now...?
Cool -- if the assertion's been removed, then that trivially fixes this. :)
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Depends on: 733607
Flags: needinfo?(dholbert)
Resolution: --- → WORKSFORME
Reporter | ||
Updated•12 years ago
|
Assignee: dholbert → nobody
Resolution: WORKSFORME → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•