From 694159226e8380a2cf43597692c21cacb882ee67 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Mon, 6 Jun 2011 13:57:15 +0000 Subject: [PATCH] fix -Wstrict-prototypes --- include/btstack/btstack.h | 4 ++-- include/btstack/linked_list.h | 2 +- include/btstack/run_loop.h | 2 +- src/hci.h | 16 ++++++++-------- src/hci_transport.h | 11 ++++++----- src/l2cap.h | 2 +- src/l2cap_signaling.h | 4 ++-- src/remote_device_db.h | 4 ++-- src/run_loop.c | 2 +- src/run_loop_cocoa.m | 6 +++--- src/run_loop_embedded.c | 8 +++----- src/run_loop_posix.c | 8 ++++---- src/run_loop_private.h | 8 ++++---- src/socket_connection.c | 2 +- src/socket_connection.h | 6 +++--- 15 files changed, 42 insertions(+), 43 deletions(-) diff --git a/include/btstack/btstack.h b/include/btstack/btstack.h index 99db4a459..4c866dc7f 100644 --- a/include/btstack/btstack.h +++ b/include/btstack/btstack.h @@ -64,10 +64,10 @@ typedef void (*btstack_packet_handler_t) (uint8_t packet_type, uint16_t channel, void bt_use_tcp(const char * address, uint16_t port); // init BTstack library -int bt_open(); +int bt_open(void); // stop using BTstack library -int bt_close(); +int bt_close(void); // send hci cmd packet int bt_send_cmd(const hci_cmd_t *cmd, ...); diff --git a/include/btstack/linked_list.h b/include/btstack/linked_list.h index 251809487..8423ead57 100644 --- a/include/btstack/linked_list.h +++ b/include/btstack/linked_list.h @@ -55,7 +55,7 @@ void linked_list_add(linked_list_t * list, linked_item_t *item); // <-- a void linked_list_add_tail(linked_list_t * list, linked_item_t *item); // <-- add item to list as last element int linked_list_remove(linked_list_t * list, linked_item_t *item); // <-- remove item from list -void test_linked_list(); +void test_linked_list(void); #if defined __cplusplus } diff --git a/include/btstack/run_loop.h b/include/btstack/run_loop.h index e2b2a575e..429e2877f 100644 --- a/include/btstack/run_loop.h +++ b/include/btstack/run_loop.h @@ -86,7 +86,7 @@ int run_loop_remove_data_source(data_source_t *dataSource); // execute configured run_loop -void run_loop_execute(); +void run_loop_execute(void); #if defined __cplusplus } diff --git a/src/hci.h b/src/hci.h index 03aed5b36..82a8fb258 100644 --- a/src/hci.h +++ b/src/hci.h @@ -251,7 +251,7 @@ uint16_t hci_create_cmd_internal(uint8_t *hci_cmd_buffer, const hci_cmd_t *cmd, // set up HCI void hci_init(hci_transport_t *transport, void *config, bt_control_t *control, remote_device_db_t * remote_device_db); void hci_register_packet_handler(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)); -void hci_close(); +void hci_close(void); // power and inquriy scan control int hci_power_control(HCI_POWER_MODE mode); @@ -260,7 +260,7 @@ void hci_discoverable_control(uint8_t enable); /** * run the hci control loop once */ -void hci_run(); +void hci_run(void); // create and send hci command packets based on a template and a list of parameters int hci_send_cmd(const hci_cmd_t *cmd, ...); @@ -273,20 +273,20 @@ int hci_send_acl_packet(uint8_t *packet, int size); hci_connection_t * connection_for_handle(hci_con_handle_t con_handle); uint8_t hci_number_outgoing_packets(hci_con_handle_t handle); -uint8_t hci_number_free_acl_slots(); +uint8_t hci_number_free_acl_slots(void); int hci_ready_to_send(hci_con_handle_t handle); int hci_authentication_active_for_handle(hci_con_handle_t handle); void hci_drop_link_key_for_bd_addr(bd_addr_t *addr); -uint16_t hci_max_acl_data_packet_length(); +uint16_t hci_max_acl_data_packet_length(void); // -void hci_emit_state(); +void hci_emit_state(void); void hci_emit_connection_complete(hci_connection_t *conn); void hci_emit_l2cap_check_timeout(hci_connection_t *conn); void hci_emit_disconnection_complete(uint16_t handle, uint8_t reason); -void hci_emit_nr_connections_changed(); -void hci_emit_hci_open_failed(); -void hci_emit_btstack_version(); +void hci_emit_nr_connections_changed(void); +void hci_emit_hci_open_failed(void); +void hci_emit_btstack_version(void); void hci_emit_system_bluetooth_enabled(uint8_t enabled); void hci_emit_remote_name_cached(bd_addr_t *addr, device_name_t *name); void hci_emit_discoverable_enabled(uint8_t enabled); diff --git a/src/hci_transport.h b/src/hci_transport.h index 6288d2048..4d07f359e 100644 --- a/src/hci_transport.h +++ b/src/hci_transport.h @@ -49,10 +49,10 @@ extern "C" { /* HCI packet types */ typedef struct { int (*open)(void *transport_config); - int (*close)(); + int (*close)(void *transport_config); int (*send_packet)(uint8_t packet_type, uint8_t *packet, int size); void (*register_packet_handler)(void (*handler)(uint8_t packet_type, uint8_t *packet, uint16_t size)); - const char * (*get_transport_name)(); + const char * (*get_transport_name)(void); // custom extension for UART transport implementations int (*set_baudrate)(uint32_t baudrate); } hci_transport_t; @@ -72,9 +72,10 @@ typedef struct { #endif // inline various hci_transport_X.h files -extern hci_transport_t * hci_transport_h4_instance(); -extern hci_transport_t * hci_transport_h5_instance(); -extern hci_transport_t * hci_transport_usb_instance(); +extern hci_transport_t * hci_transport_h4_instance(void); +extern hci_transport_t * hci_transport_h4_dma_instance(void); +extern hci_transport_t * hci_transport_h5_instance(void); +extern hci_transport_t * hci_transport_usb_instance(void); #if defined __cplusplus } diff --git a/src/l2cap.h b/src/l2cap.h index dc409ad41..552e589d7 100644 --- a/src/l2cap.h +++ b/src/l2cap.h @@ -114,7 +114,7 @@ typedef struct { } l2cap_service_t; -void l2cap_init(); +void l2cap_init(void); void l2cap_register_packet_handler(void (*handler)(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size)); void l2cap_create_channel_internal(void * connection, btstack_packet_handler_t packet_handler, bd_addr_t address, uint16_t psm, uint16_t mtu); void l2cap_disconnect_internal(uint16_t local_cid, uint8_t reason); diff --git a/src/l2cap_signaling.h b/src/l2cap_signaling.h index 06d5852fa..84722f0d3 100644 --- a/src/l2cap_signaling.h +++ b/src/l2cap_signaling.h @@ -57,6 +57,6 @@ typedef enum { } L2CAP_SIGNALING_COMMANDS; uint16_t l2cap_create_signaling_internal(uint8_t * acl_buffer,hci_con_handle_t handle, L2CAP_SIGNALING_COMMANDS cmd, uint8_t identifier, va_list argptr); -uint8_t l2cap_next_sig_id(); -uint16_t l2cap_next_local_cid(); +uint8_t l2cap_next_sig_id(void); +uint16_t l2cap_next_local_cid(void); diff --git a/src/remote_device_db.h b/src/remote_device_db.h index 75dabe42b..86dfa82fa 100644 --- a/src/remote_device_db.h +++ b/src/remote_device_db.h @@ -40,8 +40,8 @@ typedef struct { // management - void (*open)(); - void (*close)(); + void (*open)(void); + void (*close)(void); // link key int (*get_link_key)(bd_addr_t *bd_addr, link_key_t *link_key); diff --git a/src/run_loop.c b/src/run_loop.c index 5a00aacef..c9c2c3b44 100644 --- a/src/run_loop.c +++ b/src/run_loop.c @@ -58,7 +58,7 @@ extern run_loop_t run_loop_cocoa; #endif // assert run loop initialized -void run_loop_assert(){ +void run_loop_assert(void){ #ifndef EMBEDDED if (!the_run_loop){ log_err("ERROR: run_loop function called before run_loop_init!\n"); diff --git a/src/run_loop_cocoa.m b/src/run_loop_cocoa.m index 9be247a29..825aaee7d 100644 --- a/src/run_loop_cocoa.m +++ b/src/run_loop_cocoa.m @@ -132,15 +132,15 @@ int cocoa_remove_timer(timer_source_t * ts){ return 0; } -void cocoa_init(){ +void cocoa_init(void){ } -void cocoa_execute() +void cocoa_execute(void) { CFRunLoopRun(); } -void cocoa_dump_timer(){ +void cocoa_dump_timer(void){ fprintf(stderr, "WARNING: run_loop_dump_timer not implemented yet!"); return; } diff --git a/src/run_loop_embedded.c b/src/run_loop_embedded.c index 6bd24e19c..6c1b665a1 100644 --- a/src/run_loop_embedded.c +++ b/src/run_loop_embedded.c @@ -96,7 +96,7 @@ int embedded_remove_timer(timer_source_t *ts){ #endif } -void embedded_dump_timer(){ +void embedded_dump_timer(void){ #ifndef EMBEDDED linked_item_t *it; int i = 0; @@ -110,13 +110,11 @@ void embedded_dump_timer(){ /** * Execute run_loop */ -void embedded_execute() { +void embedded_execute(void) { data_source_t *ds; #ifdef HAVE_TIME timer_source_t *ts; struct timeval current_tv; - struct timeval next_tv; - struct timeval *timeout; #endif while (1) { @@ -144,7 +142,7 @@ void embedded_execute() { } } -void embedded_init(){ +void embedded_init(void){ data_sources = NULL; timers = NULL; } diff --git a/src/run_loop_posix.c b/src/run_loop_posix.c index f18b5b42a..6e089bf86 100644 --- a/src/run_loop_posix.c +++ b/src/run_loop_posix.c @@ -45,7 +45,7 @@ #include #include -void posix_dump_timer(); +void posix_dump_timer(void); // the run loop static linked_list_t data_sources; @@ -99,7 +99,7 @@ int posix_remove_timer(timer_source_t *ts){ return linked_list_remove(&timers, (linked_item_t *) ts); } -void posix_dump_timer(){ +void posix_dump_timer(void){ linked_item_t *it; int i = 0; for (it = (linked_item_t *) timers; it ; it = it->next){ @@ -111,7 +111,7 @@ void posix_dump_timer(){ /** * Execute run_loop */ -void posix_execute() { +void posix_execute(void) { fd_set descriptors; data_source_t *ds; timer_source_t *ts; @@ -184,7 +184,7 @@ void posix_execute() { } } -void posix_init(){ +void posix_init(void){ data_sources = NULL; timers = NULL; } diff --git a/src/run_loop_private.h b/src/run_loop_private.h index 4d77a5274..5659c8883 100644 --- a/src/run_loop_private.h +++ b/src/run_loop_private.h @@ -49,15 +49,15 @@ int run_loop_timer_compare(timer_source_t *a, timer_source_t *b); #endif // -void run_loop_timer_dump(); +void run_loop_timer_dump(void); // internal use only typedef struct { - void (*init)(); + void (*init)(void); void (*add_data_source)(data_source_t *dataSource); int (*remove_data_source)(data_source_t *dataSource); void (*add_timer)(timer_source_t *timer); int (*remove_timer)(timer_source_t *timer); - void (*execute)(); - void (*dump_timer)(); + void (*execute)(void); + void (*dump_timer)(void); } run_loop_t; diff --git a/src/socket_connection.c b/src/socket_connection.c index f0a887b76..759b3a00e 100644 --- a/src/socket_connection.c +++ b/src/socket_connection.c @@ -172,7 +172,7 @@ void static socket_connection_emit_connection_closed(connection_t *connection){ (*socket_connection_packet_callback)(connection, DAEMON_EVENT_PACKET, 0, (uint8_t *) &event, 1); } -void static socket_connection_emit_nr_connections(){ +void static socket_connection_emit_nr_connections(void){ linked_item_t *it; uint8_t nr_connections = 0; for (it = (linked_item_t *) connections; it != NULL ; it = it->next, nr_connections++); diff --git a/src/socket_connection.h b/src/socket_connection.h index b68384cf5..9ed02c28a 100644 --- a/src/socket_connection.h +++ b/src/socket_connection.h @@ -48,7 +48,7 @@ typedef struct connection connection_t; /** * create socket data_source for socket specified by launchd configuration */ -int socket_connection_create_launchd(); +int socket_connection_create_launchd(void); /** * create socket for incoming tcp connections @@ -78,7 +78,7 @@ int socket_connection_close_tcp(connection_t *connection); /** * create unix socket connection to BTdaemon */ -connection_t * socket_connection_open_unix(); +connection_t * socket_connection_open_unix(void); /** * close unix connection to BTdaemon @@ -105,4 +105,4 @@ void socket_connection_send_packet_all(uint16_t type, uint16_t channel, uint8_t * try to dispatch packet for all "parked" connections. * if dispatch is successful, a connection is added again to run loop */ -void socket_connection_retry_parked(); +void socket_connection_retry_parked(void);