From 966a8e4699151b2a207435961488dd9af50a32fe Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 17 Jan 2017 20:01:28 +0100 Subject: [PATCH] add -Wunused-parameter warning and fix warnings --- test/avdtp/Makefile | 2 +- test/avdtp/avdtp_test.c | 1 + test/avdtp/avdtp_util.c | 2 ++ test/avdtp/portaudio_test.c | 7 ++++++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/avdtp/Makefile b/test/avdtp/Makefile index 07a0117e2..da9524f84 100644 --- a/test/avdtp/Makefile +++ b/test/avdtp/Makefile @@ -28,7 +28,7 @@ COMMON += \ sdp_util.c \ sdp_server.c \ -CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Werror +CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-variable -Wunused-parameter -Werror CFLAGS += -I. CFLAGS += -I${BTSTACK_ROOT}/src CFLAGS += -I${BTSTACK_ROOT}/src/classic diff --git a/test/avdtp/avdtp_test.c b/test/avdtp/avdtp_test.c index 625b721e3..b3a60b6b7 100644 --- a/test/avdtp/avdtp_test.c +++ b/test/avdtp/avdtp_test.c @@ -181,6 +181,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer, (void) timeInfo; /* Prevent unused variable warnings. */ (void) statusFlags; (void) inputBuffer; + (void) userData; int bytes_to_copy = framesPerBuffer * BYTES_PER_FRAME; diff --git a/test/avdtp/avdtp_util.c b/test/avdtp/avdtp_util.c index 1ba7c4f68..e73d36c1a 100644 --- a/test/avdtp/avdtp_util.c +++ b/test/avdtp/avdtp_util.c @@ -98,6 +98,8 @@ int avdtp_read_signaling_header(avdtp_signaling_packet_t * signaling_header, uin } int avdtp_pack_service_capabilities(uint8_t * buffer, int size, avdtp_capabilities_t caps, avdtp_service_category_t category, uint8_t pack_all_capabilities){ + UNUSED(size); + int i; // pos = 0 reserved for length int pos = 1; diff --git a/test/avdtp/portaudio_test.c b/test/avdtp/portaudio_test.c index 34ca6369c..0c47189b4 100644 --- a/test/avdtp/portaudio_test.c +++ b/test/avdtp/portaudio_test.c @@ -70,6 +70,7 @@ static int total_num_samples = 0; static char * wav_filename = "portaudio_sine.wav"; static void write_wav_data(int16_t * data, int num_frames, int num_channels, int sample_rate){ + (void)sample_rate; wav_writer_write_int16(num_frames*num_channels, data); total_num_samples+=num_frames*num_channels; if (total_num_samples>5*SAMPLE_RATE) wav_writer_close(); @@ -105,7 +106,8 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer, (void) timeInfo; /* Prevent unused variable warnings. */ (void) statusFlags; (void) inputBuffer; - + (void) userData; + uint32_t bytes_read = 0; int bytes_per_buffer = framesPerBuffer * BYTES_PER_FRAME; @@ -120,6 +122,9 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer, int main(int argc, const char * argv[]){ + (void) argc; + (void) argv; + PaError err; static paTestData data; static PaStream * stream;