nsSimplePageSequence.cpp:673:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

RESOLVED FIXED in mozilla19

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

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

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Filing bug for new-ish build warning (using GCC 4.7):
{
/mozilla/layout/generic/nsSimplePageSequence.cpp: In member function ‘virtual nsresult nsSimplePageSequenceFrame::PrePrintNextPage(nsITimerCallback*, bool*)’:

/mozilla/layout/generic/nsSimplePageSequence.cpp:673:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}

...for this code:
> 664   int32_t doneCounter = 0;
[...]
> 669       doneCounter++;
[...]
> 672   // If all canvas have finished rendering, return true, otherwise false.
> 673   *aDone = doneCounter == mCurrentCanvasList.Length();
https://mxr.mozilla.org/mozilla-central/source/layout/generic/nsSimplePageSequence.cpp?mark=664-664,673-673#664

https://mxr.mozilla.org/mozilla-central/source/layout/generic/nsSimplePageSequence.cpp?mark=664-664,669-669,673-673#664

Looks like doneCounter should just be unsigned -- it starts at 0 and only increases from there, so there's no reason to make it a signed value.
(Assignee)

Comment 1

6 years ago
Created attachment 670526 [details] [diff] [review]
fix
Attachment #670526 - Flags: review?(bdahl)

Updated

6 years ago
Attachment #670526 - Flags: review?(bdahl) → review+

Comment 3

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