From 7d8c567982a8cef21952ae802339467a7b315474 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Fri, 1 Jun 2012 02:41:14 +0000 Subject: [PATCH] Ignore return value of fwrites. The removed error return was of course failing in the void ProcessBlock. Ignored the returns of the remaining fwrites as well for consistency. TBR=leozwang@webrtc.org BUG=none TEST=run audioproc with debug enabled Review URL: https://webrtc-codereview.appspot.com/623004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2336 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/modules/audio_processing/aec/aec_core.c | 20 ++++--------------- .../audio_processing/aec/echo_cancellation.c | 17 +++++----------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/modules/audio_processing/aec/aec_core.c b/src/modules/audio_processing/aec/aec_core.c index 2defba091..5e1ef003e 100644 --- a/src/modules/audio_processing/aec/aec_core.c +++ b/src/modules/audio_processing/aec/aec_core.c @@ -686,14 +686,8 @@ static void ProcessBlock(aec_t* aec) { int16_t farend[PART_LEN]; int16_t* farend_ptr = NULL; WebRtc_ReadBuffer(aec->far_time_buf, (void**) &farend_ptr, farend, 1); - if (fwrite(farend_ptr, sizeof(int16_t), - PART_LEN, aec->farFile) != PART_LEN) { - return -1; - } - if (fwrite(nearend_ptr, sizeof(int16_t), - PART_LEN, aec->nearFile) != PART_LEN) { - return -1; - } + (void)fwrite(farend_ptr, sizeof(int16_t), PART_LEN, aec->farFile); + (void)fwrite(nearend_ptr, sizeof(int16_t), PART_LEN, aec->nearFile); } #endif @@ -850,14 +844,8 @@ static void ProcessBlock(aec_t* aec) { WEBRTC_SPL_WORD16_MIN); } - if (fwrite(eInt16, sizeof(int16_t), - PART_LEN, aec->outLinearFile) != PART_LEN) { - return -1; - } - if (fwrite(output, sizeof(int16_t), - PART_LEN, aec->outFile) != PART_LEN) { - return -1; - } + (void)fwrite(eInt16, sizeof(int16_t), PART_LEN, aec->outLinearFile); + (void)fwrite(output, sizeof(int16_t), PART_LEN, aec->outFile); } #endif } diff --git a/src/modules/audio_processing/aec/echo_cancellation.c b/src/modules/audio_processing/aec/echo_cancellation.c index 065d2de73..b5728b8d6 100644 --- a/src/modules/audio_processing/aec/echo_cancellation.c +++ b/src/modules/audio_processing/aec/echo_cancellation.c @@ -401,10 +401,7 @@ WebRtc_Word32 WebRtcAec_Process(void *aecInst, const WebRtc_Word16 *nearend, } #ifdef WEBRTC_AEC_DEBUG_DUMP - if (fwrite(&aecpc->skew, sizeof(aecpc->skew), - 1, aecpc->skewFile) != 1) { - return -1; - } + (void)fwrite(&aecpc->skew, sizeof(aecpc->skew), 1, aecpc->skewFile); #endif } } @@ -535,15 +532,11 @@ WebRtc_Word32 WebRtcAec_Process(void *aecInst, const WebRtc_Word16 *nearend, #ifdef WEBRTC_AEC_DEBUG_DUMP { - int16_t far_buf_size_ms = (int16_t) (aecpc->aec->system_delay / + int16_t far_buf_size_ms = (int16_t)(aecpc->aec->system_delay / (sampMsNb * aecpc->aec->mult)); - if (fwrite(&far_buf_size_ms, 2, 1, aecpc->bufFile) != 1) { - return -1; - } - if (fwrite(&(aecpc->knownDelay), sizeof(aecpc->knownDelay), - 1, aecpc->delayFile) != 1) { - return -1; - } + (void)fwrite(&far_buf_size_ms, 2, 1, aecpc->bufFile); + (void)fwrite(&aecpc->knownDelay, sizeof(aecpc->knownDelay), 1, + aecpc->delayFile); } #endif