Last Comment Bug 769437 - nsCSSFrameConstructor.cpp:2925:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
: nsCSSFrameConstructor.cpp:2925:59: warning: comparison between signed and uns...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla16
Assigned To: :Ms2ger (⌚ UTC+1/+2)
:
Mentors:
Depends on:
Blocks: buildwarning 760848
  Show dependency treegraph
 
Reported: 2012-06-28 13:35 PDT by Daniel Holbert [:dholbert]
Modified: 2012-07-02 02:13 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (1.88 KB, patch)
2012-06-29 01:54 PDT, :Ms2ger (⌚ UTC+1/+2)
mounir: review+
Details | Diff | Splinter Review

Description Daniel Holbert [:dholbert] 2012-06-28 13:35:46 PDT
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.
Comment 1 :Ms2ger (⌚ UTC+1/+2) 2012-06-29 01:54:11 PDT
Created attachment 637806 [details] [diff] [review]
Patch v1
Comment 2 Mounir Lamouri (:mounir) 2012-06-29 02:00:31 PDT
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
Comment 3 :Ms2ger (⌚ UTC+1/+2) 2012-07-02 02:13:54 PDT
https://hg.mozilla.org/mozilla-central/rev/a31fc9052840

Note You need to log in before you can comment on or make changes to this bug.