Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: media/cast/rtcp/test_rtcp_packet_builder.cc

Issue 377803004: Fixes for re-enabling more MSVC level 4 warnings: media/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/rtcp/test_rtcp_packet_builder.cc
diff --git a/media/cast/rtcp/test_rtcp_packet_builder.cc b/media/cast/rtcp/test_rtcp_packet_builder.cc
index 5bfebf6cb9da254128700c4469dba7036569e1e5..76fa7642b81271d6bbf1a9124a68d0c3479c4ec8 100644
--- a/media/cast/rtcp/test_rtcp_packet_builder.cc
+++ b/media/cast/rtcp/test_rtcp_packet_builder.cc
@@ -65,21 +65,7 @@ void TestRtcpPacketBuilder::AddSdesCname(uint32 sender_ssrc,
for (size_t i = 0; i < c_name.size(); ++i) {
big_endian_writer_.WriteU8(c_name.c_str()[i]);
}
- int padding;
- switch (c_name.size() % 4) {
- case 0:
- padding = 2;
- break;
- case 1:
- padding = 1;
- break;
- case 2:
- padding = 4;
- break;
- case 3:
- padding = 3;
- break;
- }
+ const int padding = 4 - ((c_name.size() + 2) % 4);
for (int j = 0; j < padding; ++j) {
big_endian_writer_.WriteU8(0);
}
« no previous file with comments | « media/base/audio_video_metadata_extractor.cc ('k') | media/cast/rtp_receiver/rtp_parser/rtp_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698