Closed Bug 829112 Opened 11 years ago Closed 11 years ago

Fix "comparison between signed and unsigned integer expressions" warnings in nsStyleSet.cpp

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

nsStyleSet.cpp has a bunch of build warnings from using a signed variable as a loop-iterator, which we compare to an unsigned 'count' variable in the loop condition.

{
layout/style/nsStyleSet.cpp: In member function ‘nsresult nsStyleSet::GatherRuleProcessors(nsStyleSet::sheetType)’:

layout/style/nsStyleSet.cpp:298:62: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

layout/style/nsStyleSet.cpp:335:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

layout/style/nsStyleSet.cpp: In member function ‘void nsStyleSet::FileRules(nsIStyleRuleProcessor::EnumFunc, RuleProcessorData*, mozilla::dom::Element*, nsRuleWalker*)’:

layout/style/nsStyleSet.cpp:964:66: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

layout/style/nsStyleSet.cpp: In member function ‘void nsStyleSet::WalkRuleProcessors(nsIStyleRuleProcessor::EnumFunc, ElementDependentRuleProcessorData*, bool)’:

layout/style/nsStyleSet.cpp:1113:68: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}
Blocks: buildwarning
OS: Linux → All
Hardware: x86_64 → All
Attached patch fix v1Splinter Review
This makes nsStyleSet.cpp compile w/ no build warnings at all, FWIW. (woot)
Attachment #700520 - Flags: review?(bzbarsky)
Comment on attachment 700520 [details] [diff] [review]
fix v1

r=me
Attachment #700520 - Flags: review?(bzbarsky) → review+
Blocks: 829168
https://hg.mozilla.org/mozilla-central/rev/5b042b636671
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.