mediaconduit_unittests.cpp:280:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

RESOLVED FIXED in mozilla26

Status

()

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks: 1 bug)

Trunk
mozilla26
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Build warning:
{
media/webrtc/signaling/test/mediaconduit_unittests.cpp:280:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}

...for this line:
> 280    MOZ_ASSERT(SAMPLES <= PLAYOUT_SAMPLE_LENGTH);
http://mxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/test/mediaconduit_unittests.cpp?rev=4fdd3cddee3a&mark=280-280#273

...since SAMPLES is an int, whereas PLAYOUT_SAMPLE_LENGTH is an unsigned int.

We can fix this by just changing SAMPLES to be unsigned too; it's set as (PLAYOUT_SAMPLE_FREQUENCY * 10), where PLAYOUT_SAMPLE_FREQUENCY is unsigned, and we only compare it to a signed integer in one spot.  (That one spot is a comparison tonumSamplesReadFromInput, which can be made unsigned as well, since it starts at 0 and only increases from there.)  So, there's no reason for SAMPLES to be signed.

Patch coming up to make both numSamplesReadFromInput and SAMPLES unsigned.
(Assignee)

Comment 1

5 years ago
Created attachment 803234 [details] [diff] [review]
fix
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #803234 - Flags: review?(rjesup)

Updated

5 years ago
Attachment #803234 - Flags: review?(rjesup) → review+

Comment 3

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