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

RESOLVED FIXED in mozilla21

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

(Blocks 1 bug)

Trunk
mozilla21
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

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.
Posted 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: 7 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.