mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-26 03:35:20 +00:00
more -Wstrict-prototypes fixes
This commit is contained in:
parent
694159226e
commit
40d1c7a481
24
src/daemon.c
24
src/daemon.c
@ -97,11 +97,11 @@ typedef struct {
|
||||
#pragma mark prototypes
|
||||
static void dummy_bluetooth_status_handler(BLUETOOTH_STATE state);
|
||||
static client_state_t * client_for_connection(connection_t *connection);
|
||||
static int clients_require_power_on();
|
||||
static int clients_require_discoverable();
|
||||
static void clients_clear_power_request();
|
||||
static void start_power_off_timer();
|
||||
static void stop_power_off_timer();
|
||||
static int clients_require_power_on(void);
|
||||
static int clients_require_discoverable(void);
|
||||
static void clients_clear_power_request(void);
|
||||
static void start_power_off_timer(void);
|
||||
static void stop_power_off_timer(void);
|
||||
|
||||
#pragma mark globals
|
||||
static hci_transport_t * transport;
|
||||
@ -121,7 +121,7 @@ static void dummy_bluetooth_status_handler(BLUETOOTH_STATE state){
|
||||
log_dbg("Bluetooth status: %u\n", state);
|
||||
};
|
||||
|
||||
static void daemon_no_connections_timeout(){
|
||||
static void daemon_no_connections_timeout(void){
|
||||
if (clients_require_power_on()) return; // false alarm :)
|
||||
log_dbg("No active client connection for %u seconds -> POWER OFF\n", DAEMON_NO_ACTIVE_CLIENT_TIMEOUT/1000);
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
@ -364,7 +364,7 @@ static int daemon_client_handler(connection_t *connection, uint16_t packet_type,
|
||||
// local cache used to manage UI status
|
||||
static HCI_STATE hci_state = HCI_STATE_OFF;
|
||||
static int num_connections = 0;
|
||||
static void update_ui_status(){
|
||||
static void update_ui_status(void){
|
||||
if (hci_state != HCI_STATE_WORKING) {
|
||||
bluetooth_status_handler(BLUETOOTH_OFF);
|
||||
} else {
|
||||
@ -611,7 +611,7 @@ int main (int argc, char * const * argv){
|
||||
|
||||
#define USE_POWER_OFF_TIMER
|
||||
|
||||
static void stop_power_off_timer(){
|
||||
static void stop_power_off_timer(void){
|
||||
#ifdef USE_POWER_OFF_TIMER
|
||||
if (timeout_active) {
|
||||
run_loop_remove_timer(&timeout);
|
||||
@ -620,7 +620,7 @@ static void stop_power_off_timer(){
|
||||
#endif
|
||||
}
|
||||
|
||||
static void start_power_off_timer(){
|
||||
static void start_power_off_timer(void){
|
||||
#ifdef USE_POWER_OFF_TIMER
|
||||
stop_power_off_timer();
|
||||
run_loop_set_timer(&timeout, DAEMON_NO_ACTIVE_CLIENT_TIMEOUT);
|
||||
@ -645,7 +645,7 @@ static client_state_t * client_for_connection(connection_t *connection) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void clients_clear_power_request(){
|
||||
static void clients_clear_power_request(void){
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) clients; it ; it = it->next){
|
||||
client_state_t * client_state = (client_state_t *) it;
|
||||
@ -653,7 +653,7 @@ static void clients_clear_power_request(){
|
||||
}
|
||||
}
|
||||
|
||||
static int clients_require_power_on(){
|
||||
static int clients_require_power_on(void){
|
||||
|
||||
if (global_enable) return 1;
|
||||
|
||||
@ -667,7 +667,7 @@ static int clients_require_power_on(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int clients_require_discoverable(){
|
||||
static int clients_require_discoverable(void){
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) clients; it ; it = it->next){
|
||||
client_state_t * client_state = (client_state_t *) it;
|
||||
|
10
src/hci.c
10
src/hci.c
@ -164,7 +164,7 @@ void hci_drop_link_key_for_bd_addr(bd_addr_t *addr){
|
||||
/**
|
||||
* count connections
|
||||
*/
|
||||
static int nr_hci_connections(){
|
||||
static int nr_hci_connections(void){
|
||||
int count = 0;
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) hci_stack.connections; it ; it = it->next, count++);
|
||||
@ -585,7 +585,7 @@ void hci_close(){
|
||||
// HCI_STATE_SLEEPING, off/sleep close
|
||||
// HCI_STATE_FALLING_ASLEEP on open
|
||||
|
||||
static int hci_power_control_on(){
|
||||
static int hci_power_control_on(void){
|
||||
|
||||
// power on
|
||||
int err = 0;
|
||||
@ -611,7 +611,7 @@ static int hci_power_control_on(){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hci_power_control_off(){
|
||||
static void hci_power_control_off(void){
|
||||
|
||||
log_dbg("hci_power_control_off\n");
|
||||
|
||||
@ -630,7 +630,7 @@ static void hci_power_control_off(){
|
||||
hci_stack.state = HCI_STATE_OFF;
|
||||
}
|
||||
|
||||
static void hci_power_control_sleep(){
|
||||
static void hci_power_control_sleep(void){
|
||||
|
||||
log_dbg("hci_power_control_sleep\n");
|
||||
|
||||
@ -649,7 +649,7 @@ static void hci_power_control_sleep(){
|
||||
hci_stack.state = HCI_STATE_SLEEPING;
|
||||
}
|
||||
|
||||
static int hci_power_control_wake(){
|
||||
static int hci_power_control_wake(void){
|
||||
|
||||
log_dbg("hci_power_control_wake\n");
|
||||
|
||||
|
@ -48,4 +48,4 @@ typedef enum {
|
||||
void hci_dump_open(char *filename, hci_dump_format_t format);
|
||||
void hci_dump_set_max_packets(int packets); // -1 for unlimited
|
||||
void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len);
|
||||
void hci_dump_close();
|
||||
void hci_dump_close(void);
|
||||
|
@ -192,7 +192,7 @@ static int h4_open(void *transport_config){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int h4_close(){
|
||||
static int h4_close(void){
|
||||
// first remove run loop handler
|
||||
run_loop_remove_data_source(hci_transport_h4->ds);
|
||||
|
||||
@ -231,7 +231,7 @@ static void h4_register_packet_handler(void (*handler)(uint8_t packet_type, ui
|
||||
packet_handler = handler;
|
||||
}
|
||||
|
||||
static void h4_deliver_packet(){
|
||||
static void h4_deliver_packet(void){
|
||||
if (read_pos < 3) return; // sanity check
|
||||
hci_dump_packet( hci_packet[0], 1, &hci_packet[1], read_pos-1);
|
||||
packet_handler(hci_packet[0], &hci_packet[1], read_pos-1);
|
||||
@ -241,7 +241,7 @@ static void h4_deliver_packet(){
|
||||
bytes_to_read = 1;
|
||||
}
|
||||
|
||||
static void h4_statemachine(){
|
||||
static void h4_statemachine(void){
|
||||
switch (h4_state) {
|
||||
|
||||
case H4_W4_PACKET_TYPE:
|
||||
@ -359,7 +359,7 @@ static void *h4_reader(void *context){
|
||||
}
|
||||
#endif
|
||||
|
||||
static const char * h4_get_transport_name(){
|
||||
static const char * h4_get_transport_name(void){
|
||||
return "H4";
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ void l2cap_emit_credits(l2cap_channel_t *channel, uint8_t credits) {
|
||||
l2cap_dispatch(channel, HCI_EVENT_PACKET, event, sizeof(event));
|
||||
}
|
||||
|
||||
void l2cap_hand_out_credits(){
|
||||
void l2cap_hand_out_credits(void){
|
||||
linked_item_t *it;
|
||||
for (it = (linked_item_t *) l2cap_channels; it ; it = it->next){
|
||||
if (!hci_number_free_acl_slots()) return;
|
||||
|
@ -52,7 +52,7 @@ static NSMutableDictionary *remote_devices = nil;
|
||||
static NSMutableDictionary *rfcomm_services = nil;
|
||||
|
||||
// Device info
|
||||
static void db_open(){
|
||||
static void db_open(void){
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
// NSUserDefaults didn't work
|
||||
@ -89,7 +89,7 @@ static void db_open(){
|
||||
[pool release];
|
||||
}
|
||||
|
||||
static void db_synchronize(){
|
||||
static void db_synchronize(void){
|
||||
log_dbg("stored prefs for %u devices\n", (unsigned int) [remote_devices count]);
|
||||
|
||||
// 3 different ways
|
||||
@ -106,7 +106,7 @@ static void db_synchronize(){
|
||||
// [defaults synchronize];
|
||||
}
|
||||
|
||||
static void db_close(){
|
||||
static void db_close(void){
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
db_synchronize();
|
||||
@ -197,7 +197,7 @@ static int get_name(bd_addr_t *bd_addr, device_name_t *device_name) {
|
||||
|
||||
#pragma mark PERSISTENT RFCOMM CHANNEL ALLOCATION
|
||||
|
||||
static int firstFreeChannelNr(){
|
||||
static int firstFreeChannelNr(void){
|
||||
BOOL channelUsed[MAX_RFCOMM_CHANNEL_NR+1];
|
||||
int i;
|
||||
for (i=0; i<=MAX_RFCOMM_CHANNEL_NR ; i++) channelUsed[i] = NO;
|
||||
@ -213,7 +213,7 @@ static int firstFreeChannelNr(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void deleteLeastUsed(){
|
||||
static void deleteLeastUsed(void){
|
||||
NSString * leastUsedName = nil;
|
||||
NSDate * leastUsedDate = nil;
|
||||
for (NSString * serviceName in [rfcomm_services allKeys]){
|
||||
|
@ -261,7 +261,7 @@ static int rfcomm_multiplexer_has_channels(rfcomm_multiplexer_t * multiplexer){
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rfcomm_dump_channels(){
|
||||
static void rfcomm_dump_channels(void){
|
||||
linked_item_t * it;
|
||||
int channels = 0;
|
||||
for (it = (linked_item_t *) rfcomm_channels; it ; it = it->next){
|
||||
@ -544,7 +544,7 @@ static void rfcomm_emit_service_registered(void *connection, uint8_t status, uin
|
||||
(*app_packet_handler)(connection, HCI_EVENT_PACKET, 0, (uint8_t *) event, sizeof(event));
|
||||
}
|
||||
|
||||
static void rfcomm_hand_out_credits(){
|
||||
static void rfcomm_hand_out_credits(void){
|
||||
linked_item_t * it;
|
||||
for (it = (linked_item_t *) rfcomm_channels; it ; it = it->next){
|
||||
rfcomm_channel_t * channel = (rfcomm_channel_t *) it;
|
||||
@ -1250,7 +1250,7 @@ void rfcomm_close_connection(void *connection){
|
||||
|
||||
#pragma mark RFCOMM BTstack API
|
||||
|
||||
void rfcomm_init(){
|
||||
void rfcomm_init(void){
|
||||
rfcomm_client_cid_generator = 0;
|
||||
rfcomm_multiplexers = NULL;
|
||||
rfcomm_services = NULL;
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void rfcomm_init();
|
||||
void rfcomm_init(void);
|
||||
|
||||
// register packet handler
|
||||
void rfcomm_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size);
|
||||
|
@ -109,7 +109,7 @@ service_record_item_t * sdp_get_record_for_handle(uint32_t handle){
|
||||
}
|
||||
|
||||
// get next free, unregistered service record handle
|
||||
uint32_t sdp_create_service_record_handle(){
|
||||
uint32_t sdp_create_service_record_handle(void){
|
||||
uint32_t handle = 0;
|
||||
do {
|
||||
handle = sdp_next_service_record_handle++;
|
||||
|
@ -60,7 +60,7 @@ typedef struct {
|
||||
} service_record_item_t;
|
||||
|
||||
|
||||
void sdp_init();
|
||||
void sdp_init(void);
|
||||
|
||||
void sdp_register_packet_handler(void (*handler)(void * connection, uint8_t packet_type,
|
||||
uint16_t channel, uint8_t *packet, uint16_t size));
|
||||
@ -86,5 +86,5 @@ void sdp_unregister_service_internal(void *connection, uint32_t service_record_h
|
||||
void sdp_unregister_services_for_connection(void *connection);
|
||||
|
||||
//
|
||||
void sdp_test();
|
||||
void sdp_test(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user