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

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: 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..fc1235bfbe52a472b73a869576c237f5658355ab 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 = (6 - (c_name.size() % 4)) % 4;
ddorwin 2014/07/08 18:17:50 "case 2" was 4 and is now 0.
Peter Kasting 2014/07/08 18:39:14 Good catch. Fixed. Although I'm not sure it actu
for (int j = 0; j < padding; ++j) {
big_endian_writer_.WriteU8(0);
}

Powered by Google App Engine
This is Rietveld 408576698