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

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

Issue 1305983003: Convert some more things to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Support Android's C89 mode 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
« no previous file with comments | « no previous file | webrtc/common_audio/signal_processing/include/signal_processing_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8d6c879ca77986ffdc30a0a28a7c23f3e6bc4346..fda4fffeed17db613bdbd8ccaaf4329578fbea59 100644
--- a/webrtc/common_audio/signal_processing/auto_correlation.c
+++ b/webrtc/common_audio/signal_processing/auto_correlation.c
@@ -10,20 +10,19 @@
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
-int WebRtcSpl_AutoCorrelation(const int16_t* in_vector,
- size_t in_vector_length,
- size_t order,
- int32_t* result,
- int* scale) {
+#include <assert.h>
+
+size_t WebRtcSpl_AutoCorrelation(const int16_t* in_vector,
+ size_t in_vector_length,
+ size_t order,
+ int32_t* result,
+ int* scale) {
int32_t sum = 0;
size_t i = 0, j = 0;
int16_t smax = 0;
int scaling = 0;
- if (order > in_vector_length) {
- /* Undefined */
- return -1;
- }
+ assert(order <= in_vector_length);
// Find the maximum absolute value of the samples.
smax = WebRtcSpl_MaxAbsValueW16(in_vector, in_vector_length);
@@ -62,5 +61,5 @@ int WebRtcSpl_AutoCorrelation(const int16_t* in_vector,
}
*scale = scaling;
- return (int)(order + 1);
+ return order + 1;
}
« no previous file with comments | « no previous file | webrtc/common_audio/signal_processing/include/signal_processing_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698