Avoid implicit type truncations by inserting explicit casts or modifying prototypes to avoid needless up- and then down-casting.

BUG=chromium:82439
TEST=none
R=henrik.lundin@webrtc.org, mflodman@webrtc.org, pthatcher@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40569004

Cr-Commit-Position: refs/heads/master@{#8229}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8229 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pkasting@chromium.org
2015-02-02 23:54:03 +00:00
parent 19f3f71c98
commit 0e81fdf5d2
10 changed files with 62 additions and 117 deletions

View File

@ -55,7 +55,7 @@ void RedPacket::CreateHeader(const uint8_t* rtp_header, size_t header_length,
data_[1] += red_pl_type;
// Add RED header
// f-bit always 0
data_[header_length] = pl_type;
data_[header_length] = static_cast<uint8_t>(pl_type);
header_length_ = header_length + kREDForFECHeaderLength;
}

View File

@ -33,7 +33,7 @@ void VerifyHeader(uint16_t seq_num,
uint32_t parsed_timestamp = (data[4] << 24) + (data[5] << 16) +
(data[6] << 8) + data[7];
EXPECT_EQ(timestamp, parsed_timestamp);
EXPECT_EQ(fec_pltype, data[kRtpHeaderSize]);
EXPECT_EQ(static_cast<uint8_t>(fec_pltype), data[kRtpHeaderSize]);
}
class ProducerFecTest : public ::testing::Test {