Cast away the unused state argument value to silence gcc 4.6 warnings.
The WebRTC C wrapper for the G711 codec doesn't actually use the 'state' argument, but declares one anyway for API uniformity. At the beginning of functions like WebRTCG711_EncodeA(), there's a stanza: // Set to avoid getting warnings state = NULL; This might work around an unused parameter warning, but under gcc 4.6.0 it ends up generating another warning, that state is set but not used. Casting the assignment to void silences the warning, restoring compilation under -Werror. Reported as https://code.google.com/p/webrtc/issues/detail?id=50 Review URL: http://webrtc-codereview.appspot.com/135002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@463 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -20,8 +20,8 @@ WebRtc_Word16 WebRtcG711_EncodeA(void *state,
|
||||
int n;
|
||||
WebRtc_UWord16 tempVal, tempVal2;
|
||||
|
||||
// Set to avoid getting warnings
|
||||
state = NULL;
|
||||
// Set and discard to avoid getting warnings
|
||||
(void)(state = NULL);
|
||||
|
||||
// Sanity check of input length
|
||||
if (len < 0) {
|
||||
@ -59,8 +59,8 @@ WebRtc_Word16 WebRtcG711_EncodeU(void *state,
|
||||
int n;
|
||||
WebRtc_UWord16 tempVal;
|
||||
|
||||
// Set to avoid getting warnings
|
||||
state = NULL;
|
||||
// Set and discard to avoid getting warnings
|
||||
(void)(state = NULL);
|
||||
|
||||
// Sanity check of input length
|
||||
if (len < 0) {
|
||||
@ -97,8 +97,8 @@ WebRtc_Word16 WebRtcG711_DecodeA(void *state,
|
||||
int n;
|
||||
WebRtc_UWord16 tempVal;
|
||||
|
||||
// Set to avoid getting warnings
|
||||
state = NULL;
|
||||
// Set and discard to avoid getting warnings
|
||||
(void)(state = NULL);
|
||||
|
||||
// Sanity check of input length
|
||||
if (len < 0) {
|
||||
@ -135,8 +135,8 @@ WebRtc_Word16 WebRtcG711_DecodeU(void *state,
|
||||
int n;
|
||||
WebRtc_UWord16 tempVal;
|
||||
|
||||
// Set to avoid getting warnings
|
||||
state = NULL;
|
||||
// Set and discard to avoid getting warnings
|
||||
(void)(state = NULL);
|
||||
|
||||
// Sanity check of input length
|
||||
if (len < 0) {
|
||||
|
Reference in New Issue
Block a user