From c03cf9db38e4cb783f0692f411e3e57effbe236f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 18 Feb 2016 11:31:33 +0100 Subject: [PATCH] c++ warning fixes --- src/sdp_parser.c | 2 +- test/gatt_client/Makefile | 2 +- test/hfp/Makefile | 2 +- test/hfp/hfp_ag_parser_test.c | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sdp_parser.c b/src/sdp_parser.c index a935e9171..8e339005c 100644 --- a/src/sdp_parser.c +++ b/src/sdp_parser.c @@ -263,7 +263,7 @@ void sdp_parser_handle_service_search(uint8_t * data, uint16_t total_count, uint sdp_query_service_record_handle_event_t service_record_handle_event = { SDP_QUERY_SERVICE_RECORD_HANDLE, total_count, - record_counter, + (uint16_t) record_counter, record_handle }; (*sdp_query_callback)((sdp_query_event_t*)&service_record_handle_event); diff --git a/test/gatt_client/Makefile b/test/gatt_client/Makefile index 3d6a5ade5..8624fa264 100644 --- a/test/gatt_client/Makefile +++ b/test/gatt_client/Makefile @@ -4,7 +4,7 @@ CC = g++ BTSTACK_ROOT = ../.. -CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include +CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -Wconversion-null -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/ble diff --git a/test/hfp/Makefile b/test/hfp/Makefile index aef870808..3dc005ff3 100644 --- a/test/hfp/Makefile +++ b/test/hfp/Makefile @@ -45,7 +45,7 @@ COMMON_OBJ = $(COMMON:.c=.o) MOCK_OBJ = $(MOCK:.c=.o) # CC = gcc-fsf-4.9 -CFLAGS = -g -Wall -Wmissing-prototype -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include +CFLAGS = -g -Wall -Wmissing-prototype -Wnarrowing -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include CFLAGS += -Werror VPATH += ${BTSTACK_ROOT}/src diff --git a/test/hfp/hfp_ag_parser_test.c b/test/hfp/hfp_ag_parser_test.c index 8cda02acc..5b71fdb37 100644 --- a/test/hfp/hfp_ag_parser_test.c +++ b/test/hfp/hfp_ag_parser_test.c @@ -78,8 +78,7 @@ static hfp_connection_t context; TEST_GROUP(HFPParser){ char packet[200]; - int pos; - int offset; + uint16_t pos; void setup(void){ context.parser_state = HFP_PARSER_CMD_HEADER;