Closed Bug 925195 Opened 6 years ago Closed 6 years ago

ImageBridgeParent.cpp:201:30: warning: comparison of integers of different signs [-Wsign-compare]

Categories

(Core :: Graphics: Layers, defect, minor)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla27
Tracking Status
firefox26 --- unaffected
firefox27 --- fixed

People

(Reporter: keeler, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

9:53.41 /home/keeler/mozilla-central/gfx/layers/ipc/ImageBridgeParent.cpp:201:30: warning: comparison of integers of different signs: 'const uint32_t' (aka 'const unsigned int') and 'int' [-Wsign-compare]
 9:53.41     if (aFds[i].protocolId() == (int)GetProtocolId()) {
Assignee: nobody → cpeterson
Severity: normal → minor
Status: NEW → ASSIGNED
The ImageBridgeParent::CloneToplevel() function cast GetProtocolId()'s IPCMessageStart enum return value to int, but compared it to an uint32_t.

Other uses of GetProtocolId() cast its return value to (just) `unsigned`:

https://mxr.mozilla.org/mozilla-central/search?string=%29getProtocolId%28%29
Attachment #818831 - Flags: review?(bent.mozilla)
Comment on attachment 818831 [details] [diff] [review]
fix-warning.patch

Review of attachment 818831 [details] [diff] [review]:
-----------------------------------------------------------------

r=me, thanks!

::: gfx/layers/ipc/ImageBridgeParent.cpp
@@ +194,5 @@
>                                   base::ProcessHandle aPeerProcess,
>                                   mozilla::ipc::ProtocolCloneContext* aCtx)
>  {
>    for (unsigned int i = 0; i < aFds.Length(); i++) {
> +    if (aFds[i].protocolId() == (unsigned)GetProtocolId()) {

Can you use C++-style constructor here? E.g.: | == unsigned(GetProtocolId())|
Attachment #818831 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/fec466b50c14
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.