Closed Bug 835692 Opened 9 years ago Closed 9 years ago

media/mtransport/standalone/transportlayerdtls.cpp:409:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Categories

(Core :: WebRTC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Just noticed a few instances of this go by:
{
media/mtransport/standalone/transportlayerdtls.cpp:409:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
}
for this line of code:
>409   if (digest_len > kMaxDigestLength)
https://mxr.mozilla.org/mozilla-central/source/media/mtransport/transportlayerdtls.cpp#409

There, digest_len is a size_t, and kMaxDigestLength is declared as an int:
https://mxr.mozilla.org/mozilla-central/source/media/mtransport/transportlayerdtls.h#62

Luckily, literally every other usage of kMaxDigestLength is just as an array-size:
https://mxr.mozilla.org/mozilla-central/ident?i=kMaxDigestLength

so we can & should just change it to a size_t, and this warning will go away.
Attached patch fixSplinter Review
Attachment #707452 - Flags: review?(ekr)
Depends on: 790517
Comment on attachment 707452 [details] [diff] [review]
fix

Review of attachment 707452 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm
Attachment #707452 - Flags: review?(ekr) → review+
https://hg.mozilla.org/mozilla-central/rev/bf9886e0d356
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.