From 71de195ed3c24f2d4c0a75eca03150a955d10ffb Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 13 May 2015 10:30:46 +0200 Subject: [PATCH] fix c99 warnings for missing argument of functions with no arguments, fix more warnings --- ble/ancs_client_lib.c | 4 +- ble/ancs_client_lib.h | 2 +- ble/att.c | 4 +- ble/att_server.c | 2 +- ble/gatt_client.c | 6 +-- ble/l2cap_le.c | 4 +- ble/le_device_db_dummy.c | 2 +- ble/le_device_db_memory.c | 4 +- ble/sm.c | 32 +++++------ ble/sm_minimal.c | 6 +-- example/embedded/ancs_client.c | 2 +- example/embedded/ble_central_test.c | 6 +-- example/embedded/ble_client.c | 2 +- example/embedded/ble_peripheral_test.c | 16 +++--- example/embedded/bnep_test.c | 20 +++---- example/embedded/classic_test.c | 8 +-- example/embedded/gap_inquiry.c | 2 +- example/embedded/gap_inquiry_and_bond.c | 2 +- example/embedded/gatt_browser.c | 2 +- example/embedded/hfp_test.c | 4 +- example/embedded/hsp_ag.c | 14 ++--- example/embedded/hsp_ag_test.c | 4 +- example/embedded/hsp_hs.c | 4 +- example/embedded/hsp_hs_test.c | 4 +- example/embedded/l2cap_test.c | 2 +- example/embedded/le_counter.c | 4 +- example/embedded/panu_demo.c | 2 +- example/embedded/sdp_bnep_query.c | 2 +- example/embedded/sdp_general_query.c | 2 +- example/embedded/sdp_rfcomm_query.c | 2 +- example/embedded/spp_and_le_counter.c | 2 +- example/embedded/spp_counter.c | 4 +- example/embedded/spp_flowcontrol.c | 4 +- example/embedded/spp_streamer.c | 2 +- platforms/arduino/BTstack.cpp | 54 +++++++++---------- platforms/arduino/bsp_arduino_em9301.cpp | 10 ++-- platforms/arduino/examples/ANCS.ino/ANCS.ino | 4 +- .../arduino/examples/LECentral/LECentral.ino | 4 +- .../examples/LEPeripheral/LEPeripheral.ino | 4 +- .../iBeaconScanner/iBeaconScanner.ino | 4 +- platforms/daemon/src/btstack.c | 4 +- platforms/daemon/src/daemon.c | 2 +- platforms/daemon/src/socket_connection.c | 6 +-- platforms/ez430-rf2560/example/spp_accel.c | 4 +- platforms/ez430-rf2560/firmware/hal_usb.c | 2 +- platforms/ez430-rf2560/src/hal_cpu.c | 6 +-- .../ios/SpringBoardAccess/SpringBoardAccess.c | 6 +-- platforms/ios/SpringBoardAccess/Tweak.xm | 2 +- platforms/ios/src/bt_control_iphone.m | 8 +-- platforms/ios/src/hci_transport_h4_iphone.c | 4 +- platforms/ios/src/platform_iphone.m | 4 +- platforms/libusb/main.c | 2 +- .../example/spp_accel.c | 4 +- .../firmware/hal_usb.c | 2 +- .../msp-exp430f5438-cc2564b/src/hal_cpu.c | 6 +-- platforms/msp-exp430f5438-cc2564b/src/main.c | 4 +- .../msp430f5229lp-cc2564b/firmware/hal_usb.c | 2 +- platforms/msp430f5229lp-cc2564b/src/hal_cpu.c | 6 +-- platforms/msp430f5229lp-cc2564b/src/main.c | 4 +- platforms/mtk/hci_transport_h4_mtk.c | 2 +- platforms/pic32-harmony/src/app_debug.c | 2 +- platforms/pic32-harmony/src/btstack_port.c | 8 +-- platforms/posix-cc2564b/main.c | 4 +- platforms/posix-stlc2500d/main.c | 2 +- platforms/posix-wl183x/main.c | 4 +- platforms/posix/src/hci_transport_h2_libusb.c | 2 +- platforms/posix/src/hci_transport_h5.c | 4 +- platforms/posix/src/remote_device_db_fs.c | 2 +- platforms/stm32-f103rb-nucleo/main.c | 10 ++-- src/hci.c | 34 ++++++------ src/hci.h | 2 +- src/hci_dump.c | 2 +- src/hci_transport_h4_dma.c | 10 ++-- src/hci_transport_h4_ehcill_dma.c | 16 +++--- src/l2cap.c | 6 +-- src/run_loop.c | 4 +- src/sdp.c | 2 +- src/sdp_query_rfcomm.c | 6 +-- test/ble_client/advertising_data_parser.c | 4 +- test/des_iterator/des_iterator_test.c | 2 +- test/gatt_client/gatt_client.c | 16 +++--- test/gatt_client/le_central.c | 8 +-- test/gatt_client/mock.c | 12 ++--- test/linked_list/linked_list_test.c | 2 +- .../remote_device_db_fs_test.c | 4 +- .../remote_device_db_memory_test.c | 4 +- test/sdp_client/general_sdp_query.c | 2 +- test/sdp_client/sdp_rfcomm_query.c | 2 +- .../service_attribute_search_query.c | 2 +- test/sdp_client/service_search_query.c | 2 +- test/security_manager/aestest.c | 2 +- test/security_manager/mock.c | 8 +-- test/security_manager/rijndael.c | 4 +- test/security_manager/security_manager.c | 2 +- 94 files changed, 269 insertions(+), 269 deletions(-) diff --git a/ble/ancs_client_lib.c b/ble/ancs_client_lib.c index 397fada72..63748a69c 100644 --- a/ble/ancs_client_lib.c +++ b/ble/ancs_client_lib.c @@ -117,7 +117,7 @@ static void notify_client(int event_type){ (*client_handler)(&event); } -static void ancs_chunk_parser_init(){ +static void ancs_chunk_parser_init(void){ chunk_parser_state = W4_ATTRIBUTE_ID; ancs_bytes_received = 0; ancs_bytes_needed = 6; @@ -315,6 +315,6 @@ void ancs_client_hci_event_handler (uint8_t packet_type, uint16_t channel, uint8 } } -void ancs_client_init(){ +void ancs_client_init(void){ gc_id = gatt_client_register_packet_handler(&handle_gatt_client_event); } diff --git a/ble/ancs_client_lib.h b/ble/ancs_client_lib.h index c773842a1..07e959b34 100644 --- a/ble/ancs_client_lib.h +++ b/ble/ancs_client_lib.h @@ -51,7 +51,7 @@ typedef struct ancs_event{ const char * text; } ancs_event_t; -void ancs_client_init(); +void ancs_client_init(void); void ancs_client_hci_event_handler (uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); void ancs_client_register_callback(void (*handler)(ancs_event_t * event)); const char * ancs_client_attribute_name_for_id(int id); diff --git a/ble/att.c b/ble/att.c index 0f09962dd..93433fd60 100644 --- a/ble/att.c +++ b/ble/att.c @@ -217,7 +217,7 @@ void att_dump_attributes(void){ } } -static void att_prepare_write_reset(){ +static void att_prepare_write_reset(void){ att_prepare_write_error_code = 0; att_prepare_write_error_handle = 0x0000; } @@ -1071,7 +1071,7 @@ uint16_t att_handle_request(att_connection_t * att_connection, // test profile #include "profile.h" -int main(){ +int main(void){ int acl_buffer_size; uint8_t acl_buffer[27]; att_set_db(profile_data); diff --git a/ble/att_server.c b/ble/att_server.c index d730bf78c..b8d972c1f 100644 --- a/ble/att_server.c +++ b/ble/att_server.c @@ -357,7 +357,7 @@ void att_server_register_packet_handler(btstack_packet_handler_t handler){ att_client_packet_handler = handler; } -int att_server_can_send(){ +int att_server_can_send(void){ if (att_connection.con_handle == 0) return 0; return l2cap_can_send_fixed_channel_packet_now(att_connection.con_handle); } diff --git a/ble/gatt_client.c b/ble/gatt_client.c index b22ef22f0..3541325b7 100644 --- a/ble/gatt_client.c +++ b/ble/gatt_client.c @@ -79,7 +79,7 @@ static uint16_t peripheral_mtu(gatt_client_t *peripheral){ return peripheral->mtu; } -static uint16_t gatt_client_next_id(){ +static uint16_t gatt_client_next_id(void){ if (gatt_client_id < 0xFFFF) { gatt_client_id++; } else { @@ -123,7 +123,7 @@ void gatt_client_unregister_packet_handler(uint16_t gatt_client_id){ } } -void gatt_client_init(){ +void gatt_client_init(void){ att_client_start_handle = 0x0000; gatt_client_connections = NULL; att_dispatch_register_client(gatt_client_att_packet_handler); @@ -702,7 +702,7 @@ static int is_value_valid(gatt_client_t *peripheral, uint8_t *packet, uint16_t s } -static void gatt_client_run(){ +static void gatt_client_run(void){ linked_item_t *it; for (it = (linked_item_t *) gatt_client_connections; it ; it = it->next){ diff --git a/ble/l2cap_le.c b/ble/l2cap_le.c index 4e44e1e3f..b047e6232 100644 --- a/ble/l2cap_le.c +++ b/ble/l2cap_le.c @@ -60,7 +60,7 @@ static void (*packet_handler) (void * connection, uint8_t packet_type, uint16_t static btstack_packet_handler_t attribute_protocol_packet_handler; static btstack_packet_handler_t security_protocol_packet_handler; -void l2cap_init(){ +void l2cap_init(void){ packet_handler = NULL; attribute_protocol_packet_handler = NULL; @@ -77,7 +77,7 @@ uint16_t l2cap_max_mtu(void){ return HCI_ACL_PAYLOAD_SIZE - L2CAP_HEADER_SIZE; } -uint16_t l2cap_max_le_mtu(){ +uint16_t l2cap_max_le_mtu(void){ return l2cap_max_mtu(); } diff --git a/ble/le_device_db_dummy.c b/ble/le_device_db_dummy.c index 469de55ee..629dfeaae 100644 --- a/ble/le_device_db_dummy.c +++ b/ble/le_device_db_dummy.c @@ -37,7 +37,7 @@ #include "le_device_db.h" // Central Device db interface -void le_device_db_init(){} +void le_device_db_init(void){} // @returns index if successful, -1 otherwise int le_device_db_add(int addr_type, bd_addr_t addr, sm_key_t irk){ diff --git a/ble/le_device_db_memory.c b/ble/le_device_db_memory.c index 976f9001e..7ba54b329 100644 --- a/ble/le_device_db_memory.c +++ b/ble/le_device_db_memory.c @@ -69,7 +69,7 @@ typedef struct le_device_memory_db { static le_device_memory_db_t le_devices[LE_DEVICE_MEMORY_SIZE]; -void le_device_db_init(){ +void le_device_db_init(void){ int i; for (i=0;ism_tk[i] = 0; @@ -311,7 +311,7 @@ static void sm_timeout_start(sm_connection_t * sm_conn){ linked_item_set_user((linked_item_t*) &setup->sm_timeout, sm_conn); run_loop_add_timer(&setup->sm_timeout); } -static void sm_timeout_stop(){ +static void sm_timeout_stop(void){ run_loop_remove_timer(&setup->sm_timeout); } static void sm_timeout_reset(sm_connection_t * sm_conn){ @@ -326,7 +326,7 @@ static gap_random_address_type_t gap_random_adress_type; static timer_source_t gap_random_address_update_timer; static uint32_t gap_random_adress_update_period; -static void gap_random_address_trigger(){ +static void gap_random_address_trigger(void){ if (rau_state != RAU_IDLE) return; log_info("gap_random_address_trigger"); rau_state = RAU_GET_RANDOM; @@ -340,13 +340,13 @@ static void gap_random_address_update_handler(timer_source_t * timer){ gap_random_address_trigger(); } -static void gap_random_address_update_start(){ +static void gap_random_address_update_start(void){ run_loop_set_timer_handler(&gap_random_address_update_timer, gap_random_address_update_handler); run_loop_set_timer(&gap_random_address_update_timer, gap_random_adress_update_period); run_loop_add_timer(&gap_random_address_update_timer); } -static void gap_random_address_update_stop(){ +static void gap_random_address_update_stop(void){ run_loop_remove_timer(&gap_random_address_update_timer); } @@ -481,7 +481,7 @@ static void sm_notify_client_authorization(uint8_t type, uint8_t addr_type, bd_a // - pairing request // - io capabilities // - OOB data availability -static void sm_setup_tk(){ +static void sm_setup_tk(void){ // default: just works setup->sm_stk_generation_method = JUST_WORKS; @@ -538,7 +538,7 @@ static void sm_setup_key_distribution(uint8_t key_set){ // CSRK Key Lookup -/* static */ int sm_central_device_lookup_active(){ +/* static */ int sm_central_device_lookup_active(void){ return sm_central_device_test >= 0; } @@ -566,16 +566,16 @@ static void sm_shift_left_by_one_bit_inplace(int len, uint8_t * data){ static inline void sm_next_responding_state(sm_connection_t * sm_conn){ sm_conn->sm_engine_state = (security_manager_state_t) (((int)sm_conn->sm_engine_state) + 1); } -static inline void dkg_next_state(){ +static inline void dkg_next_state(void){ dkg_state = (derived_key_generation_t) (((int)dkg_state) + 1); } -static inline void rau_next_state(){ +static inline void rau_next_state(void){ rau_state = (random_address_update_t) (((int)rau_state) + 1); } -static inline void sm_cmac_next_state(){ +static inline void sm_cmac_next_state(void){ sm_cmac_state = (cmac_state_t) (((int)sm_cmac_state) + 1); } -static int sm_cmac_last_block_complete(){ +static int sm_cmac_last_block_complete(void){ if (sm_cmac_message_len == 0) return 0; return (sm_cmac_message_len & 0x0f) == 0; } @@ -616,11 +616,11 @@ void sm_cmac_start(sm_key_t k, uint16_t message_len, uint8_t * message, uint32_t sm_run(); } -int sm_cmac_ready(){ +int sm_cmac_ready(void){ return sm_cmac_state == CMAC_IDLE; } -static void sm_cmac_handle_aes_engine_ready(){ +static void sm_cmac_handle_aes_engine_ready(void){ switch (sm_cmac_state){ case CMAC_CALC_SUBKEYS: { sm_key_t const_zero; @@ -756,7 +756,7 @@ static void sm_trigger_user_response(sm_connection_t * sm_conn){ } } -static int sm_key_distribution_all_received(){ +static int sm_key_distribution_all_received(void){ int recv_flags = sm_key_distribution_flags_for_set(setup->sm_m_preq.initiator_key_distribution); return recv_flags == setup->sm_key_distribution_received_set; } @@ -1741,7 +1741,7 @@ static inline int sm_calc_actual_encryption_key_size(int other){ /** * @return ok */ -static int sm_validate_stk_generation_method(){ +static int sm_validate_stk_generation_method(void){ // check if STK generation method is acceptable by client switch (setup->sm_stk_generation_method){ case JUST_WORKS: @@ -2024,7 +2024,7 @@ void sm_send_security_request(uint16_t handle){ sm_run(); } -void sm_init(){ +void sm_init(void){ // set some (BTstack default) ER and IR int i; sm_key_t er; diff --git a/ble/sm_minimal.c b/ble/sm_minimal.c index 780d3c2fd..72e3f0b5b 100644 --- a/ble/sm_minimal.c +++ b/ble/sm_minimal.c @@ -96,7 +96,7 @@ void sm_authorization_decline(uint8_t addr_type, bd_addr_t address){} void sm_authorization_grant(uint8_t addr_type, bd_addr_t address){} // Support for signed writes -int sm_cmac_ready(){ +int sm_cmac_ready(void){ return 0; } @@ -116,7 +116,7 @@ void sm_register_packet_handler(btstack_packet_handler_t handler){ sm_client_packet_handler = handler; } -static void sm_pdu_received_in_wrong_state(){ +static void sm_pdu_received_in_wrong_state(void){ sm_pairing_failed_reason = SM_REASON_UNSPECIFIED_REASON; sm_state_responding = SM_GENERAL_SEND_PAIRING_FAILED; } @@ -221,7 +221,7 @@ static void sm_run(void){ } } -void sm_init(){ +void sm_init(void){ // attach to lower layers l2cap_register_fixed_channel(sm_packet_handler, L2CAP_CID_SECURITY_MANAGER_PROTOCOL); l2cap_register_packet_handler(sm_event_packet_handler); diff --git a/example/embedded/ancs_client.c b/example/embedded/ancs_client.c index a5c8cee21..171dd2c8e 100644 --- a/example/embedded/ancs_client.c +++ b/example/embedded/ancs_client.c @@ -93,7 +93,7 @@ uint8_t adv_data_len = sizeof(adv_data); static uint16_t todos = 0; -static void app_run(){ +static void app_run(void){ if (!hci_can_send_command_packet_now()) return; diff --git a/example/embedded/ble_central_test.c b/example/embedded/ble_central_test.c index b3b12fe35..e38c2eafa 100644 --- a/example/embedded/ble_central_test.c +++ b/example/embedded/ble_central_test.c @@ -149,7 +149,7 @@ static void fill_advertising_report_from_packet(advertising_report_t * report, u swapX(found_device_addr, report->address, 6); } -static void gap_run(){ +static void gap_run(void){ if (!hci_can_send_command_packet_now()) return; } @@ -252,7 +252,7 @@ void handle_gatt_client_event(le_event_t * event){ uint16_t value_handle = 1; uint16_t attribute_size = 1; -void show_usage(){ +void show_usage(void){ printf("\e[1;1H\e[2J"); printf("--- CLI for LE Central ---\n"); printf("SM: %s, MITM protection %u, OOB data %u, key range [%u..16]\n", @@ -284,7 +284,7 @@ void show_usage(){ printf("---\n"); } -void update_auth_req(){ +void update_auth_req(void){ uint8_t auth_req = 0; if (sm_mitm_protection){ auth_req |= SM_AUTHREQ_MITM_PROTECTION; diff --git a/example/embedded/ble_client.c b/example/embedded/ble_client.c index e862b584d..56088e219 100644 --- a/example/embedded/ble_client.c +++ b/example/embedded/ble_client.c @@ -74,7 +74,7 @@ typedef struct ad_event { void (*ble_client_packet_handler)(uint8_t packet_type, uint8_t *packet, uint16_t size) = NULL; static void ble_packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size); -void ble_client_init(){ +void ble_client_init(void){ gatt_client_init(); l2cap_register_packet_handler(ble_packet_handler); } diff --git a/example/embedded/ble_peripheral_test.c b/example/embedded/ble_peripheral_test.c index dd14f1147..2c45ac67c 100644 --- a/example/embedded/ble_peripheral_test.c +++ b/example/embedded/ble_peripheral_test.c @@ -220,7 +220,7 @@ static attribute_t att_write_queues[ATT_NUM_WRITE_QUEUES]; #define ATT_NUM_ATTRIBUTES 10 static attribute_t att_attributes[ATT_NUM_ATTRIBUTES]; -static void att_write_queue_init(){ +static void att_write_queue_init(void){ int i; for (i=0;i error 0X%02x", err); diff --git a/platforms/arduino/BTstack.cpp b/platforms/arduino/BTstack.cpp index dc8b891f1..93a625d59 100644 --- a/platforms/arduino/BTstack.cpp +++ b/platforms/arduino/BTstack.cpp @@ -246,7 +246,7 @@ static int nibble_for_char(const char c){ } /// UUID class -UUID::UUID(){ +UUID::UUID(void){ memset(uuid, 0, 16); } @@ -311,7 +311,7 @@ bool UUID::matches(UUID *other) const { // BD_ADDR class -BD_ADDR::BD_ADDR(){ +BD_ADDR::BD_ADDR(void){ } BD_ADDR::BD_ADDR(const char * address_string, BD_ADDR_TYPE address_type ) : address_type(address_type) { @@ -323,15 +323,15 @@ BD_ADDR::BD_ADDR(const uint8_t address[6], BD_ADDR_TYPE address_type) : address_ memcpy(this->address, address, 6); } -const uint8_t * BD_ADDR::getAddress(){ +const uint8_t * BD_ADDR::getAddress(void){ return address; } -const char * BD_ADDR::getAddressString(){ +const char * BD_ADDR::getAddressString(void){ return bd_addr_to_str(address); } -BD_ADDR_TYPE BD_ADDR::getAddressType(){ +BD_ADDR_TYPE BD_ADDR::getAddressType(void){ return address_type; } @@ -347,7 +347,7 @@ data_length(event_packet[11]) memcpy(data, &event_packet[12], LE_ADVERTISING_DATA_SIZE); } -const uint8_t * BLEAdvertisement::getAdvData(){ +const uint8_t * BLEAdvertisement::getAdvData(void){ return data; } @@ -355,7 +355,7 @@ BD_ADDR * BLEAdvertisement::getBdAddr(void){ return &bd_addr; } -int BLEAdvertisement::getRssi(){ +int BLEAdvertisement::getRssi(void){ return rssi > 127 ? rssi - 256 : rssi; } @@ -368,33 +368,33 @@ bool BLEAdvertisement::nameHasPrefix(const char * namePrefix){ return false; }; -bool BLEAdvertisement::isIBeacon(){ +bool BLEAdvertisement::isIBeacon(void){ return ((memcmp(iBeaconAdvertisement01, data, sizeof(iBeaconAdvertisement01)) == 0) && (memcmp(iBeaconAdvertisement38, &data[3], sizeof(iBeaconAdvertisement38)) == 0)); } -const UUID * BLEAdvertisement::getIBeaconUUID(){ +const UUID * BLEAdvertisement::getIBeaconUUID(void){ return new UUID(&data[9]); }; -uint16_t BLEAdvertisement::getIBeaconMajorID(){ +uint16_t BLEAdvertisement::getIBeaconMajorID(void){ return READ_NET_16(data, 25); }; -uint16_t BLEAdvertisement::getIBecaonMinorID(){ +uint16_t BLEAdvertisement::getIBecaonMinorID(void){ return READ_NET_16(data, 27); }; -uint8_t BLEAdvertisement::getiBeaconMeasuredPower(){ +uint8_t BLEAdvertisement::getiBeaconMeasuredPower(void){ return data[29]; } -BLECharacteristic::BLECharacteristic() { +BLECharacteristic::BLECharacteristic(void){ } BLECharacteristic::BLECharacteristic(le_characteristic_t characteristic) : characteristic(characteristic), uuid(characteristic.uuid128) { } -const UUID * BLECharacteristic::getUUID(){ +const UUID * BLECharacteristic::getUUID(void){ return &uuid; } @@ -406,19 +406,19 @@ bool BLECharacteristic::isValueHandle(uint16_t value_handle){ return characteristic.value_handle == value_handle; } -const le_characteristic_t * BLECharacteristic::getCharacteristic() { +const le_characteristic_t * BLECharacteristic::getCharacteristic(void){ return &characteristic; } -BLEService::BLEService(){ +BLEService::BLEService(void){ } BLEService::BLEService(le_service_t service) : service(service), uuid(service.uuid128){ } -const UUID * BLEService::getUUID(){ +const UUID * BLEService::getUUID(void){ return &uuid; } @@ -426,20 +426,20 @@ bool BLEService::matches(UUID * uuid){ return this->uuid.matches(uuid); } -const le_service_t * BLEService::getService(){ +const le_service_t * BLEService::getService(void){ return &service; } // discovery of services and characteristics -BLEDevice::BLEDevice(){ +BLEDevice::BLEDevice(void){ } BLEDevice::BLEDevice(uint16_t handle) : handle(handle){ } -uint16_t BLEDevice::getHandle(){ +uint16_t BLEDevice::getHandle(void){ return handle; } -int BLEDevice::discoverGATTServices(){ +int BLEDevice::discoverGATTServices(void){ return BTstack.discoverGATTServices(this); } int BLEDevice::discoverCharacteristicsForService(BLEService * service){ @@ -468,7 +468,7 @@ int BLEDevice::unsubscribeFromIndications(BLECharacteristic * characteristic){ } -BTstackManager::BTstackManager() { +BTstackManager::BTstackManager(void){ // client_packet_handler = NULL; have_custom_addr = false; // reset handler @@ -580,7 +580,7 @@ void BTstackManager::registerPacketHandler(btstack_packet_handler_t packet_handl // client_packet_handler = packet_handler; } -void BTstackManager::setClientMode(){ +void BTstackManager::setClientMode(void){ client_mode = 1; } @@ -596,7 +596,7 @@ void BTstackManager::setPublicBdAddr(bd_addr_t addr){ // static hci_uart_config_t config; -void BTstackManager::setup(){ +void BTstackManager::setup(void){ #ifdef PIN_LED pinMode(PIN_LED, OUTPUT); @@ -641,18 +641,18 @@ void BTstackManager::setup(){ printf("--> READY <--\n"); } -void BTstackManager::loop(){ +void BTstackManager::loop(void){ // process data from/to Bluetooth module hal_uart_dma_process(); // BTstack Run Loop embedded_execute_once(); } -void BTstackManager::bleStartScanning(){ +void BTstackManager::bleStartScanning(void){ printf("Start scanning\n"); le_central_start_scan(); } -void BTstackManager::bleStopScanning(){ +void BTstackManager::bleStopScanning(void){ le_central_stop_scan(); } diff --git a/platforms/arduino/bsp_arduino_em9301.cpp b/platforms/arduino/bsp_arduino_em9301.cpp index 360d51e1d..9e00987f4 100644 --- a/platforms/arduino/bsp_arduino_em9301.cpp +++ b/platforms/arduino/bsp_arduino_em9301.cpp @@ -89,7 +89,7 @@ static void bt_power_cycle(void){ #endif #ifndef HAVE_SHUTDOWN -static void bt_send_illegal(){ +static void bt_send_illegal(void){ digitalWrite(PIN_MOSI, HIGH); digitalWrite(PIN_CS, LOW); printf("Illegal start\n"); @@ -104,7 +104,7 @@ static void bt_send_illegal(){ digitalWrite(PIN_CS, HIGH); } -static void bt_flush_input(){ +static void bt_flush_input(void){ digitalWrite(PIN_MOSI, LOW); digitalWrite(PIN_CS, LOW); SPI.begin(); @@ -115,7 +115,7 @@ static void bt_flush_input(){ digitalWrite(PIN_CS, HIGH); } -static void bt_send_reset(){ +static void bt_send_reset(void){ digitalWrite(PIN_MOSI, HIGH); digitalWrite(PIN_CS, LOW); SPI.begin(); @@ -242,14 +242,14 @@ extern "C" void hal_uart_dma_set_sleep(uint8_t sleep){ // not needed for SPI (doesn't need internal clock to work) } -extern "C" void hal_uart_dma_process(){ +extern "C" void hal_uart_dma_process(void){ int num_bytes_read = bt_try_read(); if (num_bytes_read == 0){ bt_try_send(); } } -extern "C" uint32_t hal_time_ms(){ +extern "C" uint32_t hal_time_ms(void){ return millis(); } diff --git a/platforms/arduino/examples/ANCS.ino/ANCS.ino b/platforms/arduino/examples/ANCS.ino/ANCS.ino index b81249385..25ba5e8cb 100644 --- a/platforms/arduino/examples/ANCS.ino/ANCS.ino +++ b/platforms/arduino/examples/ANCS.ino/ANCS.ino @@ -63,7 +63,7 @@ void ancs_callback(ancs_event_t * event){ } } -void setup(){ +void setup(void){ setup_printf(); printf("Main::Setup()\n"); BT.setup(); @@ -86,6 +86,6 @@ void setup(){ ancs_client_register_callback(&ancs_callback); } -void loop(){ +void loop(void){ BT.loop(); } diff --git a/platforms/arduino/examples/LECentral/LECentral.ino b/platforms/arduino/examples/LECentral/LECentral.ino index 9e9af534c..4234b0250 100644 --- a/platforms/arduino/examples/LECentral/LECentral.ino +++ b/platforms/arduino/examples/LECentral/LECentral.ino @@ -51,7 +51,7 @@ static void setup_printf(int baud) { stdout = &uartout; } -void setup() { +void setup(void){ setup_printf(9600); @@ -71,7 +71,7 @@ void setup() { } -void loop() { +void loop(void){ BTstack.loop(); // send counter as fast as possible diff --git a/platforms/arduino/examples/LEPeripheral/LEPeripheral.ino b/platforms/arduino/examples/LEPeripheral/LEPeripheral.ino index d834888f0..eef5af352 100644 --- a/platforms/arduino/examples/LEPeripheral/LEPeripheral.ino +++ b/platforms/arduino/examples/LEPeripheral/LEPeripheral.ino @@ -16,7 +16,7 @@ static void setup_printf(int baud) { stdout = &uartout; } -void setup() { +void setup(void){ setup_printf(9600); @@ -40,7 +40,7 @@ void setup() { } -void loop() { +void loop(void){ BTstack.loop(); } diff --git a/platforms/arduino/examples/iBeaconScanner/iBeaconScanner.ino b/platforms/arduino/examples/iBeaconScanner/iBeaconScanner.ino index a2f67d97d..3a974c21b 100644 --- a/platforms/arduino/examples/iBeaconScanner/iBeaconScanner.ino +++ b/platforms/arduino/examples/iBeaconScanner/iBeaconScanner.ino @@ -14,7 +14,7 @@ static void setup_printf(int baud) { stdout = &uartout; } -void setup() { +void setup(void){ setup_printf(9600); BTstack.setBLEAdvertisementCallback(advertisementCallback); @@ -23,7 +23,7 @@ void setup() { } -void loop() { +void loop(void){ BTstack.loop(); } diff --git a/platforms/daemon/src/btstack.c b/platforms/daemon/src/btstack.c index fc3dbb3be..20b455c35 100644 --- a/platforms/daemon/src/btstack.c +++ b/platforms/daemon/src/btstack.c @@ -77,7 +77,7 @@ void bt_use_tcp(const char * address, uint16_t port){ } // init BTstack library -int bt_open(){ +int bt_open(void){ socket_connection_register_packet_callback(btstack_packet_handler); @@ -93,7 +93,7 @@ int bt_open(){ } // stop using BTstack library -int bt_close(){ +int bt_close(void){ return socket_connection_close_tcp(btstack_connection); } diff --git a/platforms/daemon/src/daemon.c b/platforms/daemon/src/daemon.c index e7c152da8..0fd795869 100644 --- a/platforms/daemon/src/daemon.c +++ b/platforms/daemon/src/daemon.c @@ -1262,7 +1262,7 @@ const uint8_t adv_data[] = { uint8_t adv_data_len = sizeof(adv_data); static uint16_t todos = 0; -static void app_run(){ +static void app_run(void){ if (!hci_can_send_command_packet_now()) return; diff --git a/platforms/daemon/src/socket_connection.c b/platforms/daemon/src/socket_connection.c index 49606d08d..c04b53859 100644 --- a/platforms/daemon/src/socket_connection.c +++ b/platforms/daemon/src/socket_connection.c @@ -260,7 +260,7 @@ int socket_connection_hci_process(struct data_source *ds) { * if dispatch is successful, a connection is added again to run loop * pre: connections get parked iff packet was dispatched but could not be sent */ -void socket_connection_retry_parked(){ +void socket_connection_retry_parked(void){ // log_info("socket_connection_hci_process retry parked"); linked_item_t *it = (linked_item_t *) &parked; while (it->next) { @@ -382,7 +382,7 @@ void socket_connection_launchd_register_fd_array(launch_data_t listening_fd_arra /** * create socket data_source for socket specified by launchd configuration */ -int socket_connection_create_launchd(){ +int socket_connection_create_launchd(void){ launch_data_t sockets_dict, checkin_response; launch_data_t checkin_request; @@ -589,7 +589,7 @@ int socket_connection_close_tcp(connection_t * connection){ /** * create socket connection to BTdaemon */ -connection_t * socket_connection_open_unix(){ +connection_t * socket_connection_open_unix(void){ int btsocket = socket(AF_UNIX, SOCK_STREAM, 0); if(btsocket == -1){ diff --git a/platforms/ez430-rf2560/example/spp_accel.c b/platforms/ez430-rf2560/example/spp_accel.c index 233db5713..6d7761742 100644 --- a/platforms/ez430-rf2560/example/spp_accel.c +++ b/platforms/ez430-rf2560/example/spp_accel.c @@ -80,7 +80,7 @@ static uint8_t spp_service_buffer[150]; // SPP description static uint8_t accel_buffer[6]; -static void prepare_accel_packet(){ +static void prepare_accel_packet(void){ int16_t accl_x; int16_t accl_y; int16_t accl_z; @@ -106,7 +106,7 @@ static void prepare_accel_packet(){ printf("Accel: X: %04d, Y: %04d, Z: %04d\n\r", accl_x, accl_y, accl_z); } -static void send_packet(){ +static void send_packet(void){ int err = rfcomm_send_internal(rfcomm_channel_id, (uint8_t *)accel_buffer, sizeof(accel_buffer)); switch(err){ case 0: diff --git a/platforms/ez430-rf2560/firmware/hal_usb.c b/platforms/ez430-rf2560/firmware/hal_usb.c index 9f5e84495..97bcd8525 100755 --- a/platforms/ez430-rf2560/firmware/hal_usb.c +++ b/platforms/ez430-rf2560/firmware/hal_usb.c @@ -87,7 +87,7 @@ void halUsbSendChar(char character) UCA3TXBUF = character; } -char halUsbRecvChar(){ +char halUsbRecvChar(void){ while (!(UCA3IFG & UCRXIFG)); return UCA3RXBUF; } diff --git a/platforms/ez430-rf2560/src/hal_cpu.c b/platforms/ez430-rf2560/src/hal_cpu.c index 12dcabb03..9433628bc 100644 --- a/platforms/ez430-rf2560/src/hal_cpu.c +++ b/platforms/ez430-rf2560/src/hal_cpu.c @@ -52,7 +52,7 @@ static uint8_t low_power_mode_for_sleep = LPM0_bits; -void hal_cpu_disable_irqs(){ +void hal_cpu_disable_irqs(void){ // LED off LED1_OUT &= ~LED1_PIN; @@ -61,7 +61,7 @@ void hal_cpu_disable_irqs(){ __bic_SR_register(GIE); } -void hal_cpu_enable_irqs(){ +void hal_cpu_enable_irqs(void){ // enable irq __bis_SR_register(GIE); @@ -80,7 +80,7 @@ void hal_cpu_set_uart_needed_during_sleep(uint8_t enabled){ low_power_mode_for_sleep = LPM3_bits; } -void hal_cpu_enable_irqs_and_sleep(){ +void hal_cpu_enable_irqs_and_sleep(void){ // enable irq and enter lpm0 __bis_SR_register(low_power_mode_for_sleep + GIE); diff --git a/platforms/ios/SpringBoardAccess/SpringBoardAccess.c b/platforms/ios/SpringBoardAccess/SpringBoardAccess.c index 4fbce823e..a988bed4a 100644 --- a/platforms/ios/SpringBoardAccess/SpringBoardAccess.c +++ b/platforms/ios/SpringBoardAccess/SpringBoardAccess.c @@ -43,7 +43,7 @@ static CFMessagePortRef springBoardAccessMessagePort = 0; -static void SBA_refresh(){ +static void SBA_refresh(void){ // still valid if (springBoardAccessMessagePort && !CFMessagePortIsValid(springBoardAccessMessagePort)){ CFRelease(springBoardAccessMessagePort); @@ -55,7 +55,7 @@ static void SBA_refresh(){ } } -int SBA_available(){ +int SBA_available(void){ SBA_refresh(); if (springBoardAccessMessagePort) return 1; return 0; @@ -88,7 +88,7 @@ int SBA_removeStatusBarImage(char *name){ return SBA_sendMessage(SBAC_removeStatusBarImage, strlen(name), (UInt8*) name, NULL); } -int SBA_getBluetoothEnabled() { +int SBA_getBluetoothEnabled(void){ CFDataRef cfData; int result = SBA_sendMessage(SBAC_getBluetoothEnabled, 0, NULL, &cfData); if (result == 0){ diff --git a/platforms/ios/SpringBoardAccess/Tweak.xm b/platforms/ios/SpringBoardAccess/Tweak.xm index b0a00d4d1..e6b3931c6 100644 --- a/platforms/ios/SpringBoardAccess/Tweak.xm +++ b/platforms/ios/SpringBoardAccess/Tweak.xm @@ -63,7 +63,7 @@ #define kAppNetwork CFSTR("com.apple.preferences.network") #define kKeyBTNetwork CFSTR("bluetooth-network") -int iphone_system_bt_enabled(){ +int iphone_system_bt_enabled(void){ if ([[BluetoothManager sharedInstance] enabled]) { return 1; } else { diff --git a/platforms/ios/src/bt_control_iphone.m b/platforms/ios/src/bt_control_iphone.m index c1ea082ef..27694de57 100644 --- a/platforms/ios/src/bt_control_iphone.m +++ b/platforms/ios/src/bt_control_iphone.m @@ -151,14 +151,14 @@ static NSTimeInterval getTime(void){ /** * check OS version for >= 4.0 */ -static int iphone_os_at_least_40(){ +static int iphone_os_at_least_40(void){ return kCFCoreFoundationVersionNumber >= 550.32; } /** * check OS version for >= 6.0 */ -static int iphone_os_at_least_60(){ +static int iphone_os_at_least_60(void){ return kCFCoreFoundationVersionNumber >= 788.0; } @@ -185,7 +185,7 @@ static const char * iphone_name(void *config){ } // Get BD_ADDR from IORegistry -static void ioregistry_get_info() { +static void ioregistry_get_info(void){ mach_port_t mp; IOMasterPort(MACH_PORT_NULL,&mp); CFMutableDictionaryRef bt_matching = IOServiceNameMatching("bluetooth"); @@ -207,7 +207,7 @@ static void ioregistry_get_info() { log_info("transport-speed: %u\n", transport_speed); } -static int iphone_has_csr(){ +static int iphone_has_csr(void){ // construct script path from device name char *machine = get_machine_name(); if (strncmp(machine, "iPhone1,", strlen("iPhone1,")) == 0) { diff --git a/platforms/ios/src/hci_transport_h4_iphone.c b/platforms/ios/src/hci_transport_h4_iphone.c index 94752f8ea..1db2eb0af 100644 --- a/platforms/ios/src/hci_transport_h4_iphone.c +++ b/platforms/ios/src/hci_transport_h4_iphone.c @@ -228,7 +228,7 @@ err_out0: return -1; } -static int h4_close(){ +static int h4_close(void *transport_config){ // first remove run loop handler run_loop_remove_data_source(hci_transport_h4->ds); @@ -375,7 +375,7 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } // get h4 singleton -hci_transport_t * hci_transport_h4_iphone_instance() { +hci_transport_t * hci_transport_h4_iphone_instance(void){ if (hci_transport_h4 == NULL) { hci_transport_h4 = malloc( sizeof(hci_transport_h4_t)); hci_transport_h4->ds = NULL; diff --git a/platforms/ios/src/platform_iphone.m b/platforms/ios/src/platform_iphone.m index 78d208109..7fb6d6222 100644 --- a/platforms/ios/src/platform_iphone.m +++ b/platforms/ios/src/platform_iphone.m @@ -76,7 +76,7 @@ void platform_iphone_status_handler(BLUETOOTH_STATE state){ } static void (*window_manager_restart_callback)() = NULL; -static void springBoardDidLaunch(){ +static void springBoardDidLaunch(void){ NSLog(@"springBoardDidLaunch!\n"); if (window_manager_restart_callback) { int timer; @@ -104,7 +104,7 @@ void platform_iphone_register_window_manager_restart(void (*callback)() ){ } static void (*preferences_changed_callback)() = NULL; -static void preferencesDidChange(){ +static void preferencesDidChange(void){ NSLog(@"ch.ringwald.btstack.preferences!\n"); if (preferences_changed_callback) { (*preferences_changed_callback)(); diff --git a/platforms/libusb/main.c b/platforms/libusb/main.c index 5ede8cb56..cb6c4df6b 100644 --- a/platforms/libusb/main.c +++ b/platforms/libusb/main.c @@ -75,7 +75,7 @@ static void sigint_handler(int param){ } static int led_state = 0; -void hal_led_toggle(){ +void hal_led_toggle(void){ led_state = 1 - led_state; printf("LED State %u\n", led_state); } diff --git a/platforms/msp-exp430f5438-cc2564b/example/spp_accel.c b/platforms/msp-exp430f5438-cc2564b/example/spp_accel.c index 7c60b2905..a57da25d2 100644 --- a/platforms/msp-exp430f5438-cc2564b/example/spp_accel.c +++ b/platforms/msp-exp430f5438-cc2564b/example/spp_accel.c @@ -80,7 +80,7 @@ static uint8_t spp_service_buffer[150]; // SPP description static uint8_t accel_buffer[6]; -static void prepare_accel_packet(){ +static void prepare_accel_packet(void){ int16_t accl_x; int16_t accl_y; int16_t accl_z; @@ -106,7 +106,7 @@ static void prepare_accel_packet(){ printf("Accel: X: %04d, Y: %04d, Z: %04d\n\r", accl_x, accl_y, accl_z); } -static void send_packet(){ +static void send_packet(void){ int err = rfcomm_send_internal(rfcomm_channel_id, (uint8_t *)accel_buffer, sizeof(accel_buffer)); switch(err){ case 0: diff --git a/platforms/msp-exp430f5438-cc2564b/firmware/hal_usb.c b/platforms/msp-exp430f5438-cc2564b/firmware/hal_usb.c index ae2f92515..ed5e9b339 100755 --- a/platforms/msp-exp430f5438-cc2564b/firmware/hal_usb.c +++ b/platforms/msp-exp430f5438-cc2564b/firmware/hal_usb.c @@ -79,7 +79,7 @@ void halUsbSendChar(char character) UCA1TXBUF = character; } -char halUsbRecvChar(){ +char halUsbRecvChar(void){ while (!(UCA1IFG & UCRXIFG)); return UCA1RXBUF; } diff --git a/platforms/msp-exp430f5438-cc2564b/src/hal_cpu.c b/platforms/msp-exp430f5438-cc2564b/src/hal_cpu.c index 12dcabb03..9433628bc 100644 --- a/platforms/msp-exp430f5438-cc2564b/src/hal_cpu.c +++ b/platforms/msp-exp430f5438-cc2564b/src/hal_cpu.c @@ -52,7 +52,7 @@ static uint8_t low_power_mode_for_sleep = LPM0_bits; -void hal_cpu_disable_irqs(){ +void hal_cpu_disable_irqs(void){ // LED off LED1_OUT &= ~LED1_PIN; @@ -61,7 +61,7 @@ void hal_cpu_disable_irqs(){ __bic_SR_register(GIE); } -void hal_cpu_enable_irqs(){ +void hal_cpu_enable_irqs(void){ // enable irq __bis_SR_register(GIE); @@ -80,7 +80,7 @@ void hal_cpu_set_uart_needed_during_sleep(uint8_t enabled){ low_power_mode_for_sleep = LPM3_bits; } -void hal_cpu_enable_irqs_and_sleep(){ +void hal_cpu_enable_irqs_and_sleep(void){ // enable irq and enter lpm0 __bis_SR_register(low_power_mode_for_sleep + GIE); diff --git a/platforms/msp-exp430f5438-cc2564b/src/main.c b/platforms/msp-exp430f5438-cc2564b/src/main.c index 48365da2d..83c25a679 100644 --- a/platforms/msp-exp430f5438-cc2564b/src/main.c +++ b/platforms/msp-exp430f5438-cc2564b/src/main.c @@ -62,7 +62,7 @@ #include "remote_device_db.h" #include "btstack-config.h" -static void hw_setup(){ +static void hw_setup(void){ // stop watchdog timer WDTCTL = WDTPW + WDTHOLD; @@ -84,7 +84,7 @@ static void hw_setup(){ __enable_interrupt(); } -static void btstack_setup(){ +static void btstack_setup(void){ /// GET STARTED with BTstack /// btstack_memory_init(); run_loop_init(RUN_LOOP_EMBEDDED); diff --git a/platforms/msp430f5229lp-cc2564b/firmware/hal_usb.c b/platforms/msp430f5229lp-cc2564b/firmware/hal_usb.c index 938deef49..d1efa31c3 100755 --- a/platforms/msp430f5229lp-cc2564b/firmware/hal_usb.c +++ b/platforms/msp430f5229lp-cc2564b/firmware/hal_usb.c @@ -70,7 +70,7 @@ void halUsbSendChar(char character) UCA1TXBUF = character; } -char halUsbRecvChar(){ +char halUsbRecvChar(void){ while (!(UCA1IFG & UCRXIFG)); return UCA1RXBUF; } diff --git a/platforms/msp430f5229lp-cc2564b/src/hal_cpu.c b/platforms/msp430f5229lp-cc2564b/src/hal_cpu.c index 9cdf963f8..7e440f862 100644 --- a/platforms/msp430f5229lp-cc2564b/src/hal_cpu.c +++ b/platforms/msp430f5229lp-cc2564b/src/hal_cpu.c @@ -52,7 +52,7 @@ static uint8_t low_power_mode_for_sleep = LPM0_bits; -void hal_cpu_disable_irqs(){ +void hal_cpu_disable_irqs(void){ // LED off LED1_OUT &= ~LED1_PIN; @@ -61,7 +61,7 @@ void hal_cpu_disable_irqs(){ __bic_SR_register(GIE); } -void hal_cpu_enable_irqs(){ +void hal_cpu_enable_irqs(void){ // enable irq __bis_SR_register(GIE); @@ -80,7 +80,7 @@ void hal_cpu_set_uart_needed_during_sleep(uint8_t enabled){ low_power_mode_for_sleep = LPM3_bits; } -void hal_cpu_enable_irqs_and_sleep(){ +void hal_cpu_enable_irqs_and_sleep(void){ // enable irq and enter lpm0 __bis_SR_register(low_power_mode_for_sleep + GIE); diff --git a/platforms/msp430f5229lp-cc2564b/src/main.c b/platforms/msp430f5229lp-cc2564b/src/main.c index 272b23ac8..1d52fbc49 100644 --- a/platforms/msp430f5229lp-cc2564b/src/main.c +++ b/platforms/msp430f5229lp-cc2564b/src/main.c @@ -63,7 +63,7 @@ #include "remote_device_db.h" #include "btstack-config.h" -static void hw_setup(){ +static void hw_setup(void){ // stop watchdog timer WDTCTL = WDTPW + WDTHOLD; @@ -88,7 +88,7 @@ static void hw_setup(){ __enable_interrupt(); } -static void btstack_setup(){ +static void btstack_setup(void){ hci_dump_open(NULL, HCI_DUMP_STDOUT); diff --git a/platforms/mtk/hci_transport_h4_mtk.c b/platforms/mtk/hci_transport_h4_mtk.c index eff61b5ce..ca0e3b795 100644 --- a/platforms/mtk/hci_transport_h4_mtk.c +++ b/platforms/mtk/hci_transport_h4_mtk.c @@ -160,7 +160,7 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } // get h4 singleton -hci_transport_t * hci_transport_h4_instance() { +hci_transport_t * hci_transport_h4_instance(void){ if (hci_transport_h4 == NULL) { hci_transport_h4 = (hci_transport_h4_t*)malloc( sizeof(hci_transport_h4_t)); hci_transport_h4->ds = NULL; diff --git a/platforms/pic32-harmony/src/app_debug.c b/platforms/pic32-harmony/src/app_debug.c index 7648e5b52..250c84f46 100644 --- a/platforms/pic32-harmony/src/app_debug.c +++ b/platforms/pic32-harmony/src/app_debug.c @@ -18,7 +18,7 @@ void _mon_putc (char c) PLIB_USART_TransmitterByteSend(APP_DEBUG_USART_ID, c);; } -void APP_Debug_Initialize(){ +void APP_Debug_Initialize(void){ // PPS Output Mapping: PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U1TX, OUTPUT_PIN_RPD3 ); diff --git a/platforms/pic32-harmony/src/btstack_port.c b/platforms/pic32-harmony/src/btstack_port.c index 80354d376..117ef4e08 100644 --- a/platforms/pic32-harmony/src/btstack_port.c +++ b/platforms/pic32-harmony/src/btstack_port.c @@ -87,15 +87,15 @@ static void msleep(uint32_t delay) { /// HAL CPU /// #include -void hal_cpu_disable_irqs(){ +void hal_cpu_disable_irqs(void){ // TODO implement } -void hal_cpu_enable_irqs(){ +void hal_cpu_enable_irqs(void){ // TODO implement } -void hal_cpu_enable_irqs_and_sleep(){ +void hal_cpu_enable_irqs_and_sleep(void){ // TODO implement } @@ -232,7 +232,7 @@ void BTSTACK_Initialize ( void ) } -void BTSTACK_Tasks(){ +void BTSTACK_Tasks(void){ if (bytes_to_read && PLIB_USART_ReceiverDataIsAvailable(BT_USART_ID)) { *rx_buffer_ptr++ = PLIB_USART_ReceiverByteReceive(BT_USART_ID); bytes_to_read--; diff --git a/platforms/posix-cc2564b/main.c b/platforms/posix-cc2564b/main.c index 977a8a594..d15d0b0e4 100644 --- a/platforms/posix-cc2564b/main.c +++ b/platforms/posix-cc2564b/main.c @@ -79,8 +79,8 @@ static void sigint_handler(int param){ exit(0); } -static led_state = 0; -void hal_led_toggle(){ +static int led_state = 0; +void hal_led_toggle(void){ led_state = 1 - led_state; printf("LED State %u\n", led_state); } diff --git a/platforms/posix-stlc2500d/main.c b/platforms/posix-stlc2500d/main.c index fdc5b6168..404c040ab 100644 --- a/platforms/posix-stlc2500d/main.c +++ b/platforms/posix-stlc2500d/main.c @@ -81,7 +81,7 @@ static void sigint_handler(int param){ } static int led_state = 0; -void hal_led_toggle(){ +void hal_led_toggle(void){ led_state = 1 - led_state; printf("LED State %u\n", led_state); } diff --git a/platforms/posix-wl183x/main.c b/platforms/posix-wl183x/main.c index 977a8a594..d15d0b0e4 100644 --- a/platforms/posix-wl183x/main.c +++ b/platforms/posix-wl183x/main.c @@ -79,8 +79,8 @@ static void sigint_handler(int param){ exit(0); } -static led_state = 0; -void hal_led_toggle(){ +static int led_state = 0; +void hal_led_toggle(void){ led_state = 1 - led_state; printf("LED State %u\n", led_state); } diff --git a/platforms/posix/src/hci_transport_h2_libusb.c b/platforms/posix/src/hci_transport_h2_libusb.c index 71ad7f29e..a0beb3681 100644 --- a/platforms/posix/src/hci_transport_h2_libusb.c +++ b/platforms/posix/src/hci_transport_h2_libusb.c @@ -198,7 +198,7 @@ static void async_callback(struct libusb_transfer *transfer) // log_info("end async_callback"); } -static void sco_state_machine_init(){ +static void sco_state_machine_init(void){ sco_state = H2_W4_SCO_HEADER; sco_read_pos = 0; sco_bytes_to_read = 3; diff --git a/platforms/posix/src/hci_transport_h5.c b/platforms/posix/src/hci_transport_h5.c index fa689be2e..796ac5a52 100644 --- a/platforms/posix/src/hci_transport_h5.c +++ b/platforms/posix/src/hci_transport_h5.c @@ -159,7 +159,7 @@ static int h5_open(void *transport_config){ return 0; } -static int h5_close(){ +static int h5_close(void *transport_config){ // first remove run loop handler run_loop_remove_data_source(hci_transport_h5->ds); @@ -285,7 +285,7 @@ static int h5_process(struct data_source *ds) { return 0; } -static const char * h5_get_transport_name(){ +static const char * h5_get_transport_name(void){ return "H5"; } diff --git a/platforms/posix/src/remote_device_db_fs.c b/platforms/posix/src/remote_device_db_fs.c index 55598f5f1..521044689 100644 --- a/platforms/posix/src/remote_device_db_fs.c +++ b/platforms/posix/src/remote_device_db_fs.c @@ -155,6 +155,6 @@ const remote_device_db_t remote_device_db_fs = { delete_name }; -const remote_device_db_t * remote_device_db_fs_instance(){ +const remote_device_db_t * remote_device_db_fs_instance(void){ return &remote_device_db_fs; } diff --git a/platforms/stm32-f103rb-nucleo/main.c b/platforms/stm32-f103rb-nucleo/main.c index e77a7a9a6..db82ce355 100644 --- a/platforms/stm32-f103rb-nucleo/main.c +++ b/platforms/stm32-f103rb-nucleo/main.c @@ -134,15 +134,15 @@ void hal_led_toggle(void){ // hal_cpu.h implementation #include -void hal_cpu_disable_irqs(){ +void hal_cpu_disable_irqs(void){ __disable_irq(); } -void hal_cpu_enable_irqs(){ +void hal_cpu_enable_irqs(void){ __enable_irq(); } -void hal_cpu_enable_irqs_and_sleep(){ +void hal_cpu_enable_irqs_and_sleep(void){ hal_led_off(); __enable_irq(); __asm__("wfe"); // go to sleep if event flag isn't set. if set, just clear it. IRQs set event flag @@ -159,11 +159,11 @@ static void (*rx_done_handler)(void) = dummy_handler; static void (*tx_done_handler)(void) = dummy_handler; static void (*cts_irq_handler)(void) = dummy_handler; -static void hal_uart_manual_rts_set(){ +static void hal_uart_manual_rts_set(void){ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO_USART3_RTS); } -static void hal_uart_manual_rts_clear(){ +static void hal_uart_manual_rts_clear(void){ gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART3_RTS); } diff --git a/src/hci.c b/src/hci.c index 6d30bbd1a..8a346b7f8 100644 --- a/src/hci.c +++ b/src/hci.c @@ -124,7 +124,7 @@ static hci_connection_t * create_connection_for_bd_addr_and_type(bd_addr_t addr, * * @return le connection parameter range struct */ -le_connection_parameter_range_t gap_le_get_connection_parameter_range(){ +le_connection_parameter_range_t gap_le_get_connection_parameter_range(void){ return hci_stack->le_connection_parameter_range; } @@ -833,12 +833,12 @@ static void hci_initialization_timeout_handler(timer_source_t * ds){ } } -static void hci_initializing_next_state(){ +static void hci_initializing_next_state(void){ hci_stack->substate = (hci_substate_t )( ((int) hci_stack->substate) + 1); } // assumption: hci_can_send_command_packet_now() == true -static void hci_initializing_run(){ +static void hci_initializing_run(void){ log_info("hci_initializing_run: substate %u", hci_stack->substate); switch (hci_stack->substate){ case HCI_INIT_SEND_RESET: @@ -1646,7 +1646,7 @@ void hci_register_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *p hci_stack->packet_handler = handler; } -static void hci_state_reset(){ +static void hci_state_reset(void){ // no connections yet hci_stack->connections = NULL; @@ -1727,7 +1727,7 @@ void hci_init(hci_transport_t *transport, void *config, bt_control_t *control, r hci_state_reset(); } -void hci_close(){ +void hci_close(void){ // close remote device db if (hci_stack->remote_device_db) { hci_stack->remote_device_db->close(); @@ -1755,7 +1755,7 @@ void hci_set_bd_addr(bd_addr_t addr){ hci_stack->custom_bd_addr_set = 1; } -void hci_disable_l2cap_timeout_check(){ +void hci_disable_l2cap_timeout_check(void){ disable_l2cap_timeouts = 1; } // State-Module-Driver overview @@ -2031,7 +2031,7 @@ void hci_local_bd_addr(bd_addr_t address_buffer){ memcpy(address_buffer, hci_stack->local_bd_addr, 6); } -void hci_run(){ +void hci_run(void){ // log_info("hci_run: entered"); hci_connection_t * connection; @@ -2457,7 +2457,7 @@ void hci_ssp_set_enable(int enable){ hci_stack->ssp_enable = enable; } -int hci_local_ssp_activated(){ +int hci_local_ssp_activated(void){ return hci_ssp_supported() && hci_stack->ssp_enable; } @@ -2502,7 +2502,7 @@ int hci_send_cmd(const hci_cmd_t *cmd, ...){ // Create various non-HCI events. // TODO: generalize, use table similar to hci_create_command -void hci_emit_state(){ +void hci_emit_state(void){ log_info("BTSTACK_EVENT_STATE %u", hci_stack->state); uint8_t event[3]; event[0] = BTSTACK_EVENT_STATE; @@ -2565,7 +2565,7 @@ void hci_emit_l2cap_check_timeout(hci_connection_t *conn){ hci_stack->packet_handler(HCI_EVENT_PACKET, event, sizeof(event)); } -void hci_emit_nr_connections_changed(){ +void hci_emit_nr_connections_changed(void){ log_info("BTSTACK_EVENT_NR_CONNECTIONS_CHANGED %u", nr_hci_connections()); uint8_t event[3]; event[0] = BTSTACK_EVENT_NR_CONNECTIONS_CHANGED; @@ -2575,7 +2575,7 @@ void hci_emit_nr_connections_changed(){ hci_stack->packet_handler(HCI_EVENT_PACKET, event, sizeof(event)); } -void hci_emit_hci_open_failed(){ +void hci_emit_hci_open_failed(void){ log_info("BTSTACK_EVENT_POWERON_FAILED"); uint8_t event[2]; event[0] = BTSTACK_EVENT_POWERON_FAILED; @@ -2585,7 +2585,7 @@ void hci_emit_hci_open_failed(){ } #ifndef EMBEDDED -void hci_emit_btstack_version() { +void hci_emit_btstack_version(void){ log_info("BTSTACK_EVENT_VERSION %u.%u", BTSTACK_MAJOR, BTSTACK_MINOR); uint8_t event[6]; event[0] = BTSTACK_EVENT_VERSION; @@ -2795,14 +2795,14 @@ void gap_set_local_name(const char * local_name){ hci_stack->local_name = local_name; } -le_command_status_t le_central_start_scan(){ +le_command_status_t le_central_start_scan(void){ if (hci_stack->le_scanning_state == LE_SCANNING) return BLE_PERIPHERAL_OK; hci_stack->le_scanning_state = LE_START_SCAN; hci_run(); return BLE_PERIPHERAL_OK; } -le_command_status_t le_central_stop_scan(){ +le_command_status_t le_central_stop_scan(void){ if ( hci_stack->le_scanning_state == LE_SCAN_IDLE) return BLE_PERIPHERAL_OK; hci_stack->le_scanning_state = LE_STOP_SCAN; hci_run(); @@ -2848,7 +2848,7 @@ le_command_status_t le_central_connect(bd_addr_t addr, bd_addr_type_t addr_type } // @assumption: only a single outgoing LE Connection exists -static hci_connection_t * le_central_get_outgoing_connection(){ +static hci_connection_t * le_central_get_outgoing_connection(void){ linked_item_t *it; for (it = (linked_item_t *) hci_stack->connections; it ; it = it->next){ hci_connection_t * conn = (hci_connection_t *) it; @@ -2864,7 +2864,7 @@ static hci_connection_t * le_central_get_outgoing_connection(){ return NULL; } -le_command_status_t le_central_connect_cancel(){ +le_command_status_t le_central_connect_cancel(void){ hci_connection_t * conn = le_central_get_outgoing_connection(); switch (conn->state){ case SEND_CREATE_CONNECTION: @@ -2915,7 +2915,7 @@ le_command_status_t gap_disconnect(hci_con_handle_t handle){ return BLE_PERIPHERAL_OK; } -void hci_disconnect_all(){ +void hci_disconnect_all(void){ linked_list_iterator_t it; linked_list_iterator_init(&it, &hci_stack->connections); while (linked_list_iterator_has_next(&it)){ diff --git a/src/hci.h b/src/hci.h index 0563b3692..3617e9460 100644 --- a/src/hci.h +++ b/src/hci.h @@ -765,7 +765,7 @@ int hci_send_cmd_packet(uint8_t *packet, int size); /* API_START */ -le_connection_parameter_range_t gap_le_get_connection_parameter_range(); +le_connection_parameter_range_t gap_le_get_connection_parameter_range(void); void gap_le_set_connection_parameter_range(le_connection_parameter_range_t range); /* LE Client Start */ diff --git a/src/hci_dump.c b/src/hci_dump.c index dc88008e6..5b47548f8 100644 --- a/src/hci_dump.c +++ b/src/hci_dump.c @@ -270,7 +270,7 @@ void hci_dump_log_P(PGM_P format, ...){ } #endif -void hci_dump_close(){ +void hci_dump_close(void){ #ifndef EMBEDDED close(dump_file); dump_file = -1; diff --git a/src/hci_transport_h4_dma.c b/src/hci_transport_h4_dma.c index 9513b8c09..dcf9bc250 100644 --- a/src/hci_transport_h4_dma.c +++ b/src/hci_transport_h4_dma.c @@ -79,10 +79,10 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); static void h4_block_received(void); static void h4_block_sent(void); static int h4_open(void *transport_config); -static int h4_close(); +static int h4_close(void *transport_config); static void h4_register_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)); static int h4_send_packet(uint8_t packet_type, uint8_t *packet, int size); -static const char * h4_get_transport_name(); +static const char * h4_get_transport_name(void); static int h4_set_baudrate(uint32_t baudrate); static int h4_can_send_packet_now(uint8_t packet_type); @@ -148,7 +148,7 @@ static int h4_open(void *transport_config){ return 0; } -static int h4_close(){ +static int h4_close(void *transport_config){ // first remove run loop handler run_loop_remove_data_source(&hci_transport_h4_dma_ds); @@ -286,7 +286,7 @@ static int h4_can_send_packet_now(uint8_t packet_type){ } -static const char * h4_get_transport_name(){ +static const char * h4_get_transport_name(void){ return "H4_DMA"; } @@ -294,6 +294,6 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } // get h4 singleton -hci_transport_t * hci_transport_h4_dma_instance() { +hci_transport_t * hci_transport_h4_dma_instance(void){ return (hci_transport_t *) &hci_transport_h4_dma; } diff --git a/src/hci_transport_h4_ehcill_dma.c b/src/hci_transport_h4_ehcill_dma.c index 152e221bd..96a8ca778 100644 --- a/src/hci_transport_h4_ehcill_dma.c +++ b/src/hci_transport_h4_ehcill_dma.c @@ -106,9 +106,9 @@ static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size); static void h4_block_received(void); static void h4_block_sent(void); static int h4_open(void *transport_config); -static int h4_close(); +static int h4_close(void *transport_config); static void h4_register_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)); -static const char * h4_get_transport_name(); +static const char * h4_get_transport_name(void); static int h4_set_baudrate(uint32_t baudrate); static int h4_can_send_packet_now(uint8_t packet_type); @@ -116,7 +116,7 @@ static int ehcill_send_packet(uint8_t packet_type, uint8_t *packet, int size); static void ehcill_uart_dma_receive_block(uint8_t *buffer, uint16_t size); static int ehcill_sleep_mode_active(void); static void ehcill_handle(uint8_t action); -static void ehcill_cts_irq_handler(); +static void ehcill_cts_irq_handler(void); // eCHILL: state machine static EHCILL_STATE ehcill_state = EHCILL_STATE_AWAKE; @@ -170,12 +170,12 @@ static const hci_transport_h4_t hci_transport_h4_ehcill_dma = { static void dummy_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ } -static const char * h4_get_transport_name(){ +static const char * h4_get_transport_name(void){ return "H4_EHCILL_DMA"; } // get h4 singleton -hci_transport_t * hci_transport_h4_dma_instance() { +hci_transport_t * hci_transport_h4_dma_instance(void){ return (hci_transport_t *) &hci_transport_h4_ehcill_dma; } @@ -213,7 +213,7 @@ static int h4_set_baudrate(uint32_t baudrate){ return hal_uart_dma_set_baud(baudrate); } -static int h4_close(){ +static int h4_close(void *transport_config){ // first remove run loop handler run_loop_remove_data_source(&hci_transport_h4_dma_ds); @@ -308,7 +308,7 @@ static void ehcill_sleep_ack_timer_handler(timer_source_t * timer){ hal_uart_dma_send_block(&ehcill_command_to_send, 1); } -static void ehcill_sleep_ack_timer_setup(){ +static void ehcill_sleep_ack_timer_setup(void){ // setup timer ehcill_sleep_ack_timer.process = &ehcill_sleep_ack_timer_handler; run_loop_set_timer(&ehcill_sleep_ack_timer, 50); @@ -390,7 +390,7 @@ int ehcill_sleep_mode_active(void){ return ehcill_state == EHCILL_STATE_SLEEP; } -static void ehcill_cts_irq_handler(){ +static void ehcill_cts_irq_handler(void){ ehcill_handle(EHCILL_CTS_SIGNAL); } diff --git a/src/l2cap.c b/src/l2cap.c index 7af639b8a..8c0e2aec8 100644 --- a/src/l2cap.c +++ b/src/l2cap.c @@ -92,7 +92,7 @@ static void l2cap_emit_connection_request(l2cap_channel_t *channel); static int l2cap_channel_ready_for_open(l2cap_channel_t *channel); -void l2cap_init(){ +void l2cap_init(void){ new_credits_blocked = 0; signaling_responses_pending = 0; @@ -318,7 +318,7 @@ static void l2cap_start_ertx(l2cap_channel_t * channel){ run_loop_add_timer(&channel->rtx); } -void l2cap_require_security_level_2_for_outgoing_sdp(){ +void l2cap_require_security_level_2_for_outgoing_sdp(void){ require_security_level2_for_outgoing_sdp = 1; } @@ -736,7 +736,7 @@ uint16_t l2cap_max_mtu(void){ return HCI_ACL_PAYLOAD_SIZE - L2CAP_HEADER_SIZE; } -uint16_t l2cap_max_le_mtu(){ +uint16_t l2cap_max_le_mtu(void){ return l2cap_max_mtu(); } diff --git a/src/run_loop.c b/src/run_loop.c index a8004dd63..0b046a4c1 100644 --- a/src/run_loop.c +++ b/src/run_loop.c @@ -120,7 +120,7 @@ int run_loop_remove_timer(timer_source_t *ts){ return the_run_loop->remove_timer(ts); } -void run_loop_timer_dump(){ +void run_loop_timer_dump(void){ run_loop_assert(); the_run_loop->dump_timer(); } @@ -128,7 +128,7 @@ void run_loop_timer_dump(){ /** * Execute run_loop */ -void run_loop_execute() { +void run_loop_execute(void){ run_loop_assert(); the_run_loop->execute(); } diff --git a/src/sdp.c b/src/sdp.c index f340ffe36..61d096572 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -73,7 +73,7 @@ static void (*app_packet_handler)(void * connection, uint8_t packet_type, static uint16_t l2cap_cid = 0; static uint16_t sdp_response_size = 0; -void sdp_init(){ +void sdp_init(void){ // register with l2cap psm sevices - max MTU l2cap_register_service_internal(NULL, sdp_packet_handler, PSM_SDP, 0xffff, LEVEL_0); } diff --git a/src/sdp_query_rfcomm.c b/src/sdp_query_rfcomm.c index c3799fb5c..882ed21be 100644 --- a/src/sdp_query_rfcomm.c +++ b/src/sdp_query_rfcomm.c @@ -89,7 +89,7 @@ static void (*sdp_app_callback)(sdp_query_event_t * event, void * context) = dum static void dummy_notify_app(sdp_query_event_t* event, void * context){} -static void emit_service(){ +static void emit_service(void){ sdp_query_rfcomm_service_event_t value_event = { SDP_QUERY_RFCOMM_SERVICE, sdp_rfcomm_channel_nr, @@ -289,7 +289,7 @@ static void handle_sdp_parser_event(sdp_query_event_t * event){ // insert higher level code HERE } -void sdp_query_rfcomm_init(){ +void sdp_query_rfcomm_init(void){ // init de_state_init(&de_header_state); de_state_init(&sn_de_header_state); @@ -312,7 +312,7 @@ void sdp_query_rfcomm_channel_and_name_for_uuid(bd_addr_t remote, uint16_t uuid) sdp_query_rfcomm_channel_and_name_for_search_pattern(remote, (uint8_t*)des_serviceSearchPattern); } -void sdp_query_rfcomm_deregister_callback(){ +void sdp_query_rfcomm_deregister_callback(void){ sdp_query_rfcomm_init(); sdp_app_callback = dummy_notify_app; sdp_app_context = NULL; diff --git a/test/ble_client/advertising_data_parser.c b/test/ble_client/advertising_data_parser.c index 2875d0765..66d6448ae 100644 --- a/test/ble_client/advertising_data_parser.c +++ b/test/ble_client/advertising_data_parser.c @@ -96,7 +96,7 @@ static uint8_t num_completed_evt[] ={ }; -int dummy_callback(){ +int dummy_callback(void){ return 0; } @@ -141,7 +141,7 @@ void packet_handler(uint8_t packet_type, uint8_t *packet, uint16_t size){ TEST_GROUP(ADParser){ - void setup(){ + void setup(void){ hci_init(&dummy_transport, NULL, NULL, NULL); hci_register_packet_handler(packet_handler); } diff --git a/test/des_iterator/des_iterator_test.c b/test/des_iterator/des_iterator_test.c index 1df1dba77..c98600b5b 100644 --- a/test/des_iterator/des_iterator_test.c +++ b/test/des_iterator/des_iterator_test.c @@ -30,7 +30,7 @@ TEST_GROUP(DESParser){ int value_index; des_iterator_t des_list_it; - void setup(){ + void setup(void){ value_index = 0; } diff --git a/test/gatt_client/gatt_client.c b/test/gatt_client/gatt_client.c index 81de9f34c..4c603ee97 100644 --- a/test/gatt_client/gatt_client.c +++ b/test/gatt_client/gatt_client.c @@ -103,37 +103,37 @@ void CHECK_EQUAL_GATT_ATTRIBUTE(const uint8_t * exp_uuid, const uint8_t * exp_ha // ----------------------------------------------------- -static void verify_primary_services_with_uuid16(){ +static void verify_primary_services_with_uuid16(void){ CHECK_EQUAL(1, result_index); CHECK_EQUAL_GATT_ATTRIBUTE(primary_service_uuid16, primary_service_uuid16_handles, services[0].uuid128, services[0].start_group_handle, services[0].end_group_handle); } -static void verify_primary_services_with_uuid128(){ +static void verify_primary_services_with_uuid128(void){ CHECK_EQUAL(1, result_index); CHECK_EQUAL_GATT_ATTRIBUTE(primary_service_uuid128, primary_service_uuid128_handles, services[0].uuid128, services[0].start_group_handle, services[0].end_group_handle); } -static void verify_primary_services(){ +static void verify_primary_services(void){ CHECK_EQUAL(6, result_index); for (int i=0; iauthorized = 0; } -int l2cap_can_send_connectionless_packet_now(){ +int l2cap_can_send_connectionless_packet_now(void){ return 1; } @@ -98,7 +98,7 @@ int l2cap_send_prepared_connectionless(uint16_t handle, uint16_t cid, uint16_t l return 0; } -int sm_cmac_ready(){ +int sm_cmac_ready(void){ return 1; } void sm_cmac_start(sm_key_t k, uint16_t message_len, uint8_t * message, void (*done_handler)(uint8_t hash[8])){ diff --git a/test/linked_list/linked_list_test.c b/test/linked_list/linked_list_test.c index 2d8a23772..e9d50b69f 100644 --- a/test/linked_list/linked_list_test.c +++ b/test/linked_list/linked_list_test.c @@ -9,7 +9,7 @@ linked_item_t itemC; linked_item_t itemD; TEST_GROUP(LinkedList){ - void setup(){ + void setup(void){ testList = NULL; linked_list_add(&testList, &itemD); linked_list_add(&testList, &itemC); diff --git a/test/remote_device_db/remote_device_db_fs_test.c b/test/remote_device_db/remote_device_db_fs_test.c index 4d1053668..d82560e73 100644 --- a/test/remote_device_db/remote_device_db_fs_test.c +++ b/test/remote_device_db/remote_device_db_fs_test.c @@ -15,7 +15,7 @@ TEST_GROUP(RemoteDeviceDB){ link_key_t link_key; link_key_type_t link_key_type; - void setup(){ + void setup(void){ bd_addr_t addr_1 = {0x00, 0x01, 0x02, 0x03, 0x04, 0x01 }; BD_ADDR_COPY(bd_addr, addr_1); @@ -23,7 +23,7 @@ TEST_GROUP(RemoteDeviceDB){ sprintf((char*)link_key, "%d", 100); } - void teardown(){} + void teardown(void){} }; diff --git a/test/remote_device_db/remote_device_db_memory_test.c b/test/remote_device_db/remote_device_db_memory_test.c index 960a62125..eeed3192e 100644 --- a/test/remote_device_db/remote_device_db_memory_test.c +++ b/test/remote_device_db/remote_device_db_memory_test.c @@ -33,7 +33,7 @@ TEST_GROUP(RemoteDeviceDB){ link_key_t link_key; link_key_type_t link_key_type; - void setup(){ + void setup(void){ btstack_memory_init(); bd_addr_t addr_1 = {0x00, 0x01, 0x02, 0x03, 0x04, 0x01 }; @@ -47,7 +47,7 @@ TEST_GROUP(RemoteDeviceDB){ sprintf((char*)link_key, "%d", 100); } - void teardown(){} + void teardown(void){} }; TEST(RemoteDeviceDB, MemoryPool){ diff --git a/test/sdp_client/general_sdp_query.c b/test/sdp_client/general_sdp_query.c index 7bf9cbfda..95d85f9a0 100644 --- a/test/sdp_client/general_sdp_query.c +++ b/test/sdp_client/general_sdp_query.c @@ -171,7 +171,7 @@ static void handle_sdp_parser_event(sdp_query_event_t * event){ TEST_GROUP(SDPClient){ - void setup(){ + void setup(void){ attribute_value_buffer_size = 1000; attribute_value = (uint8_t*) malloc(attribute_value_buffer_size); record_id = -1; diff --git a/test/sdp_client/sdp_rfcomm_query.c b/test/sdp_client/sdp_rfcomm_query.c index 341592577..0a5a4f679 100644 --- a/test/sdp_client/sdp_rfcomm_query.c +++ b/test/sdp_client/sdp_rfcomm_query.c @@ -114,7 +114,7 @@ void handle_query_rfcomm_event(sdp_query_event_t * event, void * context){ TEST_GROUP(SDPClient){ uint8_t spp_buffer[sizeof(sdp_test_record_list)]; - void setup(){ + void setup(void){ service_index = 0; sdp_query_rfcomm_register_callback(handle_query_rfcomm_event, NULL); sdp_parser_init(); diff --git a/test/sdp_client/service_attribute_search_query.c b/test/sdp_client/service_attribute_search_query.c index 668a152b8..ad4b0bd35 100644 --- a/test/sdp_client/service_attribute_search_query.c +++ b/test/sdp_client/service_attribute_search_query.c @@ -116,7 +116,7 @@ static void handle_sdp_parser_event(sdp_query_event_t * event){ TEST_GROUP(SDPClient){ - void setup(){ + void setup(void){ attribute_value_buffer_size = 1000; attribute_value = (uint8_t*) malloc(attribute_value_buffer_size); record_id = -1; diff --git a/test/sdp_client/service_search_query.c b/test/sdp_client/service_search_query.c index f886955b8..936865578 100644 --- a/test/sdp_client/service_search_query.c +++ b/test/sdp_client/service_search_query.c @@ -63,7 +63,7 @@ static void handle_sdp_parser_event(sdp_query_event_t * event){ TEST_GROUP(SDPClient){ - void setup(){ + void setup(void){ sdp_parser_init_service_search(); sdp_parser_register_callback(handle_sdp_parser_event); } diff --git a/test/security_manager/aestest.c b/test/security_manager/aestest.c index 0f970c053..28ba29416 100644 --- a/test/security_manager/aestest.c +++ b/test/security_manager/aestest.c @@ -19,7 +19,7 @@ static void hexdump2(void *data, int size){ printf("\n"); } -int main(){ +int main(void){ uint8_t key[16]; uint8_t plaintext[16]; bzero(key, 16); diff --git a/test/security_manager/mock.c b/test/security_manager/mock.c index cf1c55812..8b7c9423d 100644 --- a/test/security_manager/mock.c +++ b/test/security_manager/mock.c @@ -59,7 +59,7 @@ void mock_simulate_hci_event(uint8_t * packet, uint16_t size){ } } -void aes128_report_result(){ +void aes128_report_result(void){ uint8_t le_enc_result[22]; uint8_t enc1_data[] = { 0x0e, 0x14, 0x01, 0x17, 0x20, 0x00 }; memcpy (le_enc_result, enc1_data, 6); @@ -94,12 +94,12 @@ void mock_simulate_command_complete(const hci_cmd_t *cmd){ mock_simulate_hci_event((uint8_t *)&packet, sizeof(packet)); } -void mock_simulate_hci_state_working(){ +void mock_simulate_hci_state_working(void){ uint8_t packet[] = {BTSTACK_EVENT_STATE, 0, HCI_STATE_WORKING}; mock_simulate_hci_event((uint8_t *)&packet, sizeof(packet)); } -void mock_simulate_connected(){ +void mock_simulate_connected(void){ uint8_t packet[] = { 0x3e, 0x13, 0x01, 0x00, 0x40, 0x00, 0x01, 0x01, 0x18, 0x12, 0x5e, 0x68, 0xc9, 0x73, 0x18, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05}; mock_simulate_hci_event((uint8_t *)&packet, sizeof(packet)); } @@ -200,7 +200,7 @@ void hci_disconnect_security_block(hci_con_handle_t con_handle){ printf("hci_disconnect_security_block \n"); } -int hci_non_flushable_packet_boundary_flag_supported(){ +int hci_non_flushable_packet_boundary_flag_supported(void){ return 1; } diff --git a/test/security_manager/rijndael.c b/test/security_manager/rijndael.c index 137ddb865..68eef7293 100644 --- a/test/security_manager/rijndael.c +++ b/test/security_manager/rijndael.c @@ -10,7 +10,7 @@ typedef uint32_t u32; typedef uint8_t u8; -int rijndaelStartOfCode(){ +int rijndaelStartOfCode(void){ return 1; } @@ -1223,6 +1223,6 @@ u32 s0, s1, s2, s3, t0, t1, t2, t3; } -int rijndaelEndOfCode(){ +int rijndaelEndOfCode(void){ return 1; } diff --git a/test/security_manager/security_manager.c b/test/security_manager/security_manager.c index 47eddb4be..d1b7d0a15 100644 --- a/test/security_manager/security_manager.c +++ b/test/security_manager/security_manager.c @@ -130,7 +130,7 @@ void CHECK_EQUAL_ARRAY(uint8_t * expected, uint8_t * actual, int size){ TEST_GROUP(GATTClient){ - void setup(){ + void setup(void){ btstack_memory_init(); run_loop_init(RUN_LOOP_POSIX); sm_init();