diff --git a/example/a2dp_source_demo.c b/example/a2dp_source_demo.c index fa5697342..67c1d3cee 100644 --- a/example/a2dp_source_demo.c +++ b/example/a2dp_source_demo.c @@ -92,7 +92,7 @@ static const int16_t sine_int16[] = { -19260, -17557, -15786, -13952, -12062, -10126, -8149, -6140, -4107, -2057, }; -static char * device_name = "A2DP Source BTstack"; +static const char * device_name = "A2DP Source BTstack"; #ifdef HAVE_BTSTACK_STDIN // mac 2011: static const char * device_addr_string = "04:0C:CE:E4:85:D3"; @@ -216,7 +216,7 @@ static void produce_audio(int16_t * pcm_buffer, int num_samples){ static int a2dp_demo_fill_sbc_audio_buffer(a2dp_media_sending_context_t * context){ // perform sbc encodin int total_num_bytes_read = 0; - int num_audio_samples_per_sbc_buffer = btstack_sbc_encoder_num_audio_frames(); + unsigned int num_audio_samples_per_sbc_buffer = btstack_sbc_encoder_num_audio_frames(); while (context->samples_ready >= num_audio_samples_per_sbc_buffer && (context->max_media_payload_size - context->sbc_storage_count) >= btstack_sbc_encoder_sbc_buffer_length()){ diff --git a/example/hfp_ag_demo.c b/example/hfp_ag_demo.c index 44e4127a7..2272751b1 100644 --- a/example/hfp_ag_demo.c +++ b/example/hfp_ag_demo.c @@ -109,7 +109,7 @@ enum STATE {INIT, W4_INQUIRY_MODE_COMPLETE, ACTIVE} ; enum STATE state = INIT; static void dump_supported_codecs(void){ - int i; + unsigned int i; int mSBC_skipped = 0; printf("Supported codecs: "); for (i = 0; i < sizeof(codecs); i++){ diff --git a/example/hfp_hf_demo.c b/example/hfp_hf_demo.c index 9f23d43c7..18eff3d47 100644 --- a/example/hfp_hf_demo.c +++ b/example/hfp_hf_demo.c @@ -90,7 +90,7 @@ static btstack_packet_callback_registration_t hci_event_callback_registration; char cmd; static void dump_supported_codecs(void){ - int i; + unsigned int i; int mSBC_skipped = 0; printf("Supported codecs: "); for (i = 0; i < sizeof(codecs); i++){ diff --git a/example/hsp_ag_demo.c b/example/hsp_ag_demo.c index 0572c629b..a0721ac61 100644 --- a/example/hsp_ag_demo.c +++ b/example/hsp_ag_demo.c @@ -235,8 +235,8 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even break; case HSP_SUBEVENT_HS_COMMAND:{ memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int cmd_length = hsp_subevent_hs_command_get_value_length(event); - int size = cmd_length <= sizeof(hs_cmd_buffer)? cmd_length : sizeof(hs_cmd_buffer); + unsigned int cmd_length = hsp_subevent_hs_command_get_value_length(event); + unsigned int size = cmd_length <= sizeof(hs_cmd_buffer)? cmd_length : sizeof(hs_cmd_buffer); memcpy(hs_cmd_buffer, hsp_subevent_hs_command_get_value(event), size - 1); printf("Received custom command: \"%s\". \nExit code or call hsp_ag_send_result.\n", hs_cmd_buffer); break; diff --git a/example/hsp_hs_demo.c b/example/hsp_hs_demo.c index 6603c7284..60c45b929 100644 --- a/example/hsp_hs_demo.c +++ b/example/hsp_hs_demo.c @@ -236,7 +236,7 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even break; case HSP_SUBEVENT_AG_INDICATION: { memset(hs_cmd_buffer, 0, sizeof(hs_cmd_buffer)); - int size = hsp_subevent_ag_indication_get_value_length(event); + unsigned int size = hsp_subevent_ag_indication_get_value_length(event); if (size >= sizeof(hs_cmd_buffer)-1){ size = sizeof(hs_cmd_buffer)-1; } diff --git a/example/sco_demo_util.c b/example/sco_demo_util.c index 79b2d424c..fe83e71f4 100644 --- a/example/sco_demo_util.c +++ b/example/sco_demo_util.c @@ -142,7 +142,7 @@ FILE * msbc_file_out; int num_samples_to_write; int num_audio_frames; -int phase; +unsigned int phase; #if SCO_DEMO_MODE == SCO_DEMO_MODE_SINE @@ -161,8 +161,8 @@ static const int16_t sine_int16_at_16000hz[] = { }; // 8 kHz samples for CVSD/SCO packets in little endian -static void sco_demo_sine_wave_int16_at_8000_hz_little_endian(int num_samples, int16_t * data){ - int i; +static void sco_demo_sine_wave_int16_at_8000_hz_little_endian(unsigned int num_samples, int16_t * data){ + unsigned int i; for (i=0; i < num_samples; i++){ int16_t sample = sine_int16_at_16000hz[phase]; little_endian_store_16((uint8_t *) data, i * 2, sample); @@ -176,8 +176,8 @@ static void sco_demo_sine_wave_int16_at_8000_hz_little_endian(int num_samples, i // 16 kHz samples for mSBC encoder in host endianess #ifdef ENABLE_HFP_WIDE_BAND_SPEECH -static void sco_demo_sine_wave_int16_at_16000_hz_host_endian(int num_samples, int16_t * data){ - int i; +static void sco_demo_sine_wave_int16_at_16000_hz_host_endian(unsigned int num_samples, int16_t * data){ + unsigned int i; for (i=0; i < num_samples; i++){ data[i] = sine_int16_at_16000hz[phase++]; if (phase >= (sizeof(sine_int16_at_16000hz) / sizeof(int16_t))){ diff --git a/port/libusb/Makefile b/port/libusb/Makefile index 69a80b14d..4b24d568d 100644 --- a/port/libusb/Makefile +++ b/port/libusb/Makefile @@ -8,7 +8,7 @@ COMMON += hci_transport_h2_libusb.c btstack_run_loop_posix.c le_device_db_fs.c include ${BTSTACK_ROOT}/example/Makefile.inc # CC = gcc-fsf-4.9 -CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Werror -Wunused-parameter +CFLAGS += -g -Wall -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Werror -Wunused-parameter -Wredundant-decls -Wsign-compare # CFLAGS += -Werror CFLAGS += -I${BTSTACK_ROOT}/platform/posix \ diff --git a/src/classic/avdtp_util.h b/src/classic/avdtp_util.h index 5dcf3984d..f3ac561d5 100644 --- a/src/classic/avdtp_util.h +++ b/src/classic/avdtp_util.h @@ -66,7 +66,6 @@ static inline uint8_t avdtp_header(uint8_t tr_label, avdtp_packet_type_t packet_ return (tr_label<<4) | ((uint8_t)packet_type<<2) | (uint8_t)msg_type; } -uint8_t avdtp_header(uint8_t tr_label, avdtp_packet_type_t packet_type, avdtp_message_type_t msg_type); int avdtp_read_signaling_header(avdtp_signaling_packet_t * signaling_header, uint8_t * packet, uint16_t size); uint8_t store_bit16(uint16_t bitmap, int position, uint8_t value); diff --git a/src/classic/avrcp_controller.c b/src/classic/avrcp_controller.c index dec438493..c808e148b 100644 --- a/src/classic/avrcp_controller.c +++ b/src/classic/avrcp_controller.c @@ -490,7 +490,7 @@ static void avrcp_handle_l2cap_data_packet_for_signaling_connection(avrcp_connec case AVRCP_PDU_ID_GET_ELEMENT_ATTRIBUTES:{ uint8_t num_attributes = packet[pos++]; - int i; + unsigned int i; struct item { uint16_t len; uint8_t * value; diff --git a/src/classic/btstack_sbc_bludroid.c b/src/classic/btstack_sbc_bludroid.c index 46d6971f5..6b7aa6c24 100644 --- a/src/classic/btstack_sbc_bludroid.c +++ b/src/classic/btstack_sbc_bludroid.c @@ -127,7 +127,7 @@ void btstack_sbc_decoder_test_simulate_corrupt_frames(int period){ static int find_sequence_of_zeros(const OI_BYTE *frame_data, OI_UINT32 frame_bytes, int seq_length){ int zero_seq_count = 0; - int i; + unsigned int i; for (i=0; idecoder_state; int input_bytes_to_process = size; - int msbc_frame_size = 57; + unsigned int msbc_frame_size = 57; // printf("<<-- enter -->>\n"); // printf("Process data: in buffer %u, new %u\n", decoder_state->bytes_in_frame_buffer, size);