nsCSSFrameConstructor.cpp:2925:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

RESOLVED FIXED in mozilla16

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: Ms2ger)

Tracking

(Blocks: 1 bug)

Trunk
mozilla16
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Bug 760848 introduced a build warning in nsCSSFrameConstructor.cpp
{
layout/base/nsCSSFrameConstructor.cpp:2925:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}
by changing the variable "size" from signed to unsigned.

The comparison in question is "size" (unsigned) vs. "kNoSizeSpecified" (signed, w/ value -1) in this line of code:
> 2925     if (((1 == size || 0 == size) || (kNoSizeSpecified  == size)) && (false == multipleSelect)) {
http://mxr.mozilla.org/mozilla-central/source/layout/base/nsCSSFrameConstructor.cpp#2925

It looks like kNoSizeSpecified is _only_ used in this comparison.  If we still need it, we should make it unsigned (and give it the correct (nonnegative) sentinel value), rather than -1.
(Assignee)

Comment 1

5 years ago
Created attachment 637806 [details] [diff] [review]
Patch v1
Assignee: nobody → Ms2ger
Status: NEW → ASSIGNED
Attachment #637806 - Flags: review?(mounir)
Comment on attachment 637806 [details] [diff] [review]
Patch v1

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

Thanks for doing that change. I was thinking of doing it but haven't find time for it!

r=mounir
Attachment #637806 - Flags: review?(mounir) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/a31fc9052840
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.