Chromium Code Reviews| Index: webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
| diff --git a/webrtc/modules/audio_processing/agc/legacy/analog_agc.c b/webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
| index bb56cfe95de89494febf44fb3bda412a27f44dbb..7432ea79cd601772bbfb64420a4157e4250784ce 100644 |
| --- a/webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
| +++ b/webrtc/modules/audio_processing/agc/legacy/analog_agc.c |
| @@ -1313,31 +1313,19 @@ int WebRtcAgc_get_config(void* agcInst, WebRtcAgcConfig* config) { |
| return 0; |
| } |
| -int WebRtcAgc_Create(void **agcInst) |
| -{ |
| - LegacyAgc* stt; |
| - if (agcInst == NULL) |
| - { |
| - return -1; |
| - } |
| - stt = (LegacyAgc*)malloc(sizeof(LegacyAgc)); |
| - |
| - *agcInst = stt; |
| - if (stt == NULL) |
| - { |
| - return -1; |
| - } |
| +void* WebRtcAgc_Create() { |
| + LegacyAgc* stt = (LegacyAgc*)malloc(sizeof(LegacyAgc)); |
|
bjornv1
2015/06/10 09:14:06
Is it really necessary to cast here?
kwiberg-webrtc
2015/06/10 09:31:43
No. Unlike C++, C will implicitly cast void* to an
|
| #ifdef WEBRTC_AGC_DEBUG_DUMP |
| - stt->fpt = fopen("./agc_test_log.txt", "wt"); |
| - stt->agcLog = fopen("./agc_debug_log.txt", "wt"); |
| - stt->digitalAgc.logFile = fopen("./agc_log.txt", "wt"); |
| + stt->fpt = fopen("./agc_test_log.txt", "wt"); |
| + stt->agcLog = fopen("./agc_debug_log.txt", "wt"); |
| + stt->digitalAgc.logFile = fopen("./agc_log.txt", "wt"); |
| #endif |
| - stt->initFlag = 0; |
| - stt->lastError = 0; |
| + stt->initFlag = 0; |
| + stt->lastError = 0; |
| - return 0; |
| + return stt; |
| } |
| void WebRtcAgc_Free(void *state) { |