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

Unified Diff: webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c

Issue 1225173002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments Created 5 years, 4 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: webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
diff --git a/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c b/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
index b6de0b5e67b2acca0fa8e8bbd5d4a3ed7a52d36e..120c79052bd9bfdae1e739d436f98b0cfc559b28 100644
--- a/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
+++ b/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.c
@@ -12,10 +12,10 @@
#include "webrtc/typedefs.h"
-int16_t WebRtcPcm16b_Encode(const int16_t* speech,
- int16_t len,
- uint8_t* encoded) {
- int i;
+size_t WebRtcPcm16b_Encode(const int16_t* speech,
+ size_t len,
+ uint8_t* encoded) {
+ size_t i;
for (i = 0; i < len; ++i) {
uint16_t s = speech[i];
encoded[2 * i] = s >> 8;
@@ -24,10 +24,10 @@ int16_t WebRtcPcm16b_Encode(const int16_t* speech,
return 2 * len;
}
-int16_t WebRtcPcm16b_Decode(const uint8_t* encoded,
- int16_t len,
- int16_t* speech) {
- int i;
+size_t WebRtcPcm16b_Decode(const uint8_t* encoded,
+ size_t len,
+ int16_t* speech) {
+ size_t i;
for (i = 0; i < len / 2; ++i)
speech[i] = encoded[2 * i] << 8 | encoded[2 * i + 1];
return len / 2;

Powered by Google App Engine
This is Rietveld 408576698