QuartzSupport.mm:943:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]

RESOLVED FIXED in mozilla23

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks 1 bug)

Trunk
mozilla23
All
macOS
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

()

Attachments

(1 attachment)

filing this bug for these two warnings in QuartzSupport.mm:
{
../../../gfx/2d/QuartzSupport.mm:943:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
  if (aX < 0 || aX >= ioWidth ||
                ~~ ^  ~~~~~~~
../../../gfx/2d/QuartzSupport.mm:944:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
      aY < 0 || aY >= ioHeight) {
                ~~ ^  ~~~~~~~~
}

We can just static_cast aX and aY for the purpose of the comparison with ioWidth & ioHeight, since we'll never hit that comparison with negative aX or aY. (due to the < 0 checks)
Assignee: nobody → dholbert
Posted patch trivial fixSplinter Review
Attachment #733601 - Flags: review?
Attachment #733601 - Flags: review? → review?(smichaud)
Comment on attachment 733601 [details] [diff] [review]
trivial fix

Looks fine to me.
Attachment #733601 - Flags: review?(smichaud) → review+
Thanks for the quick turnaround!

Try run (just mac builds), to be sure I didn't make a typo, since I'm not on a mac & can't test at the moment:
 https://tbpl.mozilla.org/?tree=Try&rev=3a7169f09bcd
(c2f49a0c6110 is this bug's patch, in the pushed-to-try commits)
https://hg.mozilla.org/integration/mozilla-inbound/rev/2edc2af0ec32
Flags: in-testsuite-
OS: Linux → Mac OS X
Hardware: x86_64 → All
https://hg.mozilla.org/mozilla-central/rev/2edc2af0ec32
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.