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

RESOLVED FIXED in mozilla21

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks 1 bug)

Trunk
mozilla21
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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
Posted 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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.