Closed Bug 931669 Opened 6 years ago Closed 6 years ago

Fix -Wsign-compare warning in Axis.cpp

Categories

(Core :: Panning and Zooming, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28
Tracking Status
firefox27 --- wontfix
firefox28 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Attached patch patchSplinter Review
gfx/layers/ipc/Axis.cpp:129:31 [-Wsign-compare] comparison of integers of different signs: 'size_type' (aka 'unsigned int') and 'int'

This warning is caused by the following line of code, where mVelocityQueue.Length() is uint32_t and gMaxVelocityQueueSize is int:

https://hg.mozilla.org/mozilla-central/annotate/5e49bfec9ecb/gfx/layers/ipc/Axis.cpp#l129

If a users enters a negative (invalid) value for the "apz.max_velocity_queue_size" pref, the velocity queue length will be effectively unbounded (because the negative pref will now be treated as a large unsigned gMaxVelocityQueueSize).
Attachment #823133 - Flags: review?(botond)
Attachment #823133 - Flags: review?(botond) → review+
https://hg.mozilla.org/mozilla-central/rev/4d1dde8f2d2e
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.