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

Unified Diff: webrtc/common_audio/signal_processing/auto_correlation.c

Issue 1228823002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix bad merge Created 5 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: webrtc/common_audio/signal_processing/auto_correlation.c
diff --git a/webrtc/common_audio/signal_processing/auto_correlation.c b/webrtc/common_audio/signal_processing/auto_correlation.c
index 405a08ecaff527f329e66abd49fbf2155d636e7c..8d6c879ca77986ffdc30a0a28a7c23f3e6bc4346 100644
--- a/webrtc/common_audio/signal_processing/auto_correlation.c
+++ b/webrtc/common_audio/signal_processing/auto_correlation.c
@@ -11,20 +11,18 @@
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
int WebRtcSpl_AutoCorrelation(const int16_t* in_vector,
- int in_vector_length,
- int order,
+ size_t in_vector_length,
+ size_t order,
int32_t* result,
int* scale) {
int32_t sum = 0;
- int i = 0, j = 0;
+ size_t i = 0, j = 0;
int16_t smax = 0;
int scaling = 0;
if (order > in_vector_length) {
Andrew MacDonald 2015/07/22 19:54:58 assert this instead and return a size_t?
/* Undefined */
return -1;
- } else if (order < 0) {
- order = in_vector_length;
}
// Find the maximum absolute value of the samples.
@@ -64,5 +62,5 @@ int WebRtcSpl_AutoCorrelation(const int16_t* in_vector,
}
*scale = scaling;
- return order + 1;
+ return (int)(order + 1);
}

Powered by Google App Engine
This is Rietveld 408576698